;****************************************************************************
;********************************  H E A D E R  *****************************
;****************************************************************************
;**									   									   **
;**  TITLE:        Install.jcl                                             **
;**                                                                        **
;**  FILE ID:      [F0]<Sys>Install.jcl                                    **
;**                                                                        **
;**  FUNCTION:     This Job Control Language (jcl) script file will        **
;**				   install the CTOS BMULTI to hard disk from floppy using  **
;**		   		   Install Manager.                                        **
;**                                                                        **
;**  INPUT:        None.                                                   **
;**                                                                        **
;**  OUTPUT:       None.                                                   **
;**                                                                        **
;**  CALLED BY:    Install ManagerFloppy Install                          **
;**                                                                        **
;**  CALLSUSES:   [F0]<Sys>Install.Ctrl                                   **
;**                                                                        **
;**  ASSUMPTIONS:  Install Manager is present on the system that BMULTI is **
;**		    	   going to be installed on.                               **
;**                                                                        **
;**                                                                        **
;**  HISTORY:                                                              **
;**                                                                        **
;**  mmddyy  Who     Description                                         **
;**                                                  **
;**  110190  GNC     First created for BMULTI Release Level 10.1.0000    **
;**   11791  GNC     Modifies for BMULTI Release Level 10.1.0100         **
;**  040191  Vish    Added new params to Agent; Changed SRFilter param   **
;**  050192  Vish    Changed to handle installation via 3 disks R10.2    **
;**  100693  JGlamb  Took out Reboot (reminder message displayed).       **
;****************************************************************************

;****************************************************************************
;**************************** NATIONALIZATION ISSUES ************************
;****************************************************************************
;** 	In order to nationalize this file, do the following:	           **
;**									   									   **
;**			1  Nationalize the NATIONALIZABLE STRINGS found at the 	   **
;**				beginning and in the middle. Search on NATIONALIZABLE 	   **
;**				STRINGS.  												   **
;**			2  Nationalize the commands TYPE, COPY, NEW COMMAND, 		   **
;**				LIST REQUEST SET, and MAKE REQUEST SET.  	    		   **
;**			3  Leave the rest unchanged.			   					   **
;**									   									   **
;****************************************************************************
;****************************************************************************




$JOB BMULTInstall
; This is a Floppy Install of BMULTI R10.4


;******************************************************************************
; SUPPRESS DISPLAYING OF JCL COMMANDS AND SCROLLING

$PauseOff
$EchoOff
;******************************************************************************


;******************************************************************************
; NATIONALIZABLE STRINGS

Yes = 'YES'
UnattendMsg = 'NONINTERACTIVE MODE IS NOT SUPPORTED. Continue the installation?'
MasterMsg = '             INSTALLATION FROM MASTER IS NOT SUPPORTED'
MasterMsg1 = '                    AJ PRESS ANY KEY TO EXIT AA'

RNDisplMsg = 'Would you like to display the Release Notes?'
RNPrintMsg = 'Would you like to print the Release Notes?'
PrinterMsg = 'Enter printer name, PRESS GO.'
RNHelpMsg1 = '        If you wish to view the Release Notes after'
RNHelpMsg2 = '              this installation is complete,'
RNHelpMsg3 = '              enter: COPY'
RNHelpMsg4 = '                        then PRESS AE RETURN AA'
RNHelpMsg5 = '              enter: [F0]<Sys>ReleaseNotes.Doc'
RNHelpMsg6 = '                        then PRESS AE RETURN AA'
RNHelpMsg7 = '              enter: your printer name to print the Release'
RNHelpMsg8 = '                     Notes or [Vid] to display it on your B20'
RNHelpMsg9 = '                        then PRESS AE GO AA'
CopyRNile    = 'AE Copying ReleaseNotes.doc to AA'

SelectMsg = 'Please select one or more of the following features:'
Selection1 = 'BMULTI Communication Service'
Selection2 = 'BMULTI Line Monitor'
Selection3 = 'BMULTI X.25'
Selection4 = 'BMULTI Agent'
Selection5 = 'BMULTI SuspendResume Filter'
Selection6 = 'Just Update Request Codes'

Sel1Files = 'AE Copying BMULTI Communication Service files ............ AA'
Sel2Files = 'AE Copying BMULTI Line Monitor files ............ AA'
Sel3Files = 'AE Copying BMULTI X.25 ............ AA'
Sel4Files = 'AE Copying BMULTI Agent files ............ AA'
Sel5Files = 'AE Copying BMULTI SuspendResume files ............ AA'
Sel6Files = 'AE Updating Request Codes ............ AA'

CommandMsg   = 'AE Creating Commands ............ AA'
DoneMsg      = 'AE ... done. AA'
PressKeyMsg = '                    AJ Press Any Key to Continue AA'
EndMsg2 = 'AE*     PLEASE REMEMBER TO REBOOT YOUR SERVER WORKSTATION      *AA'
EndMsg3 ='AE*       INSTALLATION OF CTOS BMULTI R10.4 IS COMPLETE.       *AA'
RebootMsg = 'You need to reboot your system. Would you like to reboot now?'

; END OF NATIONALIZABLE STRINGS
;******************************************************************************


;******************************************************************************
; INITIALIZE VARIABLES

NOTFOUND = 65535
TRUE	 = 255
COPYFROM = ConcatStrings(DeviceFrom,'<Unisys>')
;******************************************************************************


;******************************************************************************
; CHECK IF WE ARE DOING A LOCAL INSTALLATION OR A MASTER INSTALLATION. 
	
$If Public 
	DestPath = '[sys]<sys>'
	DefVol = '[Sys]'
	CmdFileTo = '[Sys]<sys>Cluster.cmds'
$Else
	DestPath = '[Sys]<sys>'
	DefVol = '[Sys]'
$EndIf
;******************************************************************************


;*****************************************************************************
; SCROLL SOME LINES ON THE SCREEN SO MESSAGES LOOK BETTER

i = 0
$While (i < 25)
	i = i + 1
	$DisplayLine
$EndWhile
;******************************************************************************


;******************************************************************************
; TELL USER THAT UNATTENDED MODE AND INSTALL FROM MASTER ARE NOT SUPPORTED IF 
; THEY ARE CHOSEN

$If InstallType = 2
	$DisplayLine(MasterMsg)
	$DisplayLine(MasterMsg1)
$Else
$DeAssign(MasterMsg)

DoInstall = TRUE
$If Unattended
	DoInstall = UserSelectYesNo(UnattendMsg,Yes)
$EndIf
$DeAssign(UnattendMsg)

$If DoInstall
$DeAssign(DoInstall)
;******************************************************************************


	$RestartLabel  
;******************************************************************************
; ASK THE USER IF WANTS TO DISPLAY THE RELEASE NOTES FILE (ReleaseNotes.doc) ON
; THE SCREEN. IF YES, DISPLAY IT.

	RNDisplay = UserSelectYesNo(RNDisplMsg,Yes)
	$If RNDisplay
		RNFile = ConcatStrings(DeviceFrom,'<sys>ReleaseNotes.doc')
		$PauseOn
		$EchoOn
		$Command Type, RNFile, No
		$EchoOff
		$PauseOff
		$Deassign (RNFile)
	$EndIf
	$DeAssign(RNDisplay)
	$DeAssign(RNDisplMsg)
;******************************************************************************


;******************************************************************************
; ASK THE USER IF WANTS TO PRINT THE RELEASE NOTES FILE (ReleaseNotes.doc). IF 
; YES, ASK THE USER FOR THE PRINTER NAME AND PRINT IT. 

	i = 0
	$While (i < 25)
		i = i + 1
		$DisplayLine
	$EndWhile
	RNPrint = UserSelectYesNo(RNPrintMsg,Yes)
	$If RNPrint
		Printer = UserEnterValue(PrinterMsg)
		RNFile = ConcatStrings(DeviceFrom,'<sys>ReleaseNotes.doc')
		Temp = ConcatStrings (' ', Printer)
		Temp = ConcatStrings (CopyRNile, Temp)
		$Display (Temp)
		$Command Copy, RNFile, Printer,y
		$DisplayLine (DoneMsg)
		$DeAssign (Printer)
		$DeAssign (RNFile)
		$Deassign (Temp)
	$EndIf
	$DeAssign(RNPrint)
	$DeAssign(RNPrintMsg)
	$DeAssign (PrinterMsg)
	$DeAssign (CopyRNile)
;******************************************************************************


;******************************************************************************
; ADVISE USER ON WHAT TO DO IF WANTS TO LATER PRINT OR DISPLAY THE RELEASE 
; NOTES.

	i = 0
	$While (i < 25)
		i = i + 1
		$DisplayLine
	$EndWhile
	$DisplayLine (RNHelpMsg1)
	$DisplayLine (RNHelpMsg2)
	$DisplayLine
	$DisplayLine (RNHelpMsg3)
	$DisplayLine (RNHelpMsg4)
	$DisplayLine
	$DisplayLine (RNHelpMsg5)
	$DisplayLine (RNHelpMsg6)
	$DisplayLine
	$DisplayLine (RNHelpMsg7)
	$DisplayLine (RNHelpMsg8)
	$DisplayLine (RNHelpMsg9)
	i = 0
	$While (i < 5)
		i = i + 1
		$DisplayLine
	$EndWhile
	$DisplayAndWait (PressKeyMsg)
	i = 0
	$While (i < 35)
		i = i + 1
		$DisplayLine
	$EndWhile
	$DeAssign (RNHelpMsg1)
	$DeAssign (RNHelpMsg2)
	$DeAssign (RNHelpMsg3)
	$DeAssign (RNHelpMsg4)
	$DeAssign (RNHelpMsg5)
	$DeAssign (RNHelpMsg6)
	$DeAssign (RNHelpMsg7)
	$DeAssign (RNHelpMsg8)
	$DeAssign (RNHelpMsg9)
;******************************************************************************


	$RestartLabel  
;******************************************************************************
; LET THE USER SELECT WHAT TO INSTALL.

	i = 0
	$While (i < 22)
		i = i + 1
		$DisplayLine
	$EndWhile
	Selections = UserSelectMultiple (SelectMsg, Selection1, Selection2, 
									 Selection3, Selection4, Selection5, 
									 Selection6)
	Select1 = SubString(Selection1, Selections)
	Select2 = SubString(Selection2, Selections)
	Select3 = SubString(Selection3, Selections)
	Select4 = SubString(Selection4, Selections)
	Select5 = SubString(Selection5, Selections)
	Select6 = SubString(Selection6, Selections)
	$DeAssign (SelectMsg)
	$DeAssign (Selections)
	$DeAssign (Selection1)
	$DeAssign (Selection2)
	$DeAssign (Selection3)
	$DeAssign (Selection4)
	$DeAssign (Selection5)
	$DeAssign (Selection6)
;******************************************************************************


	$RestartLabel  
;******************************************************************************
; UPDATE THE REQUEST CODES

	$EchoSome
	i = 0
	$While (i < 25)
		i = i + 1
		$DisplayLine
	$EndWhile
	$DisplayLine(Sel6Files) 
	$DisplayLine

	ReqSysFile = ConcatStrings(DestPath,'Request.sys') 
	BmReqSysFile = ConcatStrings(DeviceFrom,'<sys>Request.BMulti.txt')
	$Command List Request Set, ReqSysFile, [scr]<$>req.txt
	$Command Make Request Set, ([scr]<$>req.txt, BmReqSysFile), 
                                 ReqSysFile

	$DisplayLine
	$DisplayLine (DoneMsg)
	$DeAssign(Sel6Files)
	$DeAssign(ReqSysFile)
	$DeAssign(BmReqSysFile)
	$EchoOff
;******************************************************************************

;******************************************************************************
; MORE NATIONALIZABLE STRINGS. THESE ARE USED TO CREATE THE COMMANDS

Cmd1 = 'Install BMULTI Gateway'
Cmd1Param1 = '[Configuration File]'
Cmd1Descr = 'Installs the Burroughs Multipoint protocol handler.'

Cmd2 = 'Deinstall BMULTI Gateway'
Cmd2Param1 = '[<ServiceID>]'
Cmd2Descr = 'Deinstalls the Burroughs Multipoint protocol handler.'

Cmd3 = 'Configure BMULTI'
Cmd3Param1 = '[Configuration File]'
Cmd3Descr = 'Creates and maintains BMULTI configuration files.'

Cmd4 = 'BMULTI Status'
Cmd4Param1 = '[{Node Name}<ServiceID>]'
Cmd4Descr = 'Displays status of individual BMULTI stations.'

Cmd5 = 'Monitor BMULTI'
Cmd5Param1 = '[<ServiceID>]'
Cmd5Descr = 'Captures and displays BMULTI communications line traffic.'

Cmd6 = 'Install BmX25'
Cmd6Param1 = '[Configuration File]'
Cmd6Descr = 'Installs the BMULTIX.25 Service.'

Cmd7 = 'Deinstall BmX25'
Cmd7Param1 = '[<ServiceID>]'
Cmd7Descr = 'Deinstalls the BMULTIX.25 Service.'

Cmd8 = 'Install BMULTI Agent'
Cmd8Param1 = '[Configuration File]'
Cmd8Param2 = '[Detach on Tx Error (Default = Y)]'
Cmd8Param3 = '[Tx Timeout in Secs (Default = 120)]'
Cmd8Descr = 'Installs the BMULTI Agent.'

Cmd9 = 'BMULTI Agent Configurator'
Cmd9Param1 = '[Configuration File]'
Cmd9Descr = 'Invokes the BMULTI Agent configuration utility.'

Cmd10 = 'Install BMULTI SR Filter'
Cmd10Param1 = 'Number of Sessions'
Cmd10Descr = 'Installs the BMULTI SuspendResume filter.'

Cmd11 = 'Deinstall BMULTI SR Filter'
Cmd11Descr = 'Deinstalls the BMULTI SuspendResume filter.'

; END OF MORE NATIONALIZABLE STRINGS
;******************************************************************************


	$RestartLabel  
;******************************************************************************
; COPY THE FILES FROM THE FLOPPIES TO THE HARD DISK

	$EchoSome

	$If Select1 <> NOTFOUND
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile
		$DisplayLine (Sel1Files)

		$DisplayLine
		Files = ConcatStrings(COPYFROM,'BMultiFiles.list')
		Files = ConcatStrings('@', Files)
		$Run [Sys]<sys>LCopy.run, Files, COPYFROM, DestPath,,y,,y,y

		$DeAssign(Files)
		$DisplayLine
		$DisplayLine (DoneMsg)
		$DisplayLine
		$DisplayLine
		$DisplayLine

		$DisplayLine (CommandMsg)
		$DisplayLine

		RunFile = ConcatStrings(DestPath,'BmZip.Run') 
		$Command New Command, Cmd1, 
             RunFile, (Cmd1Param1), Cmd1Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmUnZip.Run') 
		$Command New Command, Cmd2, 
             RunFile, (Cmd2Param1), Cmd2Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmFileEdit.Run') 
		$Command New Command, Cmd3, 
             RunFile, (Cmd3Param1), Cmd3Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmStatus.Run') 
		$Command New Command, Cmd4, 
             RunFile, (Cmd4Param1), Cmd4Descr, Yes, , CmdFileTo

		$DeAssign(RunFile)
		$DisplayLine
		$DisplayLine (DoneMsg)	
	$EndIf
	$DeAssign(Select1)
	$DeAssign(Sel1Files)
	$DeAssign(Cmd1)
	$DeAssign(Cmd1Param1)
	$DeAssign(Cmd1Descr)
	$DeAssign(Cmd2)
	$DeAssign(Cmd2Param1)
	$DeAssign(Cmd2Descr)
	$DeAssign(Cmd3)
	$DeAssign(Cmd3Param1)
	$DeAssign(Cmd3Descr)
	$DeAssign(Cmd4)
	$DeAssign(Cmd4Param1)
	$DeAssign(Cmd4Descr)

	InsNextFlopy = 0

	$If Select2 <> NOTFOUND
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile

		$NextFloppy('B25BMU2')
		InsNextFlopy = 1

		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile
		$DisplayLine (Sel2Files)


		$DisplayLine
		Files = ConcatStrings(COPYFROM,'BmMonitorFiles.list')
		Files = ConcatStrings('@', Files)
		$Run [Sys]<sys>LCopy.run, Files, COPYFROM, DestPath,,y,,y,y

		$DeAssign(Files)
		$DisplayLine
		$DisplayLine (DoneMsg)
		$DisplayLine
		$DisplayLine
		$DisplayLine

		$DisplayLine (CommandMsg)
		$DisplayLine

		RunFile = ConcatStrings(DestPath,'BmLineMonitor.Run') 
		$Command New Command, Cmd5, 
             RunFile, (Cmd5Param1), Cmd5Descr, Yes, , CmdFileTo

		$DeAssign(RunFile)
		$DisplayLine
		$DisplayLine (DoneMsg)	
	$EndIf
	$DeAssign(Select2)
	$DeAssign(Sel2Files)
	$DeAssign(Cmd5)
	$DeAssign(Cmd5Param1)
	$DeAssign(Cmd5Descr)

	InsNextFlopy = 0

	$If Select3 <> NOTFOUND
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile

		$NextFloppy('B25BMU2')
		InsNextFlopy = 1

		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile
		$DisplayLine (Sel3Files)

		$DisplayLine
		Files = ConcatStrings(COPYFROM,'BmX25Files.list')
		Files = ConcatStrings('@', Files)
		$Run [Sys]<sys>LCopy.run, Files, COPYFROM, DestPath,,y,,y,y

		$DeAssign(Files)
		$DisplayLine
		$DisplayLine (DoneMsg)
		$DisplayLine
		$DisplayLine
		$DisplayLine

		$DisplayLine (CommandMsg)
		$DisplayLine

		RunFile = ConcatStrings(DestPath,'BmX25Zip.Run') 
		$Command New Command, Cmd6, 
             RunFile, (Cmd6Param1), Cmd6Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmX25UnZip.Run') 
		$Command New Command, Cmd7, 
             RunFile, (Cmd7Param1), Cmd7Descr, Yes, , CmdFileTo

		$DeAssign(RunFile)
		$DisplayLine
		$DisplayLine (DoneMsg)	
	$EndIf
	$DeAssign(Select3)
	$DeAssign(Sel3Files)
	$DeAssign(Cmd6)
	$DeAssign(Cmd6Param1)
	$DeAssign(Cmd6Descr)
	$DeAssign(Cmd7)
	$DeAssign(Cmd7Param1)
	$DeAssign(Cmd7Descr)

	InsNextFlopy = 0

	$If Select4 <> NOTFOUND
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile

			$NextFloppy('B25BMU3')
			InsNextFlopy = 1
			i = 0
			$While (i < 25)
				i = i + 1
				$DisplayLine
			$EndWhile

		$DisplayLine (Sel4Files)

		$DisplayLine
		Files = ConcatStrings(COPYFROM,'BmAgentFiles.list')
		Files = ConcatStrings('@', Files)
		$Run [Sys]<sys>LCopy.run, Files, COPYFROM, DestPath,,y,,y,y

		$DeAssign(Files)
		$DisplayLine
		$DisplayLine (DoneMsg)
		$DisplayLine
		$DisplayLine
		$DisplayLine

		$DisplayLine (CommandMsg)
		$DisplayLine

		RunFile = ConcatStrings(DestPath,'BMultiAgent.Run') 
		$Command New Command, Cmd8, 
        RunFile, (Cmd8Param1,Cmd8Param2,Cmd8Param3), Cmd8Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmultiAgentConfig.Run') 
		$Command New Command, Cmd9, 
             RunFile, (Cmd9Param1), Cmd9Descr, Yes, , CmdFileTo

		$DeAssign(RunFile)
		$DisplayLine
		$DisplayLine (DoneMsg)	
	$EndIf
	$DeAssign(Select4)
	$DeAssign(Sel4Files)
	$DeAssign(Cmd8)
	$DeAssign(Cmd8Param1)
	$DeAssign(Cmd8Descr)
	$DeAssign(Cmd9)
	$DeAssign(Cmd9Param1)
	$DeAssign(Cmd9Descr)

	InsNextFlopy = 0

	$If Select5 <> NOTFOUND
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile

			$NextFloppy('B25BMU3')
			InsNextFlopy = 1
			i = 0
			$While (i < 25)
				i = i + 1
				$DisplayLine
			$EndWhile

		$DisplayLine (Sel5Files)

		$DisplayLine
		Files = ConcatStrings(COPYFROM,'BmSRFFiles.list')
		Files = ConcatStrings('@', Files)
		$Run [Sys]<sys>LCopy.run, Files, COPYFROM, DestPath,,y,,y,y

		$DeAssign(Files)
		$DisplayLine
		$DisplayLine (DoneMsg)
		$DisplayLine
		$DisplayLine
		$DisplayLine

		$DisplayLine (CommandMsg)
		$DisplayLine

		RunFile = ConcatStrings(DestPath,'BmSRF.Run') 
		$Command New Command, Cmd10, 
             RunFile, (Cmd10Param1), Cmd10Descr, Yes, , CmdFileTo

		RunFile = ConcatStrings(DestPath,'BmSRFDin.Run') 
		$Command New Command, Cmd11, 
             RunFile, , Cmd11Descr, Yes, , CmdFileTo

		$DeAssign(RunFile)
		$DisplayLine
		$DisplayLine (DoneMsg)	
	$EndIf
	$DeAssign(Select5)
	$DeAssign(Sel5Files)
	$DeAssign(Cmd10)
	$DeAssign(Cmd10Param1)
	$DeAssign(Cmd10Descr)
	$DeAssign(Cmd11)
	$DeAssign(Cmd11Descr)

;******************************************************************************


	$RestartLabel  ;******************************************************************************
; END THE INSTALLATION

	$EchoOff
	i = 0
	$While (i < 25)
		i = i + 1
		$DisplayLine
	$EndWhile
	EndMsg1 = 
         'AE**************************************************************AA'
	$DisplayLine (EndMsg1)
	$DisplayLine (EndMsg3)
	$DisplayLine (EndMsg1)
	i = 0
	$While (i < 9)
		i = i + 1
		$DisplayLine
	$EndWhile
	$DisplayAndWait (PressKeyMsg)
;	$While (i < 34)
;		i = i + 1
;		$DisplayLine
;	$EndWhile

;	$If DefVol = '[Sys]'
;		i = 0
;		$While (i < 7)
;			i = i + 1
;			$DisplayLine
;		$EndWhile
;		DoReboot = UserSelectYesNo(RebootMsg,Yes)
;		$If DoReboot
;			$Reboot
;		$EndIf
;		$DeAssign(RebootMsg)
;		$DeAssign(DoReboot)
;	$Else
		i = 0
		$While (i < 25)
			i = i + 1
			$DisplayLine
		$EndWhile
		$DisplayLine (EndMsg1)
		$DisplayLine (EndMsg2)
		$DisplayLine (EndMsg1)
	
;	$EndIf
	
	i = 0
	$While (i < 9)
		i = i + 1
		$DisplayLine
	$EndWhile

	$DisplayAndWait(MasterMsg1)
	i = 0
	$While (i < 34)
		i = i + 1
		$DisplayLine
	$EndWhile

	$DeAssign(MasterMsg1)
;*****************************************************************

	$PauseOn
	$EchoOn
$EndIf ;If DoInstall
$EndIf ;If InstallType = 2 ...... Else
$END
