
; $VER: VLabInstall 2.0 (14.7.92) International Version

;---- Kickstart prüfen

Version >NIL: exec.library 37
If WARN
  Echo "*E[7m                                            *E[0m"
  Echo "*E[7m      VLab benötigt Amiga-OS-2.0 v37 !      *E[0m"
  Echo "*E[7m                                            *E[0m"
  Echo "*E[7m      VLab requires Amiga-OS-2.0 v37 !      *E[0m"
  Echo "*E[7m                                            *E[0m"
  Skip Abbruch
Endif

;----

Echo "*Ec*N       VLab  Installation*N*N"
Alias GetKey Set >NIL: [] ?

;---- Sprache wählen

Set Sprache E
If EXISTS ENV:Sys/locale.prefs
  Search >NIL: ENV:Sys/locale.prefs deutsch
  If NOT WARN
    Set Sprache D
  EndIf
Else
  Echo "Für deutsche Installation bitte 'D' drücken,"
  Echo "for english installation please press 'E'.     [D|e]: " NOLINE
  Set Sprache D
  GetKey Sprache
EndIf

If "${Sprache}" NOT EQ "E"
  Set SprachDir Deutsch
  Set MSG_DiskNotFound "Diskette 'VLAB' nicht gefunden!"
  Set MSG_BootFromHD "Zur Installation bitte von der Festplatte booten!"
  Set MSG_EnterDest1 "Bitte das Ziel-Verzeichnis auf der Festplatte"
  Set MSG_EnterDest2 "angeben (z.B. DH0:Anwender): "
  Set MSG_Whereto "Wohin ???"
  Set MSG_WithoutPath1 "Das Verzeichnis 'VLab' wird automatisch erzeugt,"
  Set MSG_WithoutPath2 "bitte nicht im Pfad angeben!                    "
  Set MSG_DestNotFound "Das Verzeichnis existiert nicht!"
  Set MSG_FileExists1 "Im angegebenen Verzeichnis existiert eine Datei 'VLab'."
  Set MSG_FileExists2 "Installation nicht möglich!                            "
  Set MSG_VLabExists1 "Im Zielverzeichnis befindet sich bereits VLab!"
  Set MSG_VLabExists2 "Soll diese Version mit der neuen überschrieben werden?"
  Set MSG_yN "[j|N]: "
  Set MSG_CopyVLabTo "Kopiere VLab nach"
  Set MSG_CopyPrefsTo "Kopiere VLab.Prefs und VLab-Standard-Icons nach"
  Set MSG_CopyPresetsTo "Kopiere Palette-Presets nach"
  Set MSG_CopyVLabCmd "Kopiere VLabCmd nach 'c:'"
  Set MSG_InstallEnd "Installation beendet..."
Else
  Set SprachDir English
  Set MSG_DiskNotFound "Disk 'VLAB' not found!"
  Set MSG_BootFromHD "For installation please start from your harddisk!"
  Set MSG_EnterDest1 "Please, enter the desired destination directory"
  Set MSG_EnterDest2 "on your harddisk (e.g. DH0:Graphics): "
  Set MSG_Whereto "To what place ???"
  Set MSG_WithoutPath1 "The directory 'VLab' will be generated automatically,"
  Set MSG_WithoutPath2 "please don't use VLab in your path!                  "
  Set MSG_DestNotFound "The named directory doesn't exist!"
  Set MSG_FileExists1 "A file named 'VLab' already exists."
  Set MSG_FileExists2 "Installation not possible!         "
  Set MSG_VLabExists1 "VLab already present!"
  Set MSG_VLabExists2 "Overwrite this version with the new one?"
  Set MSG_yN "[y|N]: "
  Set MSG_CopyVLabTo "Copying VLab to"
  Set MSG_CopyPrefsTo "Copying VLab.Prefs and VLab-Default-Icons to"
  Set MSG_CopyPresetsTo "Copying Palette-Presets to"
  Set MSG_CopyVLabCmd "Copying VLabCmd to 'c:'"
  Set MSG_InstallEnd "Installation done..."
Endif

;---- prüfen, ob die VLAB-Diskette da ist

Assign >NIL: "VLAB:" EXISTS
If WARN
  Echo "*E[7m ${MSG_DiskNotFound} *E[0m"
  Skip Abbruch
Endif

;----

Set Ver `Version VLab:VLab/VLab`
Failat 21 ; wegen CD

;---- Prüfen, ob von Diskette gebootet wurde

CD >NIL: SYS:
Set x "`CD`"
If "$x" EQ "VLab:"
  Echo "*E[7m ${MSG_BootFromHD} *E[0m"
  Skip Abbruch
Endif

;---- Ziel-Verzeichnis holen

Lab GetName
Unset Dest
Echo "*N${MSG_EnterDest1}"
Echo "${MSG_EnterDest2}" NOLINE
Set >NIL: Dest ?

If "${Dest}" EQ "*${Dest}"
  Echo "*E[7m ${MSG_Whereto} *E[0m"
  Skip BACK GetName
Endif

If `Echo "${Dest}" LEN 4` EQ "VLAB"
  Echo "*E[7m ${MSG_WithoutPath1} *E[0m"
  Echo "*E[7m ${MSG_WithoutPath2} *E[0m"
  Skip BACK GetName
Endif

Cd >NIL: ${Dest}
If FAIL
  Echo "*E[7m ${MSG_DestNotFound} *E[0m"
  Skip GetName BACK
Endif
Echo " "

;---- Prüfen ob nicht VLab-Datei dort ist

If EXISTS VLab
  Cd VLab
  If WARN
    Echo "*E[7m ${MSG_FileExists1} *E[0m"
    Echo "*E[7m ${MSG_FileExists2} *E[0m"
    Skip Abbruch
  Endif
  Cd /
Endif

;---- Prüfen, ob neuere Version

If EXISTS VLab/VLab
  Set OldVer "`Version VLab/VLab`"
  Echo "${MSG_VLabExists1}"
  Echo "${MSG_VLabExists2}"
  Echo "${MSG_yN}" NOLINE
  Set t n
  GetKey t
  If "${t}" EQ "n"
    Skip Ende
  Endif
Endif

If NOT EXISTS VLab
  MakeDir VLab
Endif
Cd VLab
Set Dest2 "`Cd`"
Cd /

If EXISTS VLab/VLab.Help
  Delete >NIL: VLab/VLab.Help
Endif

Echo "${MSG_CopyVLabTo} '${Dest2}'..." NOLINE
Copy VLab:Vlab.info "" QUIET CLONE

Copy VLab:Vlab/~(HDInstall#?|Install#?|Deutsch#?|English#?|Developer#?) VLab ALL QUIET CLONE
If "${Sprache}" EQ "D"
  Copy VLab:Vlab/Deutsch#? VLab ALL QUIET CLONE
Else
  Copy VLab:Vlab/English#? VLab ALL QUIET CLONE
Endif

If NOT EXISTS ENV:Sys/locale.prefs
  If "${Sprache}" EQ "D"
    Echo >>VLab/VLab.AutoUpdate "*NLANGUAGE deutsch*N"
  Else
    Echo >>VLab/VLab.AutoUpdate "*NLANGUAGE english*N"
  Endif
Endif

Echo "*N${MSG_CopyPrefsTo} 'ENVARC:VLab'..." NOLINE
Copy VLab:Prefs/Env-Archive/VLab ENVARC:VLab ALL CLONE QUIET

Echo "*N${MSG_CopyPrefsTo} 'ENV:VLab'..." NOLINE
Copy VLab:Prefs/Env-Archive/VLab ENV:VLab ALL CLONE QUIET

Echo "*N${MSG_CopyPresetsTo} 'SYS:Prefs/Presets/VLab'..." NOLINE
Copy VLab:Prefs/Presets/Vlab#? SYS:Prefs/Presets ALL QUIET CLONE

Echo "*N${MSG_CopyVLabCmd}..." NOLINE
Copy VLab:c/VLabCmd c: QUIET CLONE

Echo " "

;----
Lab Ende

Echo "*N*N${MSG_InstallEnd}"

;---- Abbruch

Lab Abbruch
Wait 3 SECS
Echo " "
EndCli

