; Install MagicBoard V1 Beta
; This script installs MagicBoard V1 Beta.  Checks for needed libraries, OS version
; CPU, adds an assign to S:UserStartup.

(transcript "Installing MagicBoard V1 Beta...")

(set #intromsg (cat	"\nThis installs MagicBoard V1 Beta on your hard\n"
			"disk and checks your Kickstart and CPU.\n"))

(message #intromsg)

	;Check to see what version of the OS we're running on.
(if (< (/ (getversion) 65536) 39)
	(
	(if (<> 1 (askbool (help @askbool-help) (prompt (cat "You must be using Kickstart 3.0+ to run MagicBoard V1 Beta.\n"
					"\n"
					"Do you wish to continue anyway?\n"))))

		(
		(abort "Aborting as the Kickstart is not sufficient.")
		)
	)
	)
)


	; Check to see what CPU we're running on.
(if (>= 68020 (database "cpu"))
	(
	(if (<> 1 (askbool (help @askbool-help) (prompt (cat
					"\nYou need a 68020 CPU or better to run MagicBoard V1 Beta.\n"
					"\nDo you wish to continue anyway?\n"))))
		(
		(abort "Aborting as the CPU is not sufficient.")
		)
	)
	)
)

	;Get the destination directory from the user
(set wheredir
	(askdir
	(prompt "Select a directory where you would like to install "
		"MagicBoard. (A drawer will be created there)")
	(help @askdir-help)
	(default @default-dest)
	)
)

	;Create the directory for VWorlds
(set wheredir (tackon wheredir "MagicBNS"))
(makedir wheredir (infos))


(working "Installing MagicBoard...")
	;Copy all of the files over to the destination
(copyfiles
	(prompt "")
	(help @copyfiles-help)
	(pattern "~(Install MagicBoard|Install MagicBoard.info|fonts)")
	(infos)
	(source (pathonly @icon))
	(dest wheredir)
)

   (copyfiles
      (prompt "Copying font.")
      (help @copyfiles-help)
      (source "fonts/")
      (dest "fonts:")
      (all)
   )


	;Add an assign to user startup
(startup "MagicBoard"
	(prompt "I need to add an assign to your\n\"s:user-startup\" file.")
	(help @startup-help)
	(command ("assign MagicBoard: \"%s\"\n" wheredir))
	(command ("assign MagicNet: \"%s\"\n" wheredir))
	(command ("assign MagicSchematic: \"%s\"\n" wheredir))
)


(exit "Please reboot your computer before running\nMagicBoard.")

