(welcome "Welcome to the Zeewolf Hard Drive Installer")
(set @app-name "Zeewolf HD")
(set #rootdir "DH0:")
(set #destdir #destdir)

(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 #rootdir
	(askdir
		(prompt "Where would you like Zeewolf installed?\n"
				"(a new drawer called 'Zeewolf' will be created here)"
		)
		(help @askdir-help)
		(default "DH0:")
	)
)
(set #destdir (tackon #rootdir "Zeewolf/"))
(set @default-dest #destdir)
(set #datfile (tackon #destdir "Zeewolf.dat"))

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

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

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

(working "Creating disk image in '" #datfile "'")
(if (<> (run (cat "ZMakeDat " #srcdrive " " #datfile)) 0)
	(abort "Could not create disk image!")
)

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

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

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

(copyfiles
	(prompt "Copying HD loader")
	(help @copyfiles-help)
	(source "ZBoot")
	(dest #destdir)
	(nogauge)
	(noposition)
	(optional fail force)
)
