
; Install script for Spot (Workbench 2.0)

(set reqtoolslib "/libs/reqtools.library")
(set powerpackerlib "/libs/powerpacker.library")
(set spotdir "/")

;=============================================================================
; English strings

(set default_lang 2)

(set #bad-kick
(cat "You must be using Kickstart 2.04 to install using this script!"
))

(set #copying-reqtools     "Copying reqtools.library to Libs:...")
(set #copying-powerpacker  "Copying powerpacker.library to Libs:...")

(set #where-mail "Where should MAIL: be assigned ?")
(set #where-spot
(cat "Where would you like to install Spot ?\n"
     "(A drawer will be created)"
))

(set #add-mail-startup
(cat "\nAdd MAIL: assignment to the \"S:user-startup\" "
     "so that your system will be properly configured to use Spot ?"
))

(set #copy-arexx "\nInstall supplied ARexx scripts in REXX: ?")
(set #copy-arexx-help
(cat "\nThis will install some ARexx scripts "
     "that are included in the Spot distribution."
))

(set #which-language
(cat "\nWhich languages should be installed?"
))
(set #which-language-help
(cat "\nThe Amiga can be operated in many different"
	  " languages. If you want Spot to use the same"
     " language as the Amiga Workbench"
	  " then a catalog file must be copied to your"
	  " harddisk for each language supported.\n\n"
	  "To reduce the amount of space consumed by the"
	  " language files, you can select to have only the"
	  " files of specific languages copied.\n\n"
	  "Simply check the boxes of the languages you wish"
	  " to have available on your system.\n\n"
	  @askoptions-help
))

(set #install-msg
(cat "\n\nSpot installation script.\n"
     "This script installs Spot on your Amiga.\n\n"
     "Read the README file for more information\n"
     "on the distribution of Spot.\n\n"
     "Spot © 1993 Nico François\n"
     "All rights reserved."
))

;=============================================================================
; make sure we are running under a 2.04 ROM

(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

;=============================================================================

(message #install-msg)

(set maildir (getassign "MAIL"))

(if maildir
(set dummy 1)
(
	(set maildir
		(askdir
			(prompt #where-mail)
			(help @askdir-help)
			(default @default-dest)
		)
	)
	(makeassign "MAIL" maildir (safe))
	(startup "Spot"
		(prompt #add-mail-startup)
		(help @startup-help)
		(command
			"Assign MAIL: \"" maildir "\"\n"
		)
	)
))

(set spotdestdir
	(tackon
		(askdir
			(prompt #where-spot)
			(help @askdir-help)
			(default @default-dest)
		)
		"Spot"
	)
)

(set @default-dest spotdestdir)

(copylib
	(prompt "\n" #copying-reqtools)
	(help @copylib-help)
	(source reqtoolslib)
	(dest "Libs:")
	(confirm)
)

(copylib
	(prompt "\n" #copying-powerpacker)
	(help @copylib-help)
	(source powerpackerlib)
	(dest "Libs:")
	(confirm)
)

(makedir spotdestdir (infos))
(makedir (tackon spotdestdir "Catalogs"))

(copyfiles
	(source (tackon spotdir "Spot"))
	(dest spotdestdir)
	(infos)
)

(copyfiles
	(source (tackon spotdir "Spot.guide"))
	(dest spotdestdir)
	(infos)
)

(tooltype
	(dest (tackon spotdestdir "Spot.guide"))
	(setdefaulttool "SYS:Utilities/AmigaGuide")
)

(copyfiles
	(source (tackon spotdir "Spot.doc"))
	(dest spotdestdir)
	(infos)
)

(copyfiles
	(source (tackon spotdir "README"))
	(dest spotdestdir)
	(infos)
)

(if
	(askbool
		(prompt #copy-arexx)
		(help #copy-arexx-help)
		(default 1)
	)
	(
		(copyfiles
			(source (tackon spotdir "Rexx"))
			(dest "REXX:Spot")
			(all)
		)
	)
)
