;$VER: MasterISO Install 1.xx 
;Copyright ©1993-97 Asimware Innovations
(onerror (CLEANUP))

; Cleanup any temporary mess we created
(procedure CLEANUP
    ; Nothing to cleanup
    (delete "t:Logopic")
) ; CLEANUP

(copyfiles
	(source "logopic.iff")
	(dest "t:")
	(newname "Logopic")
)

(run "run asim t:logopic")

(run "run lha x fonts.lha fonts:")

(onerror (makeassign "MasterISOInst") )


(set #wbversion (getversion "libs:version.library"))
(set #wbversion (/ #wbversion 65536) )

(set @default-dest "AsimCDFS:MasterISO")

(complete 0)


(if (< #wbversion 39)
	(abort "\n\nAmigaDOS 3.0 or higher is required for MasterISO. "
			 "\n\nAn upgrade will be needed for your Amiga."
			 "\n\nYou are currently running version " #wbversion ".")
)


(if (< (getdiskspace "SYS:") 92160)
	(abort "\n\nApproximately 90K of disk space is needed on your SYS: volume."
			 "\n\nYou only have " (/ (getdiskspace "SYS:") 1024)	"K free.\n\n"
			 "Delete or transfer some files from the SYS: volume and try again." )
)

(askdisk
	(prompt "Please insert the disk labeled \"MasterISO\".")
	(help	"The MasterISO program will be copied "
			"from this disk into your system.")
	(dest  "MasterISO")
	(newname "MasterISOInst")
)


(set #MasterISODir
	(askdir
		(prompt "Specify the directory in which the MasterISO program will be placed:" )
		(help "MasterISO will be placed in the directory specified.")
		(default @default-dest)
		(newpath)
	)
)

(if (not (exists #MasterISODir (noreq)))
	(makedir #MasterISODir
		(prompt "Creating the MasterISO directory...")
		(help "This will create the specified directory for the program.")
		(infos)
		)
)
(makeassign "MasterISO_Dest" #MasterISODir)

(set #instMasterISO
	(askbool
		(prompt "\n\nShould MasterISO be installed?")
		(help "\n\nThis will copy over the MasterISO program "
				"to the " #MasterISODir " directory\n\nIf you do not "
				"wish the MasterISO program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)


(if #instMasterISO 
	((protect "MasterISO_Dest:MasterISO" "rwed" )
	(protect "MasterISO_Dest:MasterISO.info" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the MasterISO program to the "
				  #MasterISODir " directory.\n" )
		(source "MasterISOInst:MasterISO")
		(dest "MasterISO_Dest:")
		(infos)
		(help "\n\nThis will copy over the MasterISO program"
				"to your"  #MasterISODir " directory.\n" )
		(confirm)
	)
))


(makeassign "MasterISOInst")
(makeassign "MasterISO_Dest")
(CLEANUP)
(exit)