;****************************************************************************
;**************************** H E A D E R  **********************************
;****************************************************************************
;**                                                                        **
;**  TITLE:        Install.jcl for LANceLM 1.1                            **
;**                                                                        **
;**  FILE ID:      [F0]<Sys>Install.jcl                                    **
;**                                                                        **
;**  FUNCTION:     This Job Control Language (jcl) script file will        **
;**                install the LANceLM 1.1 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           **
;**                LANceLM 1.1 is going to be installed on.               **
;**                                                                        **
;**  HISTORY															   **
;**  s1.1.04   RRQ  UCF 26570905:  On 3.5 distribution diskettes, Protocol **
;**                 Manager resides on disk 2.  Retain separate           **
;**                 installation.										   **
;**                                                                        **
;****************************************************************************

$Job GenInstall

	;****************************************************************** 
	;            This is a floppy install of LANceLM 1.1
	;******************************************************************	

	$PauseOff

	;****************************************************************** 
	;                  Nationalizable Strings 
	;****************************************************************** 

	DirMsg      = 'Creating directory <LANce>..'
	DoneMsg     = '. done.'
	OptionMsg1  = 'Press GO to create the directory'
	ComMsg    	= 'Creating commands..'
	InstDoneMsg = 'When installation is completed, please reboot your system'
	MergeMsg    = 'Merging LANceLM request codes..'
	PtrNameMsg  = 'Enter your printer name and press AE<GO>AA.'
	RifViewMsg  = 'Do you wish to view the release notes at this time?'
	RifPrintMsg = 'Do you wish to print the release notes at this time?'
	UserMsg1    = 'The default installation path for this product'
	UserMsg2    = 'will be the [sys]<LANce>.'
	GoMsg       = 'Please press AE<GO>AA when ready'
	DelMsg		= 'Removing old ClusterShare files..'
	LibMsg		= 'Do you want the software development library files copied?'
 	RemCmdMsg2  = 'Removing old ClusterShare commands..'
	No			= 'NO'
	Yes 		= 'YES'
	DefPrt 		= '[SPL]'
	FloppyFiles = 'Copying the LANceLM product files..'	
	Selected 	= 0
	CheckingVer	= 'Checking file versions..'

	; RRQ 53194  UCF 26570905: Protocol Manager resides on disk 2 not 4
    ProtMsg     = 'If you want to install Protocol Manager, start a separate'
    ProtMsg2    = 'installation using disk 2.'
	InstCont	= '(Installation is continuing please wait...)'

	;******************************************************************	
	;                     Initialize Variables
	;******************************************************************	

	TRUE		= 1
	FALSE		= 0
	CLSTRLFS	= 2
	NotFound	= 65535
	VidLev		= 0
	DIR			= 'LANce'
	From_CTOS   = ConcatStrings(DeviceFrom,'<CTOS>')
	From_LIB    = ConcatStrings(DeviceFrom,'<LIB>')
	From_Sys	= ConcatStrings(DeviceFrom,'<Sys>')
	LANce_Cmds	= ConcatStrings(From_sys,'LANce.cmds')

	;******************************************************************	
	;       Determine where product files go, {local}{master}
	;******************************************************************	

	$Restartlabel

	$If Public 
	
		CmdFileTo	= '[Sys]<sys>Cluster.cmds'
		DestPath	= '[sys]<LANce>'
		Destpath2	= '[Sys]<Sys>'
		DefVol		= '[Sys]'

	$Else
		CmdFileTo	= '[Sys]<sys>Sys.cmds'
		DestPath	= '[sys]<LANce>'
		Destpath2	= '[Sys]<Sys>'
		DefVol		= '[Sys]'

	$EndIf

	;******************************************************************
	;                    Scroll lines on  screen
	;******************************************************************

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

	
	;******************************************************************
	;           User option to view or print release notes
	;******************************************************************

	$Restartlabel

			$If VideoLevel>0
			VidLev = 1
			$EndIf
	RIFView = UserSelectYesNo(RIFViewMsg)

	$If RIFView 
		$PauseOn
		$EchoOn
		RifFile = ConcatStrings(From_Sys,'Rif.doc')
		$Command Type, RifFile, no
			$If VidLev>0
			$EchoOff
			$EndIf
		$PauseOff
	$EndIf

	RIFPrint = UserSelectYesNo(RIFPrintMsg)

	$If RIFPrint
		PrintName = $UserEnterValue(PtrNameMsg)
		P = $ConcatStrings('[',PrintName)
		P1 = $ConCatStrings(P,']')
		RifFile = ConcatStrings(From_Sys,'Rif.doc')
			$Command copy,RIfFile,P1
	$EndIf

	;******************************************************************
	;                    Scroll lines on  screen
	;******************************************************************

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

	;******************************************************************
	;               User Select Option Installation Path
	;******************************************************************

	$Restartlabel

			$If VideoLevel>0
			VidLev = 1
			$EndIf
	i = 0
	$While (i < 10)
	i = i + 1
	$DisplayLine
	$EndWhile

	$Displayline (UserMsg1)
	$Displayline (UserMsg2)
	$Displayline
	$Displayline
	$DisplayAndWait (GoMsg)

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

	DestPath = UserEnterValue (OptionMsg1,DestPath)

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

	$Display (DirMsg)
	$Command Create directory, DestPath
	$Displayline (DoneMsg)
	$Displayline
	$Displayline
	$Displayline
	$Displayline

	;******************************************************************
	;               Delete all old ClusterShare files
	;******************************************************************
	
	$Restartlabel

	i = 0
	$While (i < 10)
	i = i + 1
	$DisplayLine
	$EndWhile
	$Path, DefVol, Sys
	$Display (DelMsg)

	$Command Delete,<sys>*clustershare.run,,
	$Command Delete,<sys>clustershareMsg.*,,
	$Command Delete,<CS>Clustershare.log
	$Command Delete,<CS>CTOS.XLA

	$Displayline (DoneMsg)

	;******************************************************************
	;                Delete old clustershare commands
	;******************************************************************

	i = 0
	$While (i < 10)
	i = i + 1
	$DisplayLine
	$EndWhile
	$DisPlay (RemCmdMsg2)

	SysCmd = Concatstrings (Destpath2,'Sys.cmds')
	ClstrCmd = Concatstrings (Destpath2,'Cluster.cmds')

	$Command Remove Command,'Install ClusterShare',SysCmd
	$Command Remove Command,'DeInstall ClusterShare',SysCmd
	$Command Remove Command,'Install ClusterShare',ClstrCmd
	$Command Remove Command,'DeInstall ClusterShare',ClstrCmd
	$Command Remove Command,'Install SMB Bridge',SysCmd
	$Command Remove Command,'DeInstall SMB Bridge',SysCmd
	$Command Remove Command,'Install SMB Bridge',ClstrCmd
	$Command Remove Command,'DeInstall SMB Bridge',ClstrCmd


	$DisPlayLine (DoneMsg)


	;******************************************************************
	;                 Files from installation disk
	;******************************************************************

	$Restartlabel

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

	$Display (FloppyFiles)

		$Path ,DeviceFrom, CTOS
	
	$Run [Sys]<sys>LCopy.run, @CE.fls,,Destpath,,y,,n
	$Run [Sys]<sys>LCopy.run, SMBPtrMap.cfg,,Destpath,,n,,y

	
	$Displayline (DoneMsg)

		$Path ,DefVol, Sys

	$Deassign (Optionmsg1)
	$Deassign (Usermsg1)
	$Deassign (UserMsg2)
	$Deassign (DirMsg)
	$Deassign (DelMsg)
	$Deassign (RemCmdMsg2)


	;******************************************************************
	;            Installation of 3 of 3
	;******************************************************************

	$Restartlabel

	MediaCheck = 2
	$PauseOff
	$Restartlabel

	$Displayline

	i = 0
	$While i < 10
		i = i + 1
		$DisplayLine
	$EndWhile

	$Display (InstCont)
	$Displayline

	
	;******************************************************************
	;                Initialize Variables
	;******************************************************************

	LocalSpec = '[sys]<sys>'
	ServerSpec = '[sys]<sys>'
	
;*****************************************************************************
; The following line defines this installation as a floppy installation.  You 
; will need to change this to [QIC]0 for tape installation.
; It is only necessary for the current Floppy Installation command when it
; is used instead of the Installation Manager command.  This will not be
; necessary in 12.1 or above.
;*****************************************************************************


;************************************************************************
;      Scroll several lines on the screen so messages look better
;************************************************************************

	i = 0
	$While i < 10
		i = i + 1
		$DisplayLine
	$EndWhile

;***************************************************************************
; Determine whether to install files to the server or to the local system
;***************************************************************************

	$If Public 
	;***************************************************************************
; public installation should write the commands to the file on the 
; server [Sys]<Sys>Cluster.cmds rather than [Sys]<Sys>Sys.cmds which
; is the default
;***************************************************************************

		DestPath = ServerSpec
		DefVol = '[Sys]'
		CmdFileTo = '[Sys]<sys>Cluster.cmds'
		ReqFile = '[sys]<sys>Request.sys'

;***************************************************************************
; if not a server or srp, the default is the local [Sys] directory
;***************************************************************************

	$Else
		DestPath = LocalSpec
		DefVol = '[Sys]'
		ReqFile = '[sys]<sys>Request.sys'
	$EndIf


;***************************************************************************
; Create a variable for [Sys]<sys> or [Sys]<Sys> depending on
; type of installation
;***************************************************************************

	DestSpec = ConcatStrings(DefVol,'<Sys>')

;***************************************************************
;                 Path to floppy 
;***************************************************************
	$Restartlabel

	$Path ,DeviceFrom, Sys

	$If VideoLevel>0
		VidLev = 1
	$EndIf



	i = 0
	$While i < 10
		i = i + 1
		$DisplayLine
	$EndWhile

;***************************************************************************
; The use of display and wait will cause a hang in attended or SWD mode so
; those conditions must be tested for.  (SWD not yet supported)
;***************************************************************************

End_of_file:

	$Deassign (RifViewMsg)
	$Deassign (RifPrintMsg)
	$Deassign (No)
	$Deassign (Yes)
	$Deassign (PtrNameMsg)

	;******************************************************************
	;   Copy LIB Files and Create LANceLM Service Commands
	;******************************************************************

	$Restartlabel

	$If Public 
			DestPath = '[sys]<LANce>'
		$Else
			DestPath = '[sys]<LANce>'
	$Endif

	;PK $Path ,DefVol,Sys
	
	i = 0
	$While (i < 10)
	i = i + 1
	$DisplayLine
	$EndWhile

	LibCopy = UserSelectYesNo(LibMsg)

		$If LibCopy

		$Display (FloppyFiles)

			File = ConcatStrings(From_LIB,'*.*')
			$Run [Sys]<sys>LCopy.run, File,,Destpath,,y,,n

		$DisplayLine (DoneMsg)

		$EndIf

	$Display (ComMsg)

	$If Public

				$Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
				LANce_cmds, CmdFileTo, yes, DefVol
		$Else
				$Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
				LANce_cmds, CmdFileTo, yes, DefVol
	$EndIf

	$Displayline (DoneMsg)

	;******************************************************************
	;              Merge request files with local requests
	;******************************************************************

	$Restartlabel

	i = 0
	$While (i < 10)
	i = i + 1
	$Displayline
	$EndWhile

	$Display (MergeMsg)
		
	CSReqFile = ConcatStrings(From_Sys,'Request.S.txt')
	NBReqFile = ConcatStrings(From_Sys,'Request.NetBIOS.txt')
	XFile =ConcatStrings(From_Sys,'Exclude.RqCodes')
	Req_Save = ConcatStrings(DestPath2,'SAVE>Request.sys')

	$Command Copy,ReqFile,Req_Save,Yes
	
	$Run [Sys]<sys>ListRqSet.run, ReqFile, [scr]<$>req.txt, ,@XFile
	$Command Make Request Set, ([scr]<$>req.txt, CSReqFile, NBReqFile), ReqFile

	$DisplayLine (DoneMsg)

	$Deassign (Req_Save)
	$Deassign (CSReqFile)
	$Deassign (NBReqFile)

	i = 0
	$While (i < 10)
	i = i + 1
	$Displayline
	$EndWhile


	;******************************************************************
	;           Installation of LANceLM 1.1 Complete
	;******************************************************************

	$Displayline (InstDoneMsg)
	$Displayline
	$Displayline
	$Displayline
	$Displayline (ProtMsg)
	$Displayline (ProtMsg2)
    $Displayline
	$Displayline
    $DisplayAndWait(GoMsg)
	
$END