;AccuPoint Installation Script
;Version 37.7 (29.04.93)

(complete 0)

; Get KickStart version
(set OSversion (getversion))
(set kickver (/ OSversion 65536))
(set kickrev (- OSversion (* kickver 65536)))

; Undo any assign from a previous version
(makeassign "APoint")

; Get user's destination
(set APoint_dest
	(tackon
		(askdir
			(prompt "In which disk or drawer should AccuPoint be installed?  "
				"NOTE:  A drawer named \"APoint\" will be created in the disk or drawer you specify."
			)
			(help @askdir-help)
			(default @default-dest)
		)
		"APoint"
	)
)

; Create destination drawer
(makedir APoint_dest (infos))

; Let installer know where we go
(set @default-dest APoint_dest)

; Install the APoint driver & config modules
(copyfiles 
	(prompt "Select AccuPoint Programs to install (all recommended).")
	(source "APoint:")
	(dest APoint_dest)
	(choices "AccuPoint" "APConfig" "APExit")
	(confirm)
	(files)
	(infos)
	(help @copyfiles-help)
)

(complete 30)

(working)
; Unsnapshot icons
(if
	(exists
		(tackon APoint_dest "AccuPoint")
	)
	(tooltype
		(dest 
			(tackon APoint_dest "AccuPoint")
		)
		(noposition)
	)
)
(if
	(exists
		(tackon APoint_dest "APConfig")
	)
	(tooltype
		(dest 
			(tackon APoint_dest "APConfig")
		)
		(noposition)
	)
)
(if
	(exists
		(tackon APoint_dest "APExit")
	)
	(tooltype
		(dest 
			(tackon APoint_dest "APExit")
		)
		(noposition)
	)
)

(complete 40)

; Check/install tablet.library
(copylib
	(prompt "AccuPoint requires that \"tablet.library\" be present "
		" in your LIBS: directory."
	)
	(help @copylib-help)
	(source "APoint:libs/tablet.library")
	(dest "LIBS:")
	(confirm)
)

; Check for presence of correct serial.device
(copylib
	(prompt "AccuPoint requires that the file  \"serial.device\" be "
		"present in your DEVS: directory."
	)
	(help @copylib-help)
	(source "APoint:devs/serial.device")
	(dest "DEVS:")
	(confirm)
)


(complete 50)
(if
	(askbool
		(prompt "Do you want to install the AccuPoint Online Manual?")
		(help "The online manual uses Commodore's AmigaGuide "
			"(MultiView for 3.0 Users) to allow "
		 	"you to rapidly locate information on features of the AccuPoint "
		 	"software."
		)
		(default 1)
	)
	(
		(if
			(< kickver 39)
			(
				(copylib
					(prompt "The AccuPoint online manual requires that AmigaGuide "
						"be present in your SYS:Utilities Drawer."
					)
					(help @copylib-help)
					(source "APoint:Utilities/AmigaGuide")
					(dest "SYS:Utilities")
					(confirm)
					(infos)
				)
				(tooltype
					(dest "SYS:Utilities/AmigaGuide")
					(noposition)
				)
				(copylib
					(prompt "The AccuPoint online manual requires that WDisplay "
						"be present in your SYS:Utilities Drawer."
					)
					(help @copylib-help)
					(source "APoint:Utilities/WDisplay")
					(dest "SYS:Utilities")
					(confirm)
					(infos)
				)
				(tooltype
					(dest "SYS:Utilities/WDisplay")
					(noposition)
				)
				(copylib
					(prompt "AmigaGuide requires that amigaguide.library "
						"be present in your LIBS: Drawer."
					)
					(help @copylib-help)
					(source "APoint:libs/amigaguide.library")
					(dest "LIBS:")
					(confirm)
				)
				(copyfiles
					(source "APoint:s/help.guide")
					(dest "S:")
					(help @copyfiles_help)
				)
			)
		)
		(complete 70)
		(working)
		; Create destination drawer
		(makedir 
			(tackon APoint_dest "APMan")
			(infos)
		)

		(copyfiles
			(source "APoint:APMan")
			(dest 
				(tackon APoint_dest "APMan")
			)
			(infos)
			(all)
			(help @copyfiles_help)
		)
		(complete 90)
		(if
			(>= kickver 39)
			(tooltype
				(dest 
					(tackon APoint_dest "APMan/AccuPoint.Guide")
				)
				(setdefaulttool "SYS:Utilities/MultiView")
				(noposition)
			)
		)
	)
)
(complete 100)
