; Install MagicBoard V1.01 and MagicSchematic
; This script update MagicBoard V1.01 and MagicSchematic 1.02.
; CPU, adds an assign to S:UserStartup.

(transcript "Update MagicBoard V1.01 and MagicSchematic 1.02.")

(set #intromsg (cat	"\nUpdate MagicBoard V1.0 to V1.01 and MagicSchematic v1.0 beta to v1.02\n"
			"\n\n"
			"\n- MagicBoard v1.00 must have installed.           \n"
			"\n- File must set Unprotect in MagicBoard Directory.\n"
			"\n- You must have graphic board.                    \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.")
		)
	)
	)
)













   (delete "MagicBoard:MagicNet" 
	(prompt "Delete MagicNet" )
      (optional force askuser)
   )

   (delete "MagicBoard:MagicNet.info" 
	(prompt "Delete MagicNet" )
      (optional force askuser)
   )

   (delete "MagicBoard:preference.MB" 
	(prompt "Delete Preference file" )
      (optional force askuser)
   )

   (delete "MagicBoard:preference.MN" 
	(prompt "Delete Preference file" )
      (optional force askuser)
   )

   (delete "MagicBoard:preference.MS" 
	(prompt "Delete Preference file" )
      (optional force askuser)
   )

































	;Get the destination directory from the user
;(set wheredir
;	(askdir
;	(prompt "Select the directory assigned to MagicBoard:" )
;v	(help @askdir-help)
;	(default @default-dest)
;	)
;)


(set wheredir "MagicBoard:")

	;Create the directory for MagicBoard
;(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.")

