;
;$VER: AB3DTrainer Installer script v2.00 (c) 1997 John Girvin
;

(welcome "Welcome to the AB3DTrainer Installer v2.00")
(set @app-name "AB3DTrainer")
(set #GDESTDIR "DH0:")

(set #GUSEGUI 0)
(set #GUSEHACK 0)
(set #GDEFTRAINERS 0)

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

(message "\n\nWelcome to the AB3DTrainer Installer\n"
		 "(c) 1997 John Girvin\n\n"
		 "Please read the documentation thoroughly before"
		 " attempting to use this installer!\n\n"
		 "This is version 2.00\n\n"
		 "Click 'Proceed' to begin."
)

(set #GDESTDIR
	(askdir
		(prompt "Where do you have Alien Breed 3D installed?\n"
				"(select the directory containing the 'abd.pk' program)"
		)
		(help @askdir-help)
		(default #GDESTDIR)
	)
)
(set @default-dest #GDESTDIR)

(set #GUSEGUI
	(askchoice
		(prompt "Do you want the cheat GUI to appear every time you load AB3DTrainer?\n"
				"(this may be changed later by editing the tooltypes of AB3DTrainer)"
		)
		(help @askchoice-help)
		(choices "Yes - use the GUI" "No  - don't use the GUI")
		(default #GUSEGUI)
	)
)

(set #GUSEHACK
	(askchoice
		(prompt "Do you want to use HackAB3D by default?\n"
				"(this may be changed later by editing the tooltypes of AB3DTrainer)"
		)
		(help @askchoice-help)
		(choices "Yes - use HackAB3D" "No  - don't use HackAB3D")
		(default #GUSEHACK)
	)
)

(set #GDEFTRAINERS
	(askoptions
		(prompt "Please select the default trainers to use:\n"
				"(these may be changed later by either\n"
				"editing the tooltypes of AB3DTrainer\n"
				"or using the cheat GUI)"
		)
		(help @askoptions-help)
		(choices "Infinite energy"
				 "Infinite ammunition"
    	)
		(default #GDEFTRAINERS)
	)
)

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

(copyfiles
	(prompt "Copying trainer program icon")
	(help @copyfiles-help)
	(source "AB3DTrainer_icon")
	(newname "AB3DTrainer.info")
	(dest #GDESTDIR)
	(nogauge)
	(optional fail force)
)

(if (= #GUSEGUI 1)
	(tooltype
		(prompt "Setting trainer program icon tooltypes")
		(dest (tackon #GDESTDIR "AB3DTrainer"))
		(settooltype "NOGUI" "")
	)
)

(if (= #GUSEHACK 0)
	(tooltype
		(prompt "Setting trainer program icon tooltypes")
		(dest (tackon #GDESTDIR "AB3DTrainer"))
		(settooltype "HACKAB3D" "")
	)
)

(if (<> 0 (IN #GDEFTRAINERS 0))
	(tooltype
		(prompt "Setting trainer program icon tooltypes")
		(dest (tackon #GDESTDIR "AB3DTrainer"))
		(settooltype "INF_ENERGY" "")
	)
)

(if (<> 0 (IN #GDEFTRAINERS 1))
	(tooltype
		(prompt "Setting trainer program icon tooltypes")
		(dest (tackon #GDESTDIR "AB3DTrainer"))
		(settooltype "INF_AMMO" "")
	)
)

(copyfiles
	(prompt (cat "Copying trainer loader"))
	(help @copyfiles-help)
	(source "AB3DTBoot")
	(dest #GDESTDIR)
	(nogauge)
	(optional fail force)
)
