; GlossTask install to harddisk
; Håkan Parting 15 April 1998

; ** set system variables **
(set cpu (database "cpu"))
(if (= cpu 68000) (set #cpu 0))
(if (= cpu 68010) (set #cpu 1))
(if (= cpu 68020) (set #cpu 2))
(if (= cpu 68030) (set #cpu 3))
(if (= cpu 68040) (set #cpu 4))
(if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 5) )

(message
 	"Welcome to the GlossTask installer!\n\n"
	"GlossTask © Håkan Parting 1994-1998\n"
)

(working "Setting up installation. Please wait...")
;	(run "copy Glos#? to ram:GlossT")
;	(run "copy Catalogs to ram:GlossT/catalogs ALL")
;	(run "copy Docs to ram:GlossT/docs ALL")
;	(run "copy Vocables to ram:GlossT/Vocables ALL")
;	(run "copy s to ram:GlossT/s ALL")
	(run "copy #? to ram:GlossT ALL")
	(run "delete ram:GlossT/Install_#?")
(complete 10)

(welcome)
(set cpuVal (askchoice (choices "68000" "68010" "68020" "68030"
		                 "68040" "68060"
	    			)
				(prompt "Please, select the processor your Amiga have")
	        	(help   "Recommended is to leave it as default")
          		(default #cpu)
  		)
)

(set #target (askdir
		(prompt "Where would you like to install GlossTask?\nThe directory will be created automatically.")
			(help @askdir-help)
		(default @default-dest)
	)
)

(set glos-dest (tackon #target "GlossTask"))
(set @default-dest glos-dest)

(makedir glos-dest (infos))

(complete 20)
(working "Installing GlossTask program...")
	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/GlossTask")
		(dest glos-dest )
		(infos)
	)

(complete 30)
	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/Glos_Settings")
		(dest glos-dest)
		(infos)
	)

	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/Läs_mig_nu!")
		(dest glos-dest)
		(infos)
	)
(complete 40)
	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/Readme_first")
		(dest glos-dest)
		(infos)
	)
  
	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/WB2.0Users_read_this!!")
		(dest glos-dest)
		(infos)
	)

(complete 50)
	(copyfiles
		(help @copyfiles-help)
		(source "ram:GlossT/AGuideConv")
		(dest glos-dest)
	)

	(copyfiles
		(help @copyfiles-help)
		(source "Ram:GlossT/AguideConv.doc")
		(dest glos-dest)
		(infos)
	)

(complete 60)
    	(copyfiles
		(prompt "Do you want to install the vocable-lists?")
		(help @copyfiles-help)
		(source "ram:GlossT/Vocables")
		(dest (cat glos-dest "/Vocables" ))
		(all)
		(confirm)
	)
	

(complete 70)

(working "Installing documentation")
	(copyfiles
		(prompt "Which documentation do you want to install?")
		(help @copyfiles-help)
		(source "ram:GlossT/docs")
		(dest (cat glos-dest "/Docs" ))
		(all)
		(infos)
		(confirm)
	)

(complete 80)
(working "Installing local-translations")

(copyfiles
		(prompt "Which language do you want to install?")
		(help @copyfiles-help)
		(source "ram:GlossT/catalogs")
		(dest (cat glos-dest "/Catalogs" ))
		(choices "Svenska")
		(confirm)
	)

(complete 90)
(copyfiles
	(prompt "Installing config-file to S: directory")
	(help @copyfiles-help)
	(source "ram:GlossT/s/GlossTask.config" )
	(dest "S:")
	(Confirm)
)

(if (> cpuVal 1) (
(copylib (prompt #prompt_copy "\n\ngtlayout.library" )
         (help @copylib-help)
         (confirm "average")
         (source "ram:GlossT/libs/gtlayout.library.020")
         (dest "LIBS:")
		(newname "gtlayout.library")
         (optional "oknodelete" "force")
)))
(if (< cpuVal 2) (
(copylib (prompt #prompt_copy "\n\ngtlayout.library" )
         (help @copylib-help)
         (confirm "average")
         (source "ram:GlossT/libs/gtlayout.library.68k")
         (dest "LIBS:")
		(newname "gtlayout.library")
         (optional "oknodelete" "force")
)))

(working "Cleaning up..")
	(run "delete ram:GlossT ALL")

(complete 100)
(message "Thanks for using GlossTask!\n")

(exit)
