; 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-MP2.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 4300000)
	(
		(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.3 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 337000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Andromeda 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 Andromeda Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

		(if (< fspc 262000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Ballyhoo 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 Ballyhoo Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

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

		(if (< fspc 541000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Hobgoblin 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 Hobgoblin Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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


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

		(if (< fspc 414000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Bengalli 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 Bengalli Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

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

		(if (< fspc 507000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Freelance 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 Freelance Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

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

		(if (< fspc 637000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Fantasy 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 Fantasy Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

		(working ("\n\nInstalling Fantasy..."))
		(run ("RAM:lharc -m -n -wRam: x %sfan.lzh \"%s/\" " srcdir @default-dest))
		(set pct 60)
		(complete pct)
		(if (= 1 (exists "RAM:fan.lzh"))
			(delete "RAM:fan.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 Medallion 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 Medallion Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

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

		(if (< fspc 702000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Tear Sheet 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 Tear Sheet Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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

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

		(if (< fspc 251000)
			(
				(set go-on
					(askbool
						(prompt "\n\nNot enough room on " @default-dest
							"\nfor Tempest 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 Tempest Font Set?")
					(help "")
					(default 0)
				)
			)
		)
	)
)

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

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


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

(complete 100)
