;**************************
;
;    Install_Retina
;
;**************************
;
; Retina Installationsscript
;  für Commodores Installer
;
;**************************
;
; Autor:
; Ibrahim Tertemiz für
; MS MacroSystem GmbH
;      Witten
;
;**************************
; $VER: Retina_Install 2.1 (29.3.94)
;
; History:
; ========
; 30. Mar. 94 RetinaComm-Inst. geändert
; 29. Mar. 94 R3D-Treiber
; 28. Mar. 94 AnCoS Manual
; 28. Feb. 94 append neuer Def. an Monitorlist
;             RetinaSystem-rename-Bug beseitigt
; 25. Feb. 94 rename der alten Verz. geändert...
; 24. Feb. 94 ancos.catalog wird aus RETINA:AnCoS kopiert.
; 24. Feb. 94 Warnung wenn Einträge in der (User-)Startup-Sequence sind.
; 24. Feb. 94 Alte Verzeichnisse werden umbenannt,
;             wenn sie oberhalb des Retina-Verz. sind.
; 24. Feb. 94 Wieder alles in Verz. Retina
; 23. Feb. 94 Hartmut-Bugs beseitigt.
; 14. Feb. 94 T:adpro.library (Z. 548)
; 26. Jan. 94 MSG_CopyLibs eingefügt
; 24. Jan. 94 +: RetinaEmu in WBStartup, falls schon ex.
; 20. Jan. 94 für Rel. 2.0ß umgeschrieben
;  5. Aug. 93 für Rel. 1.4 umgeschrieben
; 16. Juni letzte Änderungen
;     Juni 93 für Rel. 1.3 umgeschrieben
; 17. März komplett überarbeitet
;  7. März 93 erste Version
;
;**************************
;
; bekannte Bugs
; =============
;
;**************************

; Einige Variablen setzen
(Set FALSE 0)
(Set TRUE 1)
(Set srcdisk "Retina:")
(Set cbx (tackon srcdisk "c/CBx"))

(Set oldlevel @user-level) ;orginal user-level speichern...
(Set check FALSE) ;Eigentlich muss nicht geprüft werden
(Set Overwrite FALSE) ;Und auch nichts überschrieben

; OS2.0 - Test machen...
(Set os2 (NOT (< (/ (getversion) 65536) 37)))

; Was für ein Prozessor?
(if (>= (+ (database "cpu")) 68020)
   (Set CPU030 TRUE)
   (Set CPU030 FALSE)
)

; LOCALE vorhanden?
(Set WB2.1 (= (exists "libs:locale.library") 1))


(if (patmatch @language "deutsch")
   ;Sprache ist deutsch
  (
   (Set default-lang 2)
   (Set MSG_GetDisk "Bitte legen Sie die Diskette mit dem Namen \"RETINA\" in ein beliebiges Laufwerk.")
   (Set HLP_GetDisk (cat MSG_GetDisk "\nIch benötige diese Diskette, um die Installation vornehmen zu können!\n"))
   (Set MSG_NoOS2 "Amiga DOS 2.0 nicht gefunden\n Bitte installieren Sie erst\n Workbench Version 2.0\n oder größer" )
   (Set MSG_CleanStartUp (cat "Es befinden sich in der\n"
         "\"Startup-Sequence\" bzw. \"User-Startup\"\n" "Anweisungen, die die Retina betreffen.\n"
         "Bitte entfernen Sie diese, um zu vermeiden, daß ältere Versionen der Retina-Software"
         " eingebunden werden. "))
   (Set CH_Cont "Weiter")
   (Set CH_Abort "Abbruch")
   (Set MSG_Cont "Wollen Sie die Veränderungen an den Dateien jetzt durchführen?")
   (Set HLP_Cont (cat "Sie sollten die Zeilen aus der \"Startup-Sequence\" bzw. \"User-Startup\""
         ", die die Retina-Software betreffen entfernen.\n"
         "Falls Sie dies jetzt tun wollen, wählen Sie \"" CH_Abort "\"."))
   (Set MSG_CleanNow (cat "Bitte stellen Sie vor einem neuen Start der "
         " Installation sicher, daß die alten Versionen der Software nicht"
         " mehr aufgerufen werden.\n\n In den nächsten Versionen der"
         " Retina Installation werden die Pfade automatisch in der Datei"
         "\"s:User-Startup\" gesetzt."))
   (Set MSG_WorkLibs "Kopiere benötigte Libraries...")
   (Set MSG_WorkPreset "Kopiere Grundvoreinstellungen...")
   (Set MSG_CopyPrefsTo "MSG_CopyPrefsTo")
   (Set HLP_CopyPrefsTo "HLP_CopyPrefsTo")
   (Set MSG_AppendMoFi "MSG_AppendMoFi")
   (Set HLP_AppendMoFi "HLP_AppendMoFi")
   (Set MSG_WorkLoc "Kopiere Sprachdateien...")
   (Set MSG_WorkRsys "Kopiere Verzeichnis RetinaSystem...")
   (Set MSG_WorkRTools "Kopiere Verzeichnis RetinaTools...")
   (Set MSG_WorkADPro "Kopiere ADPro-Dateien...")
   (Set MSG_WorkIM "Kopiere ImageMaster-Dateien...")
   (Set MSG_WorkDevel "Kopiere Entwicklerunterlagen...")
   (Set MSG_Makeminlocdir "Erstelle Verzeichnisse für \"minloc.library\" ")
   (Set HLP_Makeminlocdir "Erstelle Verzeichnisse für \"minloc.library\" ")
   (Set MSG_WhereRet "Wo sollen die Programme für die Retina hinkopiert werden?")
   (Set HLP_WhereRet "Geben Sie bitte das Zielverzeichnis für die Programme an, die für die Arbeit mit der Retina benötigt werden")
   (Set CH_RenOld "jetzt autom. umbenennen")
   (Set CH_LetOld "später manuell umbenennen")
   (Set MSG_FoundOld (cat "Alte Retina-Verzeichnisstruktur gefunden!\n\n"
         "Sollen diese jetzt umbennant werden?\n" "Es wird die Endung \".OLD\" angehängt."))
   (Set HLP_FoundOld (cat "Das Vorhandensein der alten Retina-Verzeichnisse\n"
         "kann zu Mißverständnissen führen!\n\n"
         "Es wird empfohlen, diese Verzeichnisse\njetzt umzubenennen..."))
   (Set MSG_RenOld (cat "Benenne Verzeichnis um!\n" "Bitte stellen sie vor einem Reset sicher,"
         " daß keine Referenzen mehr auf dieses Verzeichnis existieren."
         "\nDer neue Name ist: "))
   (Set HLP_RenOld (cat "Das Verzeichnis wird umbenannt, um spätere Mißverständnise auszuschließen."
         "Bitte stellen Sie sicher, daß keine Referenzen mehr auf dieses Verzeichnis "
         "existieren!"))
   (Set MSG_WhereRetSys "Wo sollen die Workbench-Emulation und die zugehörigen Programme hinkopiert werden?")
   (Set HLP_WhereRetSys "Geben Sie bitte das Zielverzeichnis für die Workbench-Emulation und die zugehörigen Programme an?")
   (Set MSG_WhereRetTool "Wo sollen die Hilfsprogramme für Retina hinkopiert werden?")
   (Set HLP_WhereRetTool "Geben Sie bitte das Zielverzeichnis für die Hilfsprogramme an.")
   (Set MSG_WhereRetDemo "Wo sollen die Demo-Programme für Retina hinkopiert werden?")
   (Set HLP_WhereRetDemo "Geben Sie bitte das Zielverzeichnis für die Demo-Programme an.")
   (Set MSG_EdStartup "Sollen die Pfade für die Retina-Verzeichnisse in die \"User-Startup\" eingetragen werden?")
   (Set HLP_EdStartup "Wenn Sie die Retina Programme auch vom CLI aus benutzen möchten, sollte der Pfad auf die Programme jetzt hinzugefügt werden.")
   (Set MSG_WhereRACE "Wo soll RACE hinkopiert werden?")
   (Set HLP_WhereRACE "Geben Sie bitte das Zielverzeichnis für RACE an.")
   (Set MSG_WhereR3D "Wo soll der R3D-Treiber hinkopiert werden?")
   (Set HLP_WhereR3D "Geben Sie bitte das Zielverzeichnis für den R3D-Treiber an.")
   (Set MSG_WhereAnCoS "Wo soll AnCoS hinkopiert werden?")
   (Set HLP_WhereAnCoS "Geben Sie bitte das Zielverzeichnis für AnCoS an.")
   (Set MSG_CopyRetSys MSG_WorkRsys)
   (Set HLP_CopyRetSys MSG_WorkRsys)
   (Set MSG_CopyEmu (cat "Soll die Intuitionemulation der Retina automatisch "
         "\n bei jedem Laden der Workbench gestartet werden?"))
   (Set HLP_CopyEmu (cat "Wenn Sie wünschen, wird das Programm \"RetinaEmu\" in das Verzeichnis \"SYS:WBStartup\" kopiert."
         " Von dort aus wird es jedesmal beim Laden der Workbench gestartet."))
   (Set HLP_CopyRetTool "Kopiere Hilfsprogramme für Retina...")
   (Set MSG_CopyRetTool "Kopiere Retina-Tools")
   (Set HLP_CopyRetDemos "Kopiere Demoprogramme für Retina...")
   (Set MSG_CopyRetDemos "Kopiere Retina-Demos")
   (Set HLP_CopyRACE "Kopiere RACE ...")
   (Set MSG_CopyRACE "Kopiere RACE")
   (Set HLP_CopyR3D "Kopiere den R3D-Treiber ...")
   (Set MSG_CopyR3D "Kopiere den R3D-Treiber")
   (Set HLP_CopyAnCoS "Kopiere AnCoS...")
   (Set MSG_CopyAnCoS "Kopiere AnCoS")
   (Set MSG_SureDir1 "\n Das Verzeichnis ")
   (Set MSG_SureDir2 " wird automatisch erstellt!")
   (Set MSG_WorkPreset "Kopiere die Grundvoreinstellungen")
   (Set MSG_CopyADPro "Möchten Sie den Retina-Saver für ADPro installieren?")
   (Set HLP_CopyADPro "Wenn Sie wünschen, wird die neueste Version des Retina-Savers für ADPro installiert.")
   (Set MSG_EnterADProDir "Bitte geben Sie das Verzeichnis an, in dem ADPro installiert ist...")
   (Set HLP_EnterADProDir MSG_EnterADProDir )
   (Set MSG_Enterrexxdir "Geben Sie bitte das Verzeichnis an, in dem die ADPro-ARexx Scripte sind...")
   (Set HLP_Enterrexxdir MSG_Enterrexxdir)
   (Set MSG_CopySaver "Möchten Sie den Retina-Saver für \"ADPro\" installieren?")
   (Set HLP_CopySaver MSG_CopySaver)
   (Set MSG_CopyIM "Möchten Sie den Retina-Anzeiger für \"ImageMaster\" installieren?")
   (Set HLP_CopyIM (cat MSG_CopyIM "\n Falls Sie wünschen, wird der Retina-Anzeiger installiert, um Grafiken in höchster Qualität auf der Retina darstellen zu können\n"))
   (Set MSG_CopyIMStuff "Kopiere für Imagemaster benötigtes Programm: ")
   (Set HLP_CopyIMStuff "Kopiere für Imagemaster benötigtes Programm: ")
   (Set MSG_GetDestDir (cat "Bitte geben Sie das Verzeichnis an, in dem \" " ProgName " \" installiert werden soll.\nDas Verzeichnis \" " ProgName " \" wird automatisch erzeugt."))
   (Set HLP_GetDestDir (cat "Suchen Sie bitte das Verzeichnis aus, in das \" " Progname " \" kopiert werden soll.\nDas Verzeichnis \" " Progname " \" wird bei Bedarf automatisch erzeugt!\n"))
   (Set MSG_Copy "Kopiere  benötigten Dateien\n")
   (Set HLP_Copy MSG_Copy)
   (Set MSG_CopyDevel? "Soll das Entwicklerpaket auch kopiert werden?")
   (Set HLP_CopyDevel? MSG_CopyDevel?)
   (Set MSG_WhereDevel "Wo soll das Entwicklerpaket hinkopiert werden ?")
   (Set HLP_WhereDevel MSG_WhereDevel)
   (Set MSG_CopyDevel! "Ich kopiere das Entwicklerpaket...")
   (Set HLP_CopyDevel! MSG_CopyDevel!)
   (Set MSG_Create_Dir "Erzeuge benötigte Verzeichnisse...")
   (Set HLP_Create_Dir "Erzeuge benötigte Verzeichnisse, da sie noch nicht existierten...")
   (Set MSG_LongXtract "Entpacke Archiv...\nDieser Vorgang kann einige Zeit dauern!")
   (Set MSG_Xtract "Entpacke Archiv...")
   (Set HLP_Xtract "Die zu installierenden Dateien werden entpackt...")
   (Set MSG_CopyLibs1 "Kopiere benötigte library ")
   (Set MSG_CopyLibs2 " nach libs:")
  )
   ;Sprache ist englisch
  (
   (Set default-lang 4)
   (Set MSG_NoOS2 "could not locate AmigaOS 2.0 or newer! \n Please install at least Amiga OS 2.0 first...")
   (Set MSG_CleanStartUp (cat "There are commands in the files\n"
         "\"Startup-Sequence\" and/or \"User-Startup\"\n" "which refer to the Retina software.\n"
         "Please delete them to avoid that older versions of the software can be used."))
   (Set CH_Cont "Continue")
   (Set CH_Abort "Abort")
   (Set MSG_Cont "Do you want to change the files now?")
   (Set HLP_Cont (cat "You can edit the lines referencing the Retina software"
         " in the files\n \"Startup-Sequence\" and/or  \"User-Startup\"\n now. "
         "\nIf you want to edit the files now, select \"" CH_Abort "\"."))
   (Set MSG_CleanNow (cat "Please make sure that no references to the Retina"
         " software remain in the files \"Startup-Sequence\" and/or  \"User-Startup\""
         " before starting the Installation again.\n\n"
         " Future versions of the Retina installation will add the path"
         " to the Retina software automatically in the file "
         "\"s:User-Startup\"."))
   (Set MSG_GetDisk "Please insert disk named \"RETINA\" in any drive.")
   (Set HLP_GetDisk (cat MSG_GetDisk "\nI need this disk to perform the installation!\n"))
   (Set MSG_WorkLibs "Copying needed libraries...")
   (Set MSG_Makeminlocdir "Creating directories needed for \"minloc.library\" ")
   (Set HLP_Makeminlocdir "Creating directories needed for \"minloc.library\" ")
   (Set MSG_WhereRet "Where do you want the programs which are needed for the work with Retina to be copied ?")
   (Set HLP_WhereRet "Please select the destination directory for the programs which are needed for the Retina.")
   (Set CH_RenOld "automatic rename now")
   (Set CH_LetOld "manual rename later")
   (Set MSG_FoundOld (cat "Old Retina directory found!\n\n" "Shall I rename them now"
         " to avoid confusion between the different versions?"
         "\nThey will get the appendix \".OLD\"."))
   (Set HLP_FoundOld (cat " The presence of the old Retina directoies can be confusing!"
         "It is recommended to rename them now."))
   (Set MSG_RenOld "Renaming old directory.\nNew name will be: ")
   (Set HLP_RenOld (cat "Renaming old retina directory to avoid confusion "
         "between old and new versions.\nThe new name will be: "))
   (Set MSG_WhereRetSys "Where do you want the workbench-emulation and the associated programs to be copied to?")
   (Set HLP_WhereRetSys "Please select the destination directory for the workbench-emulation and the associated files.")
   (Set MSG_WhereRetTool "Where do you want the Retina-Tools to be copied to?")
   (Set HLP_WhereRetTool "Please select the destination directory for the Retina-tools.")
   (Set MSG_WhereRetDemo "Where do you want the Retina-demos to be copied to?")
   (Set HLP_WhereRetDemo "Please select the destination directory for the Retina-demos.")
   (Set MSG_EdStartup "Do you want me to add the path to the Retina programs in the \"User-Startup\" ?")
   (Set HLP_EdStartup (cat "If you want to access the Retina programs also from the shell,"
           " you should add the path to this directories. This can be done automatically"
           "by the installation now."))
   (Set MSG_WhereRACE "Where do you want RACE to be copied to?")
   (Set HLP_WhereRACE "Please select the destination directory for RACE.")
   (Set MSG_WhereAnCoS "Where do you want AnCoS to be copied to?")
   (Set HLP_WhereAnCoS "Please select the destination directory for AnCoS.")
   (Set MSG_WorkRsys "copying directory RetinaSystem...")
   (Set MSG_CopyRetSys MSG_WorkRsys)
   (Set HLP_CopyRetSys MSG_WorkRsys)
   (Set MSG_CopyEmu (cat "Do you want \"RetinaEmu\" to be started each time"
         " the Workbench is loaded ?"))
   (Set HLP_CopyEmu (cat "If you want \"RetinaEmu\" is copied to \"SYS:WBStartup\"."
         " From there it is launched each time Workbench is loaded."))
   (Set MSG_CopyRetTool "Copying Retina tools")
   (Set HLP_CopyRetTool "Copying tools for Retina...")
   (Set HLP_CopyRetDemos "Copying demos for Retina...")
   (Set MSG_CopyRetDemos HLP_CopyRetDemos)
   (Set HLP_CopyRACE "Copying RACE ...")
   (Set MSG_CopyRACE "Copying RACE")
   (Set HLP_CopyAnCoS "Copying AnCoS...")
   (Set MSG_CopyAnCoS "Copying AnCoS")
   (Set MSG_SureDir1 "\n The directory ")
   (Set MSG_SureDir2 " will be created automatically!")
   (Set MSG_WorkPreset "copying basic presets")
   (Set MSG_WorkLibs "copying libraries...")
   (Set MSG_WorkLoc "copying locale files...")
   (Set MSG_WorkRTools "copying directory RetinaTools...")
   (Set MSG_WorkADPro "copying files needed for ADPro...")
   (Set MSG_WorkIM "copying files needed for ImageMaster...")
   (Set MSG_WorkDevel "copying developer documentation...")
   (Set MSG_CopyADPro "Do you want to have the latest version of the Retina saver for ADPro installed?")
   (Set HLP_CopyADPro "If you want, I can install the latest version of the Retina saver for ADPro...")
   (Set MSG_EnterADProDir "Please select the directory where you have installed ADPro")
   (Set HLP_EnterADProDir MSG_EnterADProDir )
   (Set MSG_Enterrexxdir "please select the destination directory for the ADPro-Arexx scripts...")
   (Set HLP_Enterrexxdir MSG_Enterrexxdir)
   (Set MSG_CopySaver(cat "Do you want to install the Retinasaver for \"ADPro\"?"))
   (Set HLP_CopySaver MSG_CopySaver)
   (Set MSG_CopyIM "Do you want to have installed the Retinaviewer for \"ImageMaster\" ?")
   (Set HLP_CopyIM (cat MSG_CopyIM "\n If you want, I can also install the Retinaviewer to display your graphics at best quality on the Retina board\n"))
   (Set MSG_CopyIMStuff "copying needed program for \"ImageMaster\" called: ")
   (Set HLP_CopyIMStuff "copying needed program for \"ImageMaster\" called: ")
   (Set MSG_GetDir (cat "Please select the destination directory for \" " ProgName " \". The \" " ProgName " \" directory will be created automatically!"))
   (Set HLP_GetDir MSG_GetXiDir)
   (Set MSG_Copy (cat"Copying files needed for" ProgName ".\n"))
   (Set HLP_Copy MSG_CopyXiPaint)
   (Set MSG_CopyDevel? " Do you want the developer package to be copied, too?")
   (Set HLP_CopyDevel? MSG_CopyDevel)
   (Set MSG_WhereDevel "Where do you want the developer package to be copied?")
   (Set HLP_WhereDevel MSG_WhereDevel)
   (Set MSG_CopyDevel! " copying the developer package...")
   (Set HLP_CopyDevel! MSG_CopyDevel)
   (Set MSG_Create_Dir "Creating needed directories...")
   (Set HLP_Create_Dir "Creating needed directories, because I could not find them...")
   (Set MSG_LongXtract "Extracting files from archive ...\n This can take a while!")
   (Set MSG_Xtract "Extracting files from archive ...")
   (Set HLP_Xtract "The files to be installed are extracted from archive ...")
   (Set MSG_CopyLibs1 "copying needed library ")
   (Set MSG_CopyLibs2 " to libs:")
   (Set MSG_CopyPrefsTo "MSG_CopyPrefsTo")
   (Set HLP_CopyPrefsTo "HLP_CopyPrefsTo")
   (Set MSG_AppendMoFi "MSG_AppendMoFi")
   (Set HLP_AppendMoFi "HLP_AppendMoFi")
  )
)

;Prozeduren um File kurz zu halten...
(procedure Check ((If (NOT (patmatch (fileonly DestDir) DirName))
  (; wenn DestDir <> *(/|:) DirName
   (if (= (exists (tackon DestDir DirName)) 2)
 ; Wenn DestDir ex. reingehen...
 ((Set DestDir (tackon DestDir DirName))
 )
 ; Sonst erst makedir und dann reingehen...
 ((makedir (tackon DestDir DirName)
           (prompt MSG_Create_Dir DirName)
           (help HLP_Create_Dir DirName @makedir-help)
           (infos)
           (safe)
   )
  (Set DestDir (tackon DestDir DirName))
 )
   )
  )
   )
  )
)

;Prozedur GetDir: sucht ein neues Verzeichnis aus und liefert DestDir
(procedure GetDir ((Set DestDir (askdir   (prompt MSG_EnterDest)
                                          (help HLP_EnterDest @askdir-help)
                                          (default mydefdest)
                                )
                    )
                  )
)

; main()
;*******

; Wenn kein OS2.0 installiert, abbrechen
(if (not os2)
   (abort MSG_NoOS2)
)

; steht in der User/Startup-Seq. schon Retina?
; sollte in der nächsten Version raus!
(run "search >T:RetinaInstall_tmp s:Startup-Sequence Retina"
)
(if (= 1 (exists "S:User-Startup"))
   (run "search >>T:RetinaInstall_tmp s:User-Startup Retina"))
(if (NOT (= 0 (getsize "T:RetinaInstall_tmp")))
; ja => Meldung
 ((message MSG_CleanStartup)
  (if (askbool (prompt MSG_Cont) (help HLP_Cont) (choices  CH_Abort CH_Cont))
     ((delete "T:RetinaInstall_tmp" (optional "force")) (exit MSG_CleanNow))
     (delete "T:RetinaInstall_tmp" (optional "force"))
  )
 )
)

;gucken ob srcDisk in einem Laufwerk ist
(Set existsrc (getassign "Retina" "v"))
(if (= existsrc "") ;wenn "Retina:" in keinem Laufwerk
   (askdisk (prompt MSG_GetDisk)
   (help HLP_GetDisk @askdisk-help)
   (dest "Retina")
   )
)


(working MSG_WorkLibs)
;libs kopieren
;retina.library
(copylib (source (tackon srcdisk "libs/retina.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "retina.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 5)
;retinaemu.library
(copylib (source (tackon srcdisk "libs/retinaemu.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "retinaemu.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 6)
;multipic.library
(copylib (source (tackon srcdisk "libs/multipic.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "multipic.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 8)
;vlab.library
(copylib (source (tackon srcdisk "libs/vlab.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "vlab.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 10)

;harlequin.library
(copylib (source (tackon srcdisk "libs/harlequin.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "harlequin.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 13)

;pfile.library
(copylib (source (tackon srcdisk "libs/pfile.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "pfile.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
)
(complete 16)

; Presets kopieren
(working MSG_WorkPreset)
(if (= (exists "ENVARC:Retina/Monitor") 0)
   (; Presets existieren nicht, also kopieren
 (copyfiles  (prompt MSG_CopyPrefsTo)
             (help HLP_CopyPrefsTo @copyfiles-help)
             (source (tackon srcdisk "Prefs/Env-Archive/Retina"))
             (dest "ENVARC:Retina")
             (all)
 )
 (copyfiles  (prompt MSG_CopyPrefsTo)
             (help HLP_CopyPrefsTo @copyfiles-help)
             (source "ENVARC:Retina")
             (dest "ENV:Retina")
             (all)
 )
   )
   (;append neuer Definitionen (NTSC und PAL)
    (if (= 1 (exists "ENVARC:Retina/Monitorlist"))
     ((rename "ENVARC:Retina/Monitorlist" "ENVARC:Retina/Monitorlist.OLD")
      (textfile (dest "ENVARC:Retina/Monitorlist")
                (prompt MSG_AppendMoFi)
                (help HLP_AppendMoFi)
                (append "\" NTSC\"                 15734 15734     60  60\n\" PAL\"                  15625 15625     50  50\n")
                (include "ENVARC:Retina/Monitorlist.OLD")
      )
      (copyfiles (source "ENVARC:Retina/Monitorlist")
                 (dest "ENV:Retina/")
                 (prompt MSG_CopyPrefsTo)
                 (help HLP_CopyPrefsTo @copyfiles-help)
      )
     )
    )
   )
)
(complete 20)

(working MSG_WorkLoc)
; LOCALE: einrichten und kopieren
(If (NOT WB2.1)
   (; WB >= 2.1 existiert NICHT => minloc installieren
   (copylib (source (tackon srcdisk "libs/minloc.library"))
   (dest "libs:")
   (prompt MSG_CopyLibs1 "minloc.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)

   )
   ; Locale usw. für minloc erzeugen
   (makedir "SYS:Locale"
   (prompt MSG_Makeminlocdir)
   (help HLP_Makeminlocdir @makedir-help)
   )
   (makedir "SYS:Locale/Catalogs"
   (prompt MSG_Makeminlocdir)
   (help HLP_Makeminlocdir @makedir-help)
   )
   (Set locdest "SYS:Locale/Catalogs")
   (if (= default-lang 2)
   (
  (textfile (prompt MSG_CreateMLL)
   (help HLP_CreateMLL)
   (dest "ENVARC:MINLOCLANGUAGE")
   (append "deutsch\n")
  )
  (textfile (prompt MSG_CreateMLL)
   (help HLP_CreateMLL)
   (dest "ENV:MINLOCLANGUAGE")
   (append "deutsch\n")
  )
   )
   )
   )
   (; Wenn >= 2.1 dann dest = LOCALE:Catalogs
(Set locdest "LOCALE:Catalogs")
 ; Falls altes Catalog ex. löschen
 (if (= (exists "LOCALE:Catalogs/deutsch/retina.catalog") 1)
   (delete "LOCALE:Catalogs/deutsch/retina.catalog"
  (prompt MSG_DelOldCat)
  (help HLP_DelOldCat)
  (optional "force")
   )
 )
   )
)
(copyfiles (prompt MSG_CopyLocale)
  (help HLP_CopyLocale @help-copyfiles)
  (source (tackon srcdisk "Locale/catalogs"))
  (dest locdest)
  (all)
  (optional "nofail")
)
(complete 25)

(Set Dirname "Retina")
(Set DestDir (askdir (prompt (cat MSG_WhereRet MSG_SureDir1 Dirname MSG_SureDir2))
                     (help (cat HLP_WhereRet MSG_SureDir1 Dirname MSG_SureDir2))
                     (default @default-dest)
             )
)
(Check)
(Set RetinaDir DestDir)
; @default-dest neu festlegen
(Set @default-dest (pathonly DestDir))

; auf alte Verzeichnisse prüfen...
(if (= 2 (exists (tackon @default-dest "RetinaTools")))
   ((if (askbool (prompt MSG_foundOld)
                 (help HLP_foundOld)
                 (choices CH_RenOld CH_LetOld)
                 (default 1)
        )
       ((Set NeuName (tackon @default-dest "RetinaTools.OLD"))
        (if (rename (tackon @default-dest "RetinaTools") neuname
                    (prompt MSG_renOld NeuName)
                    (help HLP_renOld NeuName)
            )
          ((rename (tackon @default-dest "RetinaTools.info") (cat neuname ".info")
                  (prompt MSG_renOld NeuName)
                  (help HLP_renOld NeuName)
           )
           (if (= 2 (exists (tackon @default-dest "RetinaSystem")))
             ((Set NeuName (tackon @default-dest "RetinaSystem.OLD"))
              (if (rename (tackon @default-dest "RetinaSystem") NeuName
                          (prompt MSG_renOld NeuName)
                          (help HLP_renOld NeuName)
                  )
                 (rename (tackon @default-dest "RetinaSystem.info") (cat NeuName ".info")
                         (prompt MSG_renOld NeuName)
                         (help HLP_renOld NeuName)
                 )
              )
             )
           )
          )
        )
       )
    )
   )
)

; "RetinaSystem" kopieren
(working MSG_WorkRSys)
(Set DirName "RetinaSystem")
(Set src (tackon srcdisk DirName))
(Set DestDir RetinaDir)
(Check)
(Set SysDir Destdir)
(copyfiles (prompt MSG_CopyRetSys)
           (help HLP_CopyRetSys @copyfiles-help)
           (source src)
           (dest DestDir)
           (infos)
           (all)
           (optional "nofail")
)
(complete 30)
;ex. RetinaEmu in WBStartup?
(if (= (exists "SYS:WBStartUp/RetinaEmu") 1)
    ;dann dahin kopieren...
     (copyfiles (prompt MSG_CopyRetSys)
                (help HLP_CopyRetSys @copyfiles-help)
                (source (tackon DestDir "RetinaEmu"))
                (dest "SYS:WBStartup/")
                (infos)
                (optional "nofail")
     )
     (;sonst fragen...
     (if (askbool (prompt MSG_CopyEmu)
                  (help HLP_CopyEmu)
                  (default 1)
         )
        (copyfiles (prompt MSG_CopyRetSys)
                   (help HLP_CopyRetSys @copyfiles-help)
                   (source (tackon DestDir "RetinaEmu"))
                   (dest "SYS:WBStartup/")
                   (infos)
                   (optional "nofail")
        )
     )
     )
)
(complete 32)

; "RetinaTools" kopieren
(working MSG_WorkRTools)
(Set DirName "RetinaTools")
(Set src (tackon srcdisk DirName))
(Set DestDir RetinaDir)
(Check)
(Set ToolsDir DestDir)
(copyfiles (prompt MSG_CopyRetTool)
           (help HLP_CopyRetTool @copyfiles-help)
           (source src)
           (dest DestDir)
           (infos)
           (all)
           (optional "nofail")
)

;ex. RetinaComm in WBStartup?
(if (= (exists "SYS:WBStartUp/RetinaComm") 1)
    ;dann dahin kopieren...
     (copyfiles (prompt MSG_CopyRetSys)
                (help HLP_CopyRetSys @copyfiles-help)
                (source (tackon DestDir "RetinaComm"))
                (dest "SYS:WBStartup/")
                (infos)
                (optional "nofail")
     )
)
(complete 45)

; "RetinaDemos" kopieren
(working MSG_WorkDemo)
(Set DirName "RetinaDemos")
(Set src (tackon srcdisk DirName))
(Set DestDir RetinaDir)
(Check)
(Set DemoDir DestDir)
(copyfiles (prompt MSG_CopyDemo)
           (help HLP_CopyRetDemo @copyfiles-help)
           (source src)
           (dest DestDir)
           (infos)
           (all)
           (optional "nofail")
)
(complete 48)

(if (askbool (prompt MSG_EdStartup)
             (help HLP_EDStartUp)
             (default 1)
    )
   ((Set addstartup (cat "path " SysDir " " ToolsDir " " DemoDir " add\n"))
    (startup "Retina"
             (prompt MSG_EdStartup)
             (help HLP_EdStartup)
             (command addstartup)
    )
   )
)

; "RACE" kopieren
(working MSG_WorkRACE)
(Set DirName "RACE")
(Set src (tackon srcdisk DirName))
(Set DestDir (askdir (prompt (cat MSG_WhereRACE MSG_SureDir1 Dirname MSG_SureDir2))
                     (help (cat HLP_WhereRACE MSG_SureDir1 Dirname MSG_SureDir2))
                     (default RetinaDir)
             )
)

(Check)
(working MSG_LongXtract)
(run (cat cbx " " (tackon srcdisk "RACE/RACE.cba") " " DestDir)
     (help HLP_Xtract)
     (prompt MSG_Xtract)
)
(complete 53)

; "R3D" kopieren
(working MSG_WorkR3D)
(Set DirName "R3D")
(Set src (tackon srcdisk DirName))
(Set DestDir (askdir (prompt (cat MSG_WhereR3D MSG_SureDir1 Dirname MSG_SureDir2))
                     (help (cat HLP_WhereR3D MSG_SureDir1 Dirname MSG_SureDir2))
                     (default RetinaDir)
             )
)

(Check)
(working MSG_LongXtract)
(run (cat cbx " " (tackon srcdisk "R3D/R3D.cba") " " DestDir)
     (help HLP_Xtract)
     (prompt MSG_Xtract)
)
(complete 56)

; "AnCoS" kopieren
(working MSG_WorkAnCoS)
(Set DirName "AnCoS")
(Set src (tackon srcdisk DirName))
(Set DestDir (askdir (prompt (cat MSG_WhereAnCoS MSG_SureDir1 Dirname MSG_SureDir2))
                     (help (cat HLP_WhereAnCoS MSG_SureDir1 Dirname MSG_SureDir2))
                     (default RetinaDir)
             )
)

(Check)
(copyfiles (prompt MSG_CopyAnCoS)
           (help HLP_CopyAnCoS @copyfiles-help)
           (source src)
           (dest DestDir)
           (infos)
           (all)
           (optional "nofail")
)

(working MSG_LongXtract)
(run (cat cbx " " (tackon srcdisk "AnCoS/Manual.cba") " " DestDir)
     (help HLP_Xtract)
     (prompt MSG_Xtract)
)

(if (= 0 (exists (tackon (tackon locdest "deutsch") "ancos.catalog")))
   (copyfiles (prompt MSG_CopyAnCoS)
              (help HLP_CopyAnCoS @copyfiles-help)
              (source (tackon src "ancos.catalog"))
              (dest (tackon locdest "deutsch"))
              (infos)
              (all)
              (optional "nofail")
   )
)
(complete 58)

; ADPro-Saver&Lib kopieren
(working MSG_WorkADPro)
(user 2)
(if (askbool (prompt MSG_CopyADPro)
 (help HLP_CopyADPro)
 (default 0)
 )
   (; user will installieren
   (user oldlevel)
   ;ist ADPro schon installiert?
   (Set DestDir (getassign "ADPRO" "av"))
   (if (<> "" DestDir)
   ((Set FoundADPro TRUE)
 (Set AdProDir DestDir)
   )
   (Set FoundADPro FALSE)
   )
   ; Wenn ADPro nicht korrekt installiert, dann neu suchen
   ; und ADProDir setzen
   (if (NOT FoundADPro)
   ((Set MSG_EnterDest MSG_EnterADProDir)
 (Set HLP_EnterDest HLP_EnterADProDir)
 (Set mydefDest @default-dest)
 (user 2)
 (GetDir)
 (user oldlevel)
 (Set ADProDir DestDir)
   )
   )
   ;ADPro.library kopieren
   (working MSG_Xtract)
   (run (cat cbx " " (tackon srcdisk "libs/ADProLib.cba") " T:")
        (help HLP_Xtract)
        (prompt MSG_Xtract)
   )
   (copylib (source "T:adpro.library")
   (dest "libs:")
   (prompt MSG_CopyLibs1 "adpro.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
   )
   (copylib (source "t:adpro.library")
   (dest AdproDir)
   (prompt MSG_CopyLibs1 "adpro.library" MSG_CopyLibs2)
   (help @copylib-help)
   (confirm)
   )
   (delete "t:adpro.library"
           (help HLP_DelTmp)
           (prompt MSG_DelTmp)
   )
   ;saver kopieren
   (Set DirName "Savers2")
   (check)
   (working MSG_Xtract)
   (run (cat cbx " " (tackon srcdisk "ADPro/ADProSavers2.cba") " " DestDir)
        (help HLP_Xtract)
        (prompt MSG_Xtract)
   )
   ;Script kopieren
 (Set scriptdir (getassign "ADPROSCRIPTS" "av"))
 ((Set MSG_EnterDest MSG_Enterrexxdir)
  (Set HLP_EnterDest HLP_Enterrexxdir)
  (Set mydefDest scriptdir)
  (user 2)
  (GetDir)
  (user oldlevel)
 )
   (working MSG_Xtract)
   (run (cat cbx " " (tackon srcdisk "ADPro/ADProRexx.cba") " " DestDir)
        (help HLP_Xtract)
        (prompt MSG_Xtract)
   )
   (user oldlevel)
   )
   (; will nicht installieren
   (user oldlevel)
   )
)
(complete 63)

; Imagemaster kopieren
(working MSG_WorkIM)
(Set IMRexxDir (getassign "RXPI" "av"))
(if (<> "" IMRexxDir)
   (Set FoundIM TRUE)
   (Set FoundIM FALSE)
)
(if FoundIM
   (if (askbool (prompt MSG_CopyIM)
 (help HLP_CopyIM)
 (default 0)
 )
  (; User will IM Saver installieren
   (working MSG_Xtract)
   (run (cat cbx " " (tackon srcdisk "Imagemaster/IM_RetinaView.cba") " " IMRexxDir)
        (help HLP_Xtract)
        (prompt MSG_Xtract)
   )
   (Set IMCDir (getassign "CMPI" "av"))
   (working MSG_Xtract)
   (run (cat cbx " " (tackon srcdisk "Imagemaster/IM_RetinaViewRexx.cba") " " IMCDir)
        (help HLP_Xtract)
        (prompt MSG_Xtract)
   )
  )
   )
)
(complete 70)

;developer Sachen kopieren - Abfrage bei Userlevel >= AVERAGE
(working MSG_WorkDevel)
(if (>= oldlevel 1); wenn userlevel AVERAGE oder EXPERT
   ;sollen die developersachen kopiert werden?
   ( (user 2)
  (Set copydevel (askbool (prompt MSG_CopyDevel?)
  (help HLP_CopyDevel? @askbool-help)
  (default 1)
  )
  )
  (if copydevel
   (
  (Set DirName "Developer")
  (Set MSG_EnterDest MSG_WhereDevel)
  (Set HLP_EnterDest HLP_WhereDevel)
  (Set mydefdest ToolsDir)
  (GetDir)
  (Check)
   )
  )
  (user oldlevel)
   )
   ; bei NOVICE User zu den RetinaTools
   ( (Set DestDir ToolsDir)
  (Set DirName "Developer")
  (check)
  (Set copydevel TRUE)
   )
)
(if copydevel
   ((working MSG_LongXtract )
    (run (cat cbx " " (tackon srcdisk "Developer/Developer.cba") " " DestDir)
         (help HLP_Xtract)
         (prompt MSG_Xtract)
    )
   )
)
(complete 100)
