; script to install AsimVTR v1.0
; $VER: Install-AsimVTR 1.0 (14.2.93)


(onerror
	(makeassign "OurAsimInstall" (safe))
)

(complete 0)
(set #update 0)
(set #destination (getassign "AsimVTR" "a"))

(if #destination
	(set #update (askbool
			(prompt "Your current copy of AsimVTR appears to be located in the drawer named \""	#destination
					  "\". Do you want the update installed in that drawer?" )
			(help "The installer has determined that you may already have a "
					"copy of AsimVTR installed on your system. If this is wrong or "
					"you want the update installed elsewhere, select NO as an "
					"answer. Otherwise, select YES." )
			(default 1)
		 )
	)
)



(if (not #update)
		(set #destination			; if user wants in different place
			(tackon
				(askdir
					(prompt "In which disk or drawer should AsimVTR be installed?")
					(help @askdir-help)
					(default "sys:") )
				"AsimVTR"
			)
		)
)

(askdisk
	(prompt "Please insert the disk labeled \"AsimVTR_Install\".")
	(help	"AsimVTR will be copied "
			"from the \"AsimVTR_Install\" into your system.")
	(dest  "AsimVTR_Install")
	(newname "OurAsimInstall")
)


(complete 20)

(if (not #update)
	(makedir #destination (infos))
)


(set @default-dest #destination)


(complete 30)

(copyfiles
	(source "OurAsimInstall:AsimVTR")
	(dest #destination)
	(infos)
)


(tooltype
	(dest #destination)
	(noposition)
)

(tooltype
	(dest (tackon #destination "AsimVTR") )
	(noposition)
)


(complete 40)

(if (not #update)
	(copyfiles
		(source "OurAsimInstall:ENVARC")
		(dest "ENVARC:")
		(infos)
		(all)
	)
)

(if (not #update)
	(copyfiles
		(source "OurAsimInstall:ENVARC")
		(dest "ENV:")
		(infos)
		(all)
	)
)

(complete 40)
(set #yesno
	(askbool
		(prompt "Should the Sample ARexx files be installed?")
		(help "The ARexx files illustrate how to use the ARexx interface "
				"of AsimVTR.  They provide a useful reinforcement of the manual descriptions. " )
		(default 1)
	)
)

(complete 50)
(if #yesno
	(copyfiles
		(source "OurAsimInstall:Rexx_Commands")
		(dest (tackon #destination "Rexx_Commands"))
		(all)
	)
)

(complete 60)
(if #yesno
	(copyfiles
		(source "OurAsimInstall:Rexx_Examples")
		(dest (tackon #destination "Rexx_Examples"))
		(all)
	)
)


(complete 70)
(if (not #update)
	(makedir
		(tackon #destination "Images")
		(prompt "Now making the AsimVTR:Images directory" )
		(help "This will create a directory in your ASIMVTR: directory where "
				"AsimVTR will default to loading files from." )
		(infos)
	)
)

(complete 80)
(if (not #update)
	(makedir
		(tackon #destination "Scripts")
		(prompt "Now making the AsimVTR:Scripts directory" )
		(help "This will create a directory in your ASIMVTR: directory where "
				"AsimVTR will default to loading scripts from." )
		(infos)
	)
)

(complete 85)
(if (not #update)
	(makedir
		(tackon #destination "Exports")
		(prompt "Now making the AsimVTR:Exports directory" )
		(help "This will create a directory in your ASIMVTR: directory where "
				"AsimVTR will default to exporting files to.")
		(infos)
	)
)


(complete 90)

(startup "AsimVTR"
	(prompt "One assigment needs to be added to your S:User-startup file which will "
			  "properly configure your system to work with AsimVTR. ")
	(help "This will add ASSIGN ASIMVTR: " #destination )
	(command "ASSIGN AsimVTR: \"" #destination "\"\n")
)


(if (not @pretend)
	(makeassign "AsimVTR" #destination)
)

(makeassign "OurAsimInstall" (safe))

(complete 100)
(exit)
