; Digital Image Installationsscript
; ©1994; Thomas Globisch
; $VER: DigitalImage_Install 1.0 (30.8.94)


(transcript "Digital Image installation")

(Set srcdisk "DigitalImage:")
(Set os2 (NOT (< (/ (getversion) 65536) 37)))


(if (patmatch @Language "deutsch")
 (
  (Set NoOS2 "Betriebssystem Version >= 2 nicht gefunden\nInstallieren Sie zuerst\n Workbench Version 2.0\n oder größer" )
  (Set #instpath (cat "Wohin soll DigitalImage installiert werden ?\nWählen Sie direkt das Verzeichnis, in\ndas DigitalImage installiert wird.\nEin weiteres Unterverzeichnis wird NICHT angelegt."))
  (Set #installDI (cat "\nInstalliere DigitalImage"))
  (Set #installGU (cat "\nInstalliere Guidefile"))
  (Set #installPR (cat "\nInstalliere Prefs"))
  (Set #installLI1 (cat "\nInstalliere benötigte Libraries\n\nmultipic.library"))
  (Set #installLI2 (cat "\nInstalliere benötigte Libraries\n\nasl.library"))
  (Set #installFI (cat "\nInstalliere Filter"))
  (Set #installLO (cat "\nInstalliere Lademodule"))
  (Set #installSA (cat "\nInstalliere Speichermodule"))
  (Set #installAS (cat "\nEs kann noch ein ASSIGN in die\n s:user-startup aufgenommen werden\n\n\nASSIGN DigitalIM: "))
  (set #install-msg (cat "\nInstallationsscript für DigitalImage.\n\nDigitalImage © 1994 Thomas Globisch\nAll Rights reserved.\n\nVertrieb durch\nMS MacroSystem Computer GmbH\n58454 Witten, Germany\n\nDieses ist ein kommerzielles Produkt und\nNICHT Public Domain !"))
  (set #which-language (cat "\nWelche Sprachdatei soll installiert werden ?"))
  (set #which-version (cat "\nWelche Version soll installiert werden ?"))
 )

 (
  (Set NoOS2 "could not locate OS 2.0 or newer\nPlease install Amiga OS 2.0 first..." )
  (Set #instpath (cat "Please choose the path to install DigitalImage.\nDirectly choose the drawer to put DigitalImage in.\nA new drawer will NOT be created."))
  (Set #installDI (cat "\ninstalling DigitalImage"))
  (Set #installGU (cat "\ninstalling guide"))
  (Set #installPR (cat "\ninstalling prefs"))
  (Set #installLI1 (cat "\ninstalling libraries\n\nmultipic.library"))
  (Set #installLI2 (cat "\ninstalling libraries\n\nasl.library"))
  (Set #installFI (cat "\ninstalling filter"))
  (Set #installLO (cat "\ninstalling loader"))
  (Set #installSA (cat "\ninstalling saver"))
  (Set #installAS (cat "\nYou additionally can add an ASSIGN in your\n s:user-startup\n\n\nASSIGN DigitalIM: "))
  (set #install-msg (cat "\n\nDigitalImage - Installation utility.\n\nDigitalImage © 1994 Thomas Globisch\nAll Rights reserved.\n\n   \nMS MacroSystem Computer GmbH\n58454 Witten, Germany\n\nThis is a commercial product and\nNOT public domain !"))
  (set #which-language (cat "\nChoose language to install"))
  (set #which-version (cat "\nPlease choose version to install"))
 )
)

(set old_level @user-level)

; LOCALE vorhanden?

(Set locsrc "DigitalImage:locale/catalogs/")

; Wenn < 37.175 -> Ende

(if (not os2)
   (abort NoOS2)
)


(complete 0)
(message #install-msg)
(set instpfad
	(askdir
		(prompt #instpath)
		(help @askdir-help)
		(default "WORK:")
	)
)


(copyfiles
	(prompt #installDI)
	(help @copyfile-help)
	(source ( tackon srcdisk "bin"))
	(dest instpfad)
        (confirm)
	(infos)
        (files)
        (all)
)



(complete 20)
(copylib
	(prompt #installGU)
	(help @copylib-help)
	(source (tackon srcdisk "DigitalImage.guide"))
	(infos)
	(dest instpfad)
        (confirm)
)

;(complete 30)
;(copyfiles
;	(prompt #installPR)
;	(help @copyfile-help)
;	(source (tackon srcdisk "s/DigitalImage.config"))
;	(dest "s:")
;)

(complete 40)
(copylib
	(prompt #installLI1)
	(help @copyfile-help)
	(source (tackon srcdisk "libs/multipic.library"))
	(dest "libs:")
	(confirm)
)

(complete 45)
(copylib
	(prompt #installLI2)
	(help @copyfile-help)
	(source (tackon srcdisk "libs/asl.library"))
	(dest "libs:")
	(confirm)
)

(complete 50)
(
 (makedir (tackon instpfad "Filter"))
 (copyfiles
	(prompt #installFI)
	(help @copyfile-help)
	(source (tackon srcdisk "Filter"))
	(pattern "#?")
	(files)
	(infos)
        (dest (tackon instpfad "Filter"))
        (confirm)
 )
)

(complete 60)
(
 (makedir (tackon instpfad "Loader"))
 (copyfiles
	(prompt #installLO)
	(help @copyfile-help)
	(source (tackon srcdisk "Loader"))
	(pattern "#?")
	(files)
	(infos)
        (dest (tackon instpfad "Loader"))
        (confirm)
 )
)

(complete 70)
(
 (makedir (tackon instpfad "Saver"))
 (copyfiles
	(prompt #installSA)
	(help @copyfile-help)
	(source (tackon srcdisk "Saver"))
	(pattern "#?")
	(files)
	(infos)
        (dest (tackon instpfad "Saver"))
        (confirm)
 )
)

(complete 90)


(if (exists "sys:locale")
(
        (if (exists "LOCALE:")
	(
		(user 2)
		(set lang (askoptions (prompt #which-language)
								(help #which-language-help)
								(choices
								 "Deutsch"
								 "English")
							        (default default_lang)
					 )
		)
		(user old_level)

		(set n 0)
		(while (set language (select n
										"deutsch"
										"english"
										""))
		(
			(if (IN lang n)
			(
				(if (<> 2 n)
				(
					(makedir (cat "LOCALE:Catalogs/" language))
					(copyfiles (source (cat locsrc language))
                                                                 (dest(cat "LOCALE:Catalogs/" language))
								  (all)
					)
				))
			))
			(set n (+ n 1))
		))
	))
))

(complete 95)

(set @default-dest instpfad)

(Startup "DigitalImage"
 (prompt (cat #installAS instpfad))
 (help @startup-help)
 (command (cat "ASSIGN DigitalIM: " instpfad))
)

(complete 100)
