echo "This script will install Visionaire to your Hard Disk."
echo "You will be prompted for any relevant information. (Note"
echo "that this script *e[4mrequires*e[0m workbench release 2 to run.)"

ask "*nDO YOU WISH TO CONTINUE?"
if not warn
	endcli
endif

echo "*nPlease enter full pathname of the directory where you want"
echo "Visionaire to be installed.  The directory will be created if it"
echo "does not already exist. (example: Work:Programs/Visionaire)"

echo "*ndirectory: " NOLINE
set >NIL: vispath ?
if warn
	echo "*e[32mERROR*e[31m in the directory name, aborting."
	endcli
endif

if exists "$vispath"
	echo "*nContents of directory *"$vispath*" will be erased."
	ask "do you wish to continue?"
	if not warn
		endcli
	endif
else
	makedir "$vispath"
	if warn
		echo "*e[32mERROR*e[31m creating directory name, aborting."
		endcli
	endif
	copy Visionaire:Icons.info "${vispath}.info" clone
endif

assign NewVisionaire: "$vispath"
delete >NIL: NewVisionaire:#? all force quiet

set fpu=TRUE

cpu >NIL: check fpu
if warn
	set fpu=FALSE
endif

cpu >NIL: check 68030
if warn
	set fpu=FALSE
endif

if $fpu eq TRUE
	set visversion=Visionaire_FP
	echo "*nYour machine has a math co-processor and at least a 68030 cpu."
	echo "The version of Visionaire for accelerated Amigas will be used."
else
	set visversion=Visionaire
	echo "*nYour Mmachine does *e[4mNOT*e[Om have a 68030 or a math co-proc."
	echo "the version of Visionaire for non-accelerated cpu's will be used."
endif

ask "*nDo you wish to continue?"
if not warn
	endcli
endif

ask "*nDo you wish to install the examples?"
if warn
	set examples=true
endif

echo "*nInstalling Visionaire disk 1" NOLINE
copy Visionaire:$visversion(.info|%) NewVisionaire: clone quiet
echo "." NOLINE
copy Visionaire:Visionaire.(settings|macros) (.info|%) NewVisionaire Clone quiet
echo "." NOLINE
copy Visionaire:(Virx|fonts|icons)(.info|%) NewVisionaire: clone all quiet
echo "." NOLINE
copy Visionaire:ReadMe(.info|%) NewVisionaire: clone quiet
echo "." NOLINE

if $examples eq true
	makedir NewVisionaire:Examples
	copy Visionaire:Animations.info NewVisionaire:Examples.info clone
echo "." NOLINE
	copy Visionaire:Animations/#? NewVisionaire:Examples clone all quiet
echo "." NOLINE
	echo "done.*nInstalling Visionaire disk 2..."NOLINE
	copy VisionaireExamples:~(Disk.info) NewVisionaire:Examples clone all quiet
endif
echo "done."

echo "*nThe following lines should be added to your S:User-Startup file:"
echo "*n    Assign Visionaire:  *"$vispath*""
if $examples eq true
	echo "    Assign VisionaireExample: Visionaire:Examples"
endif
echo "    Assign Fonts: Visonaire:Fonts  ADD"

ask "*nDo you want to have these lines added now?"
if warn
	echo >T:vistmp "*n;  Visionaire setup (`date`)"
	echo >>T:vistmp "Assign Visionaire: *"$vispath*""
	if $examples eq true
		echo >>T:vistmp "Assign VisionaireExample: Visionaire:Examples"
	endif
	echo >>T:vistmp "Assign Fonts:Visionaire:Fonts ADD"
	copy S:User-Startup S:User-Startup.bak
	join S:User-Startup.bak  T:vistmp TO S:User-Startup

	echo "*nInstallation completed. Please remove the Visionaire disks,"
	echo "and reboot your system."
else
	echo "*nInstallation completed. You should make the assignments above"
	echo "before running Visionaire."
endif

assign NewVisionaire:

ask "*nPress [RETURN] to continue."



