; This is the installation script for BF3D-LW.V1

(set @dd
	(askdir
		(prompt "Please select location for BF3D directory.")
		(help
			"     You must select a directory into which the Broadcast Fonts 3D Objects will be"
			" installed.  The objects in this volume will require approximately 600K of"
			" free space. \n\n"
			"     SYS:Toaster/3D/objects is the suggested default. A directory called BF3D will be"
			" created and each set of objects that make up a font will be placed within its own" 
			" subdirectory. \n\n"
			@askdir-help
		)
		(default "SYS:toaster/3d/objects")
	)
)

(set @default-dest (tackon @dd "BF3D"))

(if
	(= (exists @default-dest) 0)
	(makedir @default-dest)
)

(onerror
)

(copyfiles
	(prompt "" )
	(help "")
	(source "BF3D-LW-MP3.1:C/lharc")
	(dest "RAM:")
)
(if
	(= 0 (exists "RAM:lharc"))
	(abort "Unable to copy necessary files to Ram Disk."
		 "  Please make sure you have at least 100K of memory"
		 " available before installing."
	)
)

(onerror
	(delete "RAM:lharc")
)

(complete 0)

(set fspc (getdiskspace @default-dest))

(if (< fspc 4000000)
	(
		(set go-on
			(askbool
				(prompt "\n\nNot enough space for all 9 Font Sets.\n"
						"\n Continue with Selective Install?")
				(help "")
				(default 1)
			)
		)
		(if go-on
			(set testall 0)
			(abort "Installation Aborted")
		)
	)	
	(set testall 
		(askbool
			(prompt "\n\nInstall All 9 Font Sets?\n\n"
					"This will require 4.0 mbytes\n"
					"of space on the Destination Partition\n\n")
			(help "Selecting no will allow you to choose\n"
				 "only the Font Sets you wish to install.")
			(default 1)
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 605000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Aurora Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
 			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Aurora Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.1:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.1:Aur.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:Aur.lzh"))
			(set srcdir "RAM:")
		)
	
		(working ("\n\nInstalling Aurora..."))
		(run ("RAM:lharc -n -m -wRam: x %sAur.lzh \"%s/\" " srcdir @default-dest))
		(set pct 10)
		(complete pct)
		(if (= 1 (exists "RAM:Aur.lzh"))
			(delete "RAM:Aur.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 327000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Belgium Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Belgium Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.1:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.1:Bel.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:Bel.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Belgium..."))
		(run ("RAM:lharc -n -m -wRam: x %sBel.lzh \"%s/\" " srcdir @default-dest))
		(set pct 20)
		(complete pct)
		(if (= 1 (exists "RAM:Bel.lzh"))
			(delete "RAM:Bel.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 225000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor View Point Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the View Point Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.1:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.1:vp.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:vp.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling View Point..."))
		(run ("RAM:lharc -m -n -wRam: x %svp.lzh \"%s/\" " srcdir @default-dest))
		(set pct 30)
		(complete pct)
		(if (= 1 (exists "RAM:vp.lzh"))
			(delete "RAM:vp.lzh")
		)
	)
)


(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 396000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Galleon Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Galleon Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.2:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.2:gal.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:gal.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Galleon..."))
		(run ("RAM:lharc -m -n -wRam: x %sgal.lzh \"%s/\" " srcdir @default-dest))
		(set pct 40)
		(complete pct)
		(if (= 1 (exists "RAM:gal.lzh"))
			(delete "RAM:gal.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 399000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Klondike Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Klondike Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.2:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.2:klon.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:klon.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Klondike..."))
		(run ("RAM:lharc -m -n -wRam: x %sklon.lzh \"%s/\" " srcdir @default-dest))
		(set pct 50)
		(complete pct)
		(if (= 1 (exists "RAM:klon.lzh"))
			(delete "RAM:klon.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 660000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Ornament Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Ornament Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.2:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.2:orn.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:orn.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Ornament..."))
		(run ("RAM:lharc -m -n -wRam: x %sorn.lzh \"%s/\" " srcdir @default-dest))
		(set pct 60)
		(complete pct)
		(if (= 1 (exists "RAM:orn.lzh"))
			(delete "RAM:orn.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 435000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Carlotta Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Carlotta Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.3:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.3:car.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:car.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Carlotta..."))
		(run ("RAM:lharc -m -n -wRam: x %scar.lzh \"%s/\" " srcdir @default-dest))
		(set pct 70)
		(complete pct)
		(if (= 1 (exists "RAM:car.lzh"))
			(delete "RAM:car.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 520000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Kangaroo Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Kangaroo Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.3:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.3:kang.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:kang.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Kangaroo..."))
		(run ("RAM:lharc -m -n -wRam: x %skang.lzh \"%s/\" " 
			srcdir @default-dest))
		(set pct 80)
		(complete pct)
		(if (= 1 (exists "RAM:kang.lzh"))
			(delete "RAM:kang.lzh")
		)
	)
)

(if testall
	(set dothis1 1)
	(
		(set fspc (getdiskspace @default-dest))

		(if (< fspc 415000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Time Line Font Set\n"
							"\n Continuing with Selective Install.")
						(help "")
						(default 1)
					)
				)

				(if go-on
					(set dothis1 0)
					(abort "Installation Aborted")
				)
			)	
			(set dothis1
				(askbool 
					(prompt "\n\nInstall the Time Line Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

(if dothis1
	(   
		(set srcdir "BF3D-LW-MP3.3:")
		(copyfiles
			(prompt "")
			(help "")
			(source "BF3D-LW-MP3.3:tl.lzh")
			(dest "RAM:")
		)
		(if (= 1 (exists "RAM:tl.lzh"))
			(set srcdir "RAM:")
		)

		(working ("\n\nInstalling Time Line..."))
		(run ("RAM:lharc -m -n -wRam: x %stl.lzh \"%s/\" " 
			srcdir @default-dest))
		(set pct 90)
		(complete pct)
		(if (= 1 (exists "RAM:tl.lzh"))
			(delete "RAM:tl.lzh")
		)
	)
)


(if (= 1 (exists "RAM:lharc"))
	(delete "RAM:lharc")
)

(complete 100)
