; InstallerFX script
(if (= x 1) (welcome))

(onerror (CLEANUP))

; Cleanup any temporary mess we created
(procedure CLEANUP
    ; Nothing to cleanup
    (delete "t:Background")
    (delete "t:Background.prefs")
    (delete "t:Logopic")
    (delete "t:Logopic.prefs")
) ; CLEANUP

(set @user-level 0)

;(set Opt 3)
;(complete 0)

(copyfiles
	(source "InstallerFX/Background_DARK")
	(dest "t:")
	(newname "Background")
)

(copyfiles
	(source "InstallerFX/Background.prefs")
	(dest "t:")
	(newname "Background.prefs")
)
(run "run InstallerFX/InstallerFX t:Background")

(set @user-level 2)

;Get directory to install test to:
(set destdir 
	(askdir 
		(prompt "In which drawer should testfiles be installed?") 
		(help @askdir-help)
		(default ("t:"))
	)
)

(copyfiles
	(source "InstallerFX/MagicSelector")
	(dest "t:")
	(newname "Logopic")
)
(copyfiles
	(source "InstallerFX/MagicSelector.prefs")
	(dest "t:")
	(newname "Logopic.prefs")
)

(run "run InstallerFX/InstallerFX t:logopic")


(complete 10)

(set installfiles
	(askoptions
		(prompt "Which of the following optional programs/helpfile should be installed ?")
		(help @askoptions-help)
		(choices "InstallerFX")
		(default Opt)
	)
)

(complete 50)

;Copy program files to destination.

(if (BITAND installfiles 1)
(copyfiles
	(source "InstallerFX")
	(dest destdir)
	(all)
)
)

(set installfiles
	(askoptions
		(prompt "Which of the following optional programs/helpfile should be installed ?")
		(help @askoptions-help)
		(choices "InstallerFX")
		(default Opt)
	)
)


(if (BITAND installfiles 1)
(copyfiles
	(source "InstallerFX")
	(dest destdir)
	(all)
)	
)

(complete 100)

(CLEANUP)
(exit)
