;	$VER:	Intall DevPac Lite 1.02 (08.11.94)
;				Installation Script Created by Toby Simpson 7/11/94

(transcript "On Installing \"DevPac Lite\"...")

(complete 0)

; ----------------
; Guess an Installation type
;
(set InstallType 1)
(if (< (/ (getversion) 65536) 37)
     (set InstallType 0)
	)

; ----------------
; Get a version type of Install:
;
(set InstallType
	(askchoice
		(prompt		"\nWhich version of DevPac Lite do you wish to install?\n")
		(choices	"1.2/1.3"
							"2.04+")
		(help 		"If you have an Amiga with Kickstart 1.3 or 1.2, "
							"select the first option, otherwise select the other.")
		(default	InstallType)
		)
	)

; ----------------
; Pick location to put DevPac Lite:
;
(complete 10)

(set DevPacDestination
	(tackon
		(askdir
			(prompt		"\nPlease select the partition, disk or drawer, where "
								"the \"DevPac Lite\" drawer will be installed\n")
			(help 		@askdir-help)
			(default	@default-dest)
			)
		"Devpac Lite"
		)
	)

(set	@default-dest DevPacDestination)

; ----------------
; Perform Installation
;
(complete 20)

(if (NOT (exists DevPacDestination))
	(makedir DevPacDestination
		(prompt	"\nI am now creating DevPac Lites drawer")
		(help	@makedir-help)
		(infos)
		)
	)

(if (= InstallType 0)
	(
	; =====================
	; Install 1.3 version
	;
	(copyfiles
		(prompt	"\nCopying DevPac Lite Application")
		(help	@copyfiles-help)
		(source	"Workbench1.3")
		(dest	DevPacDestination)
		(optional	force)
		(infos)
		(all)
		)

	(copylib
		(prompt	"\nCopying Library Files")
		(help	@copyfiles-help)
		(source	"Workbench1.3/libs/arp.library")
		(dest	"libs:")
		(optional	force)
		(confirm)
		(infos)
		)

	(copyfiles
		(prompt	"\nCopying DevPac Environment Variables")
		(help	@copyfiles-help)
		(source	"Workbench1.3/prefs")
		(dest	"sys:prefs/")
		(optional	force)
		(infos)
		(all)
		)

	(complete 40)
	)
; else statements ...
	(
	; =====================
	;	Install 2.04+ version
	;
	(copyfiles
		(prompt	"\nCopying DevPac Lite Application")
		(help	@copyfiles-help)
		(source	"Workbench2.0-3.1")
		(dest	DevPacDestination)
		(optional	force)
		(infos)
		(all)
		)

	(copyfiles
		(prompt	"\nCopying DevPac Environment Variables")
		(help	@copyfiles-help)
		(source	"Workbench2.0-3.1/prefs")
		(dest	"sys:prefs/")
		(optional	force)
		(infos)
		(all)
		)

	(complete 40)
	)
)

; ----------------
; Install GenAm and MonAm now:
; (Same for both versions)
;
(copyfiles
	(prompt	"\nCopying Assembler and Debugger")
	(help	@copyfiles-help)
	(source	"")
	(pattern "#?Am")
	(dest	DevPacDestination)
	(optional	force)
	(infos)
	)


(complete 65)

; ----------------
; Install examples drawer
;
(set ExamplesDestination
	(cat DevPacDestination "/Examples")
	)

(copyfiles
	(prompt	"\nCopying Examples")
	(help	@copyfiles-help)
	(source	"Examples")
	(dest	ExamplesDestination)
	(optional	force)
	(infos)
	(all)
	)

; ----------------
; Installation Complete, Exit.
;
(complete 100)
(exit)
