; * Clockwiser Installation Script File Written by Peter Schaap
; *
; * A Team Hoi Games Production
; *
; * (C) Copyright 1994 Rasputin Software, All Rights Reserved
; *
; * Another fine product made in Holland!


(set #clockwiser-install
(cat "\nAbout Clockwiser"
     "\n"
     "\nA Team Hoi Games Production"
     "\n(C) Copyright 1994 by"
     "\nRasputin Software."
     "\nAll Rights Reserved"
     "\n\nThis installation utility"
     "\nwill install the necessary files on your"
     "\nharddisk-drive."
))

(set #clockwiser-install-help
(cat "\nJust click proceed to continue."
     "\n"
     "\nThis installation program is for"
     "\nhard disk users only!"
))

; *******************************************
; * Install - Scherm 2                      *
; *******************************************

(set #clockwiser-install-part2
(cat "\nInstall Clockwiser"
     "\nThis program will install"
     "\nClockwiser on your harddisk"
     "\n\nProceed ?"
))

(set #clockwiser-install-part2-help
(cat ""
))

; ************************************************
; * Finished Installation (finally... :-D)       *
; ************************************************

(set #clockwiser-install-finished
(cat "\nInstallation of Clockwiser has been completed."
     "\n"
     "\nGood luck!"
))

(set #clockw-install-finished-help
(cat ""
))

; ******************************************
; * Please Insert DISK1                    *
; ******************************************

(set #insert-clockwiser-disk1
(cat "\nPlease insert Clockwiser disk 1"
     "\nin any drive."
))

(set #insert-clockwiser-disk1-help
(cat ""
))

; ******************************************
; * Please Insert DISK2                    *
; ******************************************

(set #insert-clockwiser-disk2
(cat "\nPlease insert Clockwiser disk 2"
     "\nin any drive."
))

(set #insert-clockwiser-disk2-help
(cat ""
))

(procedure addtouserstartup
;
; Maakt de Clockwiser: assign aan... ennuh... voegt die toe aan de
; userstartup. c'est la...
;
;    userStartupAppName
;    userStartupAssignName
;    userStartupAssignToName
;    userStartupHelp
;
	(

     (set userStartupAppName         "Clockwiser")
     (set userStartupAssignName      "Clockwiser")
     (set userStartupAssignToName    clockwiserdir)
     (set userStartupHelp            "When the Installers programs asks if you want to place this assignment into your S:user-startup file, you should selected the Proceed button; otherwise, the next time you boot up your machine, the program won't be able to find the necessary files it needs to run.\n")
	(startup
		(userStartupAppName)
		(prompt ("Add %s: assignment to \"S:user-startup\"?" userStartupAssignName))
		(help	userStartupHelp
			"\n"
			("Select the Proceed button to add an %s: assignment to the S:user-startup file.\n" userStartupAssignName)
			"\n"
			@startup-help)
		(command ("assign %s: \"%s\"" userStartupAssignName userStartupAssignToName))
	)
	(makeassign userStartupAssignName userStartupAssignToName)
	)
)

(procedure addtostartupsequence
;
; Maakt de Clockwiser: assign aan... ennuh... voegt die toe aan de
; startup sequence. c'est la...
;
;    userStartupAppName
;    userStartupAssignName
;    userStartupAssignToName
;    userStartupHelp
;
	(
     (set userStartupAppName         "Clockwiser")
     (set userStartupAssignName      "Clockwiser")
     (set userStartupAssignToName    clockwiserdir)
     (set userStartupHelp            "When the Installers programs asks if you want to place this assignment into your S:user-startup file, you should selected the Proceed button; otherwise, the next time you boot up your machine, the program won't be able to find the necessary files it needs to run.\n")

	(startup
		(userStartupAppName)
		(prompt ("Add %s: assignment to \"S:startup-sequence\"?" userStartupAssignName))
		(help	userStartupHelp
			"\n"
			("Select the Proceed button to add an %s: assignment to the S:startup-sequence file.\n" userStartupAssignName)
			"\n"
			@startup-help)
		(command ("assign %s: \"%s\"" userStartupAssignName userStartupAssignToName))
	)
	(makeassign userStartupAssignName userStartupAssignToName)
	)
)

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** GENERAL ********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ***********************************
; Specified directory does not exists
; ***********************************

(set #thatdirne
(cat "\n\nThe directory you specified does not exist."
     "\nDo you want to create it?"
))

(set #thatdirne-help
(cat "\nYou specified a directory that does not exist."
     "\n\nIf you choose Yes, the directory will be created."
     "\n\nIf you choose No, you will have the opportunity to"
     "\nspecify another directory."
))

; **************************************************
; Ask the user in which drawer to install Clockwiser
; **************************************************

(set #whereputclockwiser
(cat "In which disk or drawer should Clockwiser be installed?"
))

(set #whereputclockwiser-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed Clockwiser.  However, you may name it anything"
     "\nyou like.  The install script will create the"
     "\ndirectory if it does not exist.\n\n"
     @askdir-help
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** JUMP IN! *******************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ***********************************************************
;                Start of the Main Program!
; ***********************************************************

(if (askbool (prompt #clockwiser-install)
             (help #clockwiser-install-help)
             (choices "Continue" "End Installation")
             (default 0))
(
(if (askbool (prompt #clockwiser-install-part2)
             (help #clockwiser-install-part2-help)
             (choices "Yes" "End Installation")
             (default 1) )
(

; ****************************************************
; * Now, set the default directory for search a path *
; ****************************************************

	(set clockwiserdir (getassign "Work" "v"))

	; *****************************************************
	; * Did we get anything ? If not, set default to sys: *
	; *****************************************************

	( if (= clockwiserdir "") (set clockwiserdir "sys:") )
	(set goodresp FALSE)

	(while (= goodresp FALSE)
	(
		(set target (askdir (prompt #whereputclockwiser)
			    (help #whereputclockwiser-help)
			    (newpath)
			    (default "Sys:Clockwiser")))

		(if (not (exists target))
		(
				(if (askbool (prompt (#thatdirne))
					     (help (#thatdirne-help))
					      (default 0) )
				(
					(makedir target (infos) )
					(set goodresp TRUE)
				))
		)
		(
			(set goodresp TRUE)
		)
		)
	)
	 )

	(set clockwiserdir target)
	(set @default-dest target)

; * Dan maar zo... ff kijken: V36 > -> user-startup.... < V36 -> startup-
; * sequence...

	(set vernum (getversion "exec.library" (resident)))
	(set ver (/ vernum 65536))
	(if (< ver 36)      ; mot kleiner zijn! :-
	  (
               (addtostartupsequence)
          )
          (
               (addtouserstartup)
          )
        )


; *********************************************************
; * HE!!! EH... DE DISK MOT IN DE DRIVE ZITTUH!!!!!
; *********************************************************

; D laten staan... slaat op Disk...

	(if (not (getassign "Clock1" "d"))
	(
		(askdisk (prompt #insert-clockwiser-disk1)
			 (help #insert-clockwiser-disk1-help)
			 (dest "Clock1")
		)
	)
	)

; *********************************************************
; * INSTALL SCRIPT FILE HERE!!!!!!!!!!!!!!
; *********************************************************

	(copyfiles (source "Clock1:Clockwiser")
	           (dest clockwiserdir)
                (infos)
     )
	(copyfiles (source "Clock1:Clockwiser.info")
	           (dest clockwiserdir)
                (infos)
     )

; *********************************************************
; * INSTALL INTRO FILE HERE!!!!!!!!!!!!!!
; *********************************************************

	(copyfiles (source "Clock1:ClockIntro")
	           (dest clockwiserdir)
                (infos)
     )

	(if (not (getassign "Clock2" "d"))
	(
		(askdisk (prompt #insert-clockwiser-disk2)
			 (help #insert-clockwiser-disk2-help)
			 (dest "Clock2")
		)
	)
	)

; *********************************************************
; * INSTALL GAMERS FILE HERE!!!!!!!!!!!!!!
; *********************************************************

	(copyfiles (source "Clock2:ClockGame")
	           (dest clockwiserdir)
                (infos)
     )

; ***********************************************************
; * HIER "FF" ASSIGN NAAR CLOCKWISERDIR AAN SCRIPT TOEVOEGUH!
; ***********************************************************

)
)
)
	(askbool (prompt #clockwiser-install-finished)
              (help #clockw-install-finished-help)
                 (choices "Proceed")
	         (default 0))

	(set target clockwiserdir)
	(set @default-dest target)
)
