; $VER: xfdinstall 1.1 (12.12.1998) [Chris Young]
; updated by SDI

(complete 0)

(set @default-dest ("libs:"))

(welcome)

(copylib
	(prompt "Copying xfdmaster.library")
	(help @copylib-help)
	(source "libs/xfdmaster.library")
	(dest "libs:")
)

(complete 20)

(copyfiles
	(prompt "Copying external slaves...")
	(help @copyfiles-help)
	(source "libs/xfd")
	(dest "libs:xfd")
	(all)
	(optional "force" "nofail")
)

(complete 40)

(working "Deleting old slaves that are no longer required...")

(delete (cat "libs:xfd/(.README.FIRST|Chryseis|PMC|RNC#?|XPK|Ice|Ice!|TSM|"
        "Rob_Norten_Cruncher.slave|XFD_ATN!_LHLib_XPK.Slave|Decloner|SF|"
        "ProPackExe|MagneticFields|BOND|PARA|AMOS|FUCK|CRND|CRUN|xVdg|"
        "PPBK|KDUB|LSD!|89A8|ByteKillerFake|1AM|CRUa|DeluxeCruncher|VOL1|"
        "=SB=|FLT!|ISC|PCompress2|Pd|FLS0|IFT?|GraftGold|PKProtect_IMP|"
        "PKProtect_PP|Aztec|Detach|CHPri|Dupa|Iron|Vision|DataPACK|"
        "Ice!_eof|Ice_TSM|-CJ-|Z&G!|LeCr|DMP0|JEK!)")
	(prompt "Deleting old slaves that are no longer required")
	(help "These slaves are now included in xfdmaster.library\n\n"
	@delete-help)
	(optional "force")
)

(complete 50)

(copyfiles
	(prompt "Do you want to copy the following support commands?")
	(help "HackProPack: Unlock encrypted ProPack files\n\n"
	"xfdDecrunch: Unpacks crunched files\n\n"
	"xfdDecrunchAddr: Unpacks address crunched executables\n\n"
	"xfdLibInfo: Displays information about xfdmaster.library\n\n"
	"xfdList: Lists files, showing the names of the crunchers\n\n"
	"xfdPatch: Patches executable decrunch headers to use xfd\n\n"
	"xfdScan: Searches for crunched data inside files\n\n"
	"xfdUnlink: Unlinks 4EB9 linked files\n\n"
	@copyfiles-help)
	(source "c")
	(dest "C:")
	(all)
	(confirm)
	(optional "force" "no fail")
)

(complete 60)

(copyfiles
	(prompt "Do you want to install the documentation?")
	(help @copyfiles-help)
	(source "docs")
	(dest "HELP:English")
	(all)
	(confirm)
)

(complete 80)

(set #xfdpatch	(exists "C:xfdPatch"))

(if #xfdpatch
	(startup "xfdPatch"
		(prompt "Do you want to add xfdPatch to your user-startup "
		"so crunched executables will be patched to use xfdmaster.library?")
		(help "This is recommended, as some old decrunch headers will "
		"not work correctly under newer OS releases\n\n" @startup-help)
		(command "xfdPatch >NIL:")
	)
)

(complete 100)

(exit "Please note that the developer files have not been installed.")

