; ************************************************
; *
; * $VER: Install-EB920 v1.0.0 (19.05.93)
; *
; * This is the installation script for ASDG's Lan Rover (EB920) Ethernet Board
; * SANA II device driver.
; *
; * NOTE: Users of Oxxi, Inc.'s Amiga Client Software for Novell NetWare and
; *       Interworks' ENLAN-DFS do not need any software on this disk.
; *
; * Copyright © 1992-1993 ASDG, Incorporated  All Rights Reserved
; *
; ************************************************
;


; ****************************
; * Set up some global variables.
; ****************************
;
(set ProductName	"EB920")		; product name
(set ProductBaseName	"EB920")		; product base name
(set HardwareName	"EB920")		; hardware name

(set OSVersion		(/ (getversion) 65536))
(set TotalFiles		0)
(set AccumFiles		0)
(set PctDone		0)
(set DisplayReadMe	0)

(set Disk1Name		"EB920_SANAII")		; actual name of disk 1
(set DiskInstall	Disk1Name)		; installation (main) disk




(procedure setDeviceDriverOpts
;
; ****************************
; * Ask the user which device driver to install.
; ****************************
;
	(
	(set DeviceDriverOpts
		(askchoice
			(prompt
				("At which interrupt level do you want to run the %s." HardwareName)
			)
			(help
				"This part of the installation procedure lets you select which "
				"device driver to install, based upon the interrupt level at which you "
				"want to run the board.\n"
				"\n"
				"*** Interrupt Level 2\n"
				"This choice will install the level 2 version of the eb920.device.  Interrupt "
				("level 2 is a fairly low priority interrupt level.  The %s running" HardwareName)
				"at this level will probably not impact your system performance at all, but "
				"may not get services by your Amiga quickly enough if placed on VERY busy networks.  "
				"Int 2 operation is produced by setting jumper J2 to the right. (when holding the "
				"board with the fingers towards you).\n"
				"\n"
				"*** Interrupt Level 6\n"
				"This choice will install the level 6 version of the eb920.device.  This is a "
				("high priority interrupt, which means the %s will be serviced right " HardwareName)
				"away; possibly at the expense of other devices on your system.  Int 6 operation "
				"is produced by setting jumper J2 to the left.\n"
				"\n"
				@askchoice-help
			)
			(choices
				; bit position 0 -- todo & 1
				;
				"Interrupt Level 2"

				; bit position 1 -- todo & 2
				;
				"Interrupt Level 6"
			)
		)
	)

	(if (= DeviceDriverOpts 0)
		(set DeviceDriverCode "2")
		(set DeviceDriverCode "6")
	)
	)
)




(procedure setDirPath
;
; ****************************
; * Ask the user for a directory name.
; ****************************
;
; these variables must be defined before calling this procedure:
;    setDirPathWhy
;    setDirPathHelp
;    DirPath
;
; this procedure returns the selected directory in DirPath
;
	(
	(set moveon FALSE)
	(while (NOT moveon)
		(
		(set DirPath
			(askdir
				(prompt	("Please select the directory %s" setDirPathWhy)
				)
				(help	setDirPathHelp
					"\n"
					@askdir-help
				)
				(default DirPath)
			)
		)

		(if (= (exists DirPath) 0)
			(makedir DirPath)
			(set moveon TRUE)
		)
		)
	)
	)
)




; ****************************
; * Device Driver Installation routine
; ****************************
;
(procedure DeviceDriverInstall
	(
	; ****************************
	; * Install the selected device driver
	; ****************************
	;
	(if (<> (exists "DEVS:Networks") 2)
		(makedir "DEVS:Networks")
	)

	(copyfiles
		(prompt	("Installing Interrupt Level %s device driver..." DeviceDriverCode))
		(help	"")
		(source	("%s:devs_i%s/eb920.device" DiskInstall DeviceDriverCode))
		(dest	"DEVS:Networks")
	)
	)
)




; ****************************
; * SANA II utilities Installation routine
; ****************************
;
(procedure SANAIIUtilInstall
	(
	; ****************************
	; * Install the SANA II Utilities
	; ****************************
	;
	(copyfiles
		(prompt	"Installing SANA II utility...")
		(help	"")
		(source	("%s:C/s2util" DiskInstall))
		(dest	"C:")
	)
	)
)




; ****************************
; * General CleanUp routine
; ****************************
;
(procedure cleanUp
	(
	; ****************************
	; * exit the program.
	; ****************************
	;
	(if (= DisplayReadMe 1)
		(
		(if (< OSVersion 37)
			(run ("c:run %s:C/More %s:ReadMe" DiskInstall DiskInstall))
			(if (>= OSVersion 39)
				(run ("run SYS:Utilities/MultiView %s:ReadMe" DiskInstall))
				(run ("run %s:C/More %s:ReadMe" DiskInstall DiskInstall))
			)
		)
		(complete 100)
		(exit)
		)
		(
		(complete 100)
		(exit (quiet))
		)
	)
	)
)




; *************************************************************************
; *                         ACTUAL START OF SCRIPT
; *
; * Ask all questions for the user now, do all of the work later.
; *************************************************************************
;

; ****************************
; * set the default destination to DEVS:Networks.
; ****************************
;
(set @default-dest "DEVS:Networks")


(if (= 1 (askbool
		(prompt	("\n\nAre you using the %s board with any one of the following packages?\n\n\n1. Oxxi, Inc.'s Amiga Client Software\n      for Novell NetWare             \n\n2. Interworks' ENLAN-DFS             " HardwareName))
		(help	"This part of the installation process will determine whether anything on this disk will be required for use "
			"with a particular networking software package.\n"
			"\n"
			"At this time, Oxxi's Amiga Client Software for Novell NetWare and Interworks' "
			("ENLAN-DFS do not require any software on this disk to function with the %s board.  " HardwareName)
			"You should consult the manuals that come with those packages for information regarding the software that is required for use "
			("with the %s.\n" HardwareName)
			"\n"
			("If you will be using the %s board with a networking package not listed above, select the " HardwareName)
			"No button.\n"
			"\n\n"
			"All products are trademarks or registered trademarks of their respective holders.\n")))
	(
	(message
		"\n\nThese packages do not need anything installed from this disk.  Press either the Proceed of Abort Install button to end this installation.")
	)
	(
	(setDeviceDriverOpts)

	(complete 0)

	(message "\nShall I proceed with the installation?"
		(help	"Once you press the Proceed button, the selected software will be installed.  This is your last chance "
			"to abort this procedure.\n"
			"\n"
			"After you press Proceed, you can use the Esc key to abort the installation procedure.\n")
	)

	(complete 33)
	(DeviceDriverInstall)

	(complete 66)
	(SANAIIUtilInstall)

	(set DisplayReadMe	1)
	)
)

(cleanUp)
