;
;$VER: Zeewolf HD Installer script v1.00 (c) 1996 John Girvin
;

(welcome "Welcome to the Zeewolf Hard Drive Installer")
(set @app-name "Zeewolf HD")
(set #ZROOTDIR "DH0:")
(set #ZDESTDIR #ZDESTDIR)
(set #ZVERSION 0)

(if
	(<> @user-level 2)
	(abort "You must select 'Expert' user level")
)

(message "\n\nWelcome to the Zeewolf Hard Drive Installer\n"
		 "(c) 1996 John Girvin\n\n"
		 "Please read the documentation thoroughly before"
		 " attempting to use this installer!\n\n"
		 "Click 'Proceed' to begin."
)

(set #ZROOTDIR
	(askdir
		(prompt "Where would you like Zeewolf installed?\n"
				"(a new drawer called 'Zeewolf' will be created here)"
		)
		(help @askdir-help)
		(default "DH0:")
	)
)
(set #ZDESTDIR (tackon #ZROOTDIR "Zeewolf/"))
(set @default-dest #ZDESTDIR)
(set #ZDATFILE (tackon #ZDESTDIR "Zeewolf.dat"))

(set #ZSRCDRIVE
	(askchoice
		(prompt "Which drive do you wish to install from?")
		(help @askchoice-help)
		(choices "DF0:" "DF1:" "DF2:" "DF3:")
		(default 0)
	)
)

(makedir #ZDESTDIR
	(prompt "I will now create the directory '" #ZDESTDIR "'")
	(help @makedir-help)
	(infos)
	(confirm)
)

(message "\n\n\nPlease insert your Zeewolf game disk in drive DF"
  		 #ZSRCDRIVE
		 ":\n\n"
		 "Click 'Proceed' when disk has been inserted and"
		 " disk activity has stopped."
)

(working "Creating disk image in '" #ZDATFILE "'")
(set #ZVERSION  (run (cat "ZMakeDat " #ZSRCDRIVE " " #ZDATFILE)))

(if (>= #ZVERSION 100)
	(abort (cat "Could not create disk image!\n\nError: " #ZVERSION))
)

(set #ZBOOTNAME (cat "ZBoot" #ZVERSION))

(copyfiles
	(prompt "Copying HD drawer icon")
	(help @copyfiles-help)
	(source "Zeewolf_icon")
	(newname "Zeewolf.info")
	(dest #ZROOTDIR)
	(nogauge)
	(optional fail force)
)

(copyfiles
	(prompt "Copying trainer program")
	(help @copyfiles-help)
	(source "Zeewolf_HD")
	(dest #ZDESTDIR)
	(nogauge)
	(noposition)
	(optional fail force)
)

(copyfiles
	(prompt "Copying trainer program icon")
	(help @copyfiles-help)
	(source "Zeewolf_HD_icon")
	(newname "Zeewolf_HD.info")
	(dest #ZDESTDIR)
	(nogauge)
	(optional fail force)
)

(copyfiles
	(prompt (cat "Copying HD loader version " #ZVERSION))
	(help @copyfiles-help)
	(source #ZBOOTNAME)
	(newname "ZBoot")
	(dest #ZDESTDIR)
	(nogauge)
	(noposition)
	(optional fail force)
)
