;
;	Desaster Installer v2.14
;

(set @abort-button 	"Quit Game")
(set @app-name 		"Dtr!Logoff v2.o")
(set @copyfileshelp 	"Dtr!Help\n---------\n\nSelect the files you want to copy and push the proceed button.")
(set @getdesasterdir	"Dtr!Help\n---------\n\nSelect the directory where the Dtr!Logoff directory will be created. Usually Doors:Desaster/ or similar")

(set #accesslevelprompt	"Enter the minimum accesslevel for Dtr!Logoff")
(set #exitmsg 		"\n\nA BBSCMD has been created.\n\nPlease read the guide now.\n\nFor bugreports, suggestions, gifts:\ntolpan@skom.rhein.de")
(set #welcometext 	"Installation for Dtr!Logoff v2.o - Go on to start installation.\n")
(set #getdesasterdir	"Select your Desaster directory\n(a Dtr!Logoff dir will be created)")
(set #copyfilesprompt 	"Select the files you want to be copied.")
(set #file1		"Logoff Executable (FIM)")
(set #file2		"Logoff Config Executable (FIM)")
(set #file3		"Logoff Header (ANSI)")
(set #file4		"Logoff Documentation (Guide)")

(welcome #welcometext)

(set desaster	(askdir		(prompt #getdesasterdir)
		(help		@getdesasterdir)
		(default	"Doors:Desaster/" (newpath))
		)
)

(set files2copy	(askoptions	(choices #file1 #file2 #file3 #file4)
		(prompt #copyfilesprompt)
		(help @copyfileshelp)
		(default 15)
		)
)

(set destdir	(tackon desaster	"Dtr!Logoff"))
(makedir	destdir)

(if (<> files2copy 0)
	(
		(if	(AND (IN files2copy 0) (exists "Files/Logoff.Fim"))
			(
			(copyfiles (source "Files/Logoff.Fim")
				(dest destdir)
				(nogauge)
			)
			(set	doorcmd		(tackon	destdir	"Logoff.Fim"))
			(set	makebbscmd	("Files/MakeCMD NAME=G PATH=%s SERVERNAME=Dtr!Logoff STACK=4096 ACSLEVEL=0 CMDTYPE=-1 MULTINODE PRI=0 DOORTYPE=0 NR NC CF SR SC AR AC RD" doorcmd))
			(run	makebbscmd)
			)
		)
		(if	(AND (IN files2copy 1) (exists "Files/LogoffEd.Fim"))
			(
			(copyfiles (source "Files/LogoffEd.Fim")
				(dest destdir)
				(nogauge)
			)
			(set	doorconfig		(tackon	destdir	"LogoffEd.Fim"))
			(set	makedoorconfig	("Files/DoorConfig NAME=Dtr!LogoffConfig PATH=%s LEVEL=0 PRI=0 NR NC CF SR SC AR AC RD UNUSED" doorconfig))
			(run	makedoorconfig)
			)
		)
		(if	(AND (IN files2copy 2) (exists "Files/Logoff.Dsg"))
			(
			(copyfiles (source "Files/Logoff.Dsg")
				(dest destdir)
				(nogauge)
			)
			)
		)
		(if 	(AND (IN files2copy 3) (exists "Documentation/Logoff.Guide"))
			(
				(makedir (tackon destdir "Documentation"))
				(copyfiles (source "Documentation/")
				(dest (tackon destdir "Documentation/"))
				(all)
				(nogauge)
				)
			)
		)

	)
)

(exit #exitmsg)
