;*****************************************************************************.
;                    ***  PROPRIETARY PROGRAM MATERIAL  ***                    
; ***                                                                     ***  
; * This material is proprietary to Unisys Corporation and is not to be     *  
; * reproduced, used or disclosed except in accordance with program license *  
; * or upon written authorization of the general counsel, Office of General *  
; * Counsel, Unisys Corporation, Blue Bell, PA  19424, USA                  *  
; ***                                                                     ***  
;                 * COPYRIGHT (C) 1994 UNISYS CORPORATION *                    
;                          All Rights Reserved.
;                          UNISYS PROPRIETARY                  
;
;   This is a the Install.jcl file for CTOS VT220 Emulator 
;   Author for this JCL script file is:
;                  
;                  UNISYS
;                  Round Valley Development Center
;                  Lebanon, New Jersey
;
;
;*    Note:                                                                   *
;*                                                                            *
;*    This file name is <Sys>Install.Jcl                                      *
;*    This must be present in [B25VTE]<Sys>                                   *
;*    This file works in conjunction with the file [B25VTE]<Sys>Install.ctrl. *
;*    THIS FILE WAS CREATED ON 111190                                       *
;*                  LAST MODIFIED ON 940307  DAA                             *
;*    You do not need to check volume status or partition status.;            *
;*    Installation Manager has already done that before it begins to execute  *
;*    this ;file.  It is also not necessary to ask the user to disable the    *
;*    cluster.  It is done within the jcl file.                               *
;*                                                                            *
;*    The $ before the commands is now optional so they are used randomly     *
;*    within this file.                                                       *
;*                                                                            *
;*    This is a floppy install of CTOS VT 220 Emulator.                       *
;*    Tape install not supported                                              *
;*    Server and Unattended mode now supported                                *
;*                                                                            *
;******************************************************************************

Job Install

EchoOff

FLOPPY     = 0
SERVER     = 2
SWD        = 4

;put a restart point here in case the installation fails

RestartLabel

		
PauseOff

;****************************************************************************
; THE FOLLOWING STRINGS SHOULD BE NATIONALISED.  Also nationalise all the 
; commands used with Command in this file.  These commands are in uppercase
; for easy identification.  These commands are TYPE, COPY, LCOPY, APPEND,
; CREATE DIRECTORY, LIST REQUEST SET, and MAKE REQUEST SET.	
;****************************************************************************

RNMsg       = 'Do you wish to view the Release Notes'
VolNameMsg  = 'Destination Volume'
;VolNameMsg  = 'Volume name to which files are to be copied'  DELETED too long
RNViewMsg   = 'Do you wish to view the ReleaseNotes now ?'
RNPrintMsg  = 'Do you wish to print the ReleaseNotes ?'
PtrNameMsg  = 'Enter the printer name with [ ]'
PtrName     = '[Lpt]'
DirName     = '<CtVt>'
CommandMsg  = 'Creating CTOS VT220 Emulator commands ...'
DoneMsg     = ' done.'
FloppyMsg   = 'Copying files from floppy ...'
InstDoneMsg = '                   Installation is completed'
DirMsg      = 'Creating Directory '


RCmdFile    = '[sys]<Installed>'

; VideoLevel = 1

; Installation starts here

; Scroll several lines on the screen so messages look better

	i = 0
	While i < 25
		i = i + 1
		DisplayLine
	EndWhile


;
; notify ADMIN of installation.  To notify all the users, use the
; Broadcast.  Please see the documentation for the differences
;	
;	Sendmail(admin,MailMsg)
;	BroadcastMessage(MailMsg)
;

;
; determine whether to install files to the server or to the local system
; please pick and choose what you will need from this section since you 
; will probably not need all the file identifications.
; 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

IF PUBLIC and (InstallType <> Server)
	DestPath   = '[Sys]<Sys>'
	DefVol     = '[Sys]'
	CmdFileTo  = '[Sys]<sys>Cluster.cmds'
ELSE
	DestPath   = '[Sys]<Sys>'
	DefVol     = '[Sys]'
	CmdFileTo  = '[Sys]<sys>Sys.cmds'
ENDIF


VolName     = DefVol;

VolIDirPre   = ConcatStrings(VolName, 
                                 '<Installed>CTOSVT220Emulator>R2.2.00>')


;
IF (InstallType = FLOPPY)


;added this to put ReleaseNotes.doc, etc in <Installed> directory
; so that files are available for all Installtypes.


DisplayLine
DisplayLine

EchoOn

IF  PUBLIC
	Command LCopy,  
	([B25VTE]<Sys>Install.Jcl, [B25VTE]<Sys>Install.Ctrl, 	[B25VTE]<Sys>Install.cmds, [B25VTE]<Sys>ReleaseNotes.doc), 
	, 
	VolIDirPre, 
	, 
	Yes
ENDIF

EchoOff 

DisplayLine
DisplayLine


IF (Unattended = 0)

VolName = UserEnterValue(VolNameMsg,DefVol)

RNView  = UserSelectYesNo(RNViewMsg)

IF RNView
	i = 0
	While i < 25
		i = i + 1
		DisplayLine
	EndWhile

   PauseOn
   EchoOn

	IF PUBLIC
	   TargetFile   = ConcatStrings(VolIDirPre, 'ReleaseNotes.Doc')
	   $Command COPY, TargetFile, [vid],yes,no
	ELSE
	   $Command COPY, [B25VTE]<Sys>ReleaseNotes.Doc, [vid],yes,no
	ENDIF

   PauseOff
   EchoOff
   i = 0
   While i < 25
		i = i + 1
		DisplayLine
   EndWhile
ENDIF


RNPrint  = UserSelectYesNo(RNPrintMsg)

IF RNPrint
   PtrName = UserEnterValue(PtrNameMsg,PtrName)
   IF PUBLIC
	   Command Copy, TargetFile, PtrName,Yes
   ELSE
	   Command Copy, [B25VTE]<Sys>ReleaseNotes.Doc, PtrName,Yes
   ENDIF
   PauseOff
ENDIF


ENDIF; (Unattended = 0)

RestartLabel

DirName  = ConcatStrings(VolName, DirName)
DirMsg   = ConcatStrings(DirMsg, DirName)
DirMsg   = ConcatStrings(DirMsg, ' ... ')
Display (DirMsg)
Command Create Directory,DirName,,100
DisplayLine (Donemsg)

DisplayLine
DisplayLine

;Display (FloppyMsg)
EchoOn

Command LCopy, 
(Vt.Run, CtVt.Font, CtVt640x480_80.Font, CtVtB27.Font, CtVtAGP.Font, LetterO.Fks, Vt.Colour, VtComms.Default, X25Config.Default, Vt.ColourVTE, Vt.ColourANSI, Vt.ColourVGAANSI, VtMsg.Bin, Kbd.Sys, CTOSKbd.Sys, K6sKbd.Sys, PS2Kbd.Sys, SG1KKbd.Sys, VtHlp0.form, VtHlp1.form, VtHlp2.form, VtHlp3.form, VtHlp4.form, VtHlp5.form, VtHlp6.form, VtHlp7.form, VtHlp8.form, VtHlp9.form, VtConfig1.form, VtConfig2.form, VtConfig3.form, VtFks1.Form, VtFks2.Form, VtTransfer1.Form, VtPKeys1.Form, VtKermit.form, VtPath.Form, VtFT1.form, VtXmodem.form, SG1K.kbd.tbl), 
[B25VTE]<CTOS>, 
DirName, 
, 
Yes

EchoOff 
;DisplayLine (Donemsg)

RestartLabel

		
PauseOff

DisplayLine
DisplayLine


;
; UPDATE COMMAND FILES ON THE SYSTEM BASED ON THE CHOICE MADE BY THE USER
; 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

;Display(CommandMsg)
EchoOn

RestartLabel

IF PUBLIC
	  Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
      [sys]<Installed>CTOSVT220Emulator>R2.2.00>Install.cmds, CmdFileTo, 
      yes, VolName
ELSE
	  Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
      [B25VTE]<Sys>Install.cmds, CmdFileTo, 
      yes, VolName
ENDIF
EchoOff      
;DisplayLine (Donemsg)


Endif  ; floppy install
;


;
IF (InstallType = SERVER)


IF (Unattended = 0)

VolName = UserEnterValue(VolNameMsg,DefVol)

RNView  = UserSelectYesNo(RNViewMsg)

IF RNView
	i = 0
	While i < 25
		i = i + 1
		DisplayLine
	EndWhile

   PauseOn
   EchoOn
   $Command COPY, 
            [Sys]<Installed>CTOSVT220Emulator>R2.2.00>ReleaseNotes.Doc, 
            [vid],yes,no
   PauseOff
   EchoOff
   i = 0
   While i < 25
		i = i + 1
		DisplayLine
   EndWhile
ENDIF


RNPrint  = UserSelectYesNo(RNPrintMsg)

IF RNPrint
   PtrName = UserEnterValue(PtrNameMsg,PtrName)
   Command Copy, 
           [Sys]<Installed>CTOSVT220Emulator>R2.2.00>ReleaseNotes.Doc, 
           PtrName,Yes
   PauseOff
ENDIF


ENDIF; (Unattended = 0)


RestartLabel

DirName  = ConcatStrings(VolName, DirName)
DirMsg   = ConcatStrings(DirMsg, DirName)
DirMsg   = ConcatStrings(DirMsg, ' ... ')

Display (DirMsg)
Command Create Directory,DirName,,100
DisplayLine (Donemsg)

DisplayLine
DisplayLine

EchoOn

Command LCopy, 
(Vt.Run, CtVt.Font, CtVt640x480_80.Font, CtVtB27.Font, CtVtAGP.Font, LetterO.Fks, Vt.Colour, VtComms.Default, X25Config.Default, Vt.ColourVTE, Vt.ColourANSI, Vt.ColourVGAANSI, VtMsg.Bin, Kbd.Sys, CTOSKbd.Sys, K6sKbd.Sys, PS2Kbd.Sys, SG1KKbd.Sys, VtHlp0.form, VtHlp1.form, VtHlp2.form, VtHlp3.form, VtHlp4.form, VtHlp5.form, VtHlp6.form, VtHlp7.form, VtHlp8.form, VtHlp9.form, VtConfig1.form, VtConfig2.form, VtConfig3.form, VtFks1.Form, VtFks2.Form, VtTransfer1.Form, VtPKeys1.Form, VtKermit.form, VtPath.Form, VtFT1.form, VtXmodem.form, SG1K.kbd.tbl), 
[Sys]<CtVt>, 
DirName, 
, 
Yes

EchoOff 

DisplayLine
DisplayLine

RestartLabel

		
PauseOff



;Display(CommandMsg)

RCmdFile   = ConcatStrings(RCmdFile, 'CTOSVT220Emulator>')
RCmdFile   = ConcatStrings(RCmdFile, 'R2.2.00>')
RCmdFile   = ConcatStrings(RCmdFile, 'Install.cmds')
;DisplayAndWait

EchoOn
Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
      RCmdFile, 
      CmdFileTo, yes, VolName

EchoOff      
;DisplayLine (Donemsg)



ENDIF ;(InstallType = SERVER)
;

;
;
IF (InstallType = SWD)

RestartLabel
EchoOff      


;The temporary directory used for mailing has all the <CtVt> files as well as 
;the jcl, ctrl, cmds, and .doc files. So we first copy the latter to the 
;[sys]<Installed> directory on server. Then create <CtVt> directory on server 
;and copy CtVtfls files to it. 
;Erasing the temp directory is determined by admin and SWD via BMail.


Command LCopy,  
(Install.Jcl, Install.Ctrl, Install.cmds, ReleaseNotes.doc), 
DeviceFrom, 
[sys]<Installed>CTOSVT220Emulator>R2.2.00>, 
, 
Yes

DirName  = ConcatStrings(VolName, DirName)
Command Create Directory,DirName,,100

Command LCopy, 
(Vt.Run, CtVt.Font, CtVt640x480_80.Font, CtVtB27.Font, CtVtAGP.Font, LetterO.Fks, Vt.Colour, VtComms.Default, X25Config.Default, Vt.ColourVTE, Vt.ColourANSI, Vt.ColourVGAANSI, VtMsg.Bin, Kbd.Sys, CTOSKbd.Sys, K6sKbd.Sys, PS2Kbd.Sys, SG1KKbd.Sys, VtHlp0.form, VtHlp1.form, VtHlp2.form, VtHlp3.form, VtHlp4.form, VtHlp5.form, VtHlp6.form, VtHlp7.form, VtHlp8.form, VtHlp9.form, VtConfig1.form, VtConfig2.form, VtConfig3.form, VtFks1.Form, VtFks2.Form, VtTransfer1.Form, VtPKeys1.Form, VtKermit.form, VtPath.Form, VtFT1.form, VtXmodem.form, SG1K.kbd.tbl), 
DeviceFrom, 
DirName, 
, 
Yes

RCmdFile   = ConcatStrings(RCmdFile, 'CTOSVT220Emulator>')
RCmdFile   = ConcatStrings(RCmdFile, 'R2.2.00>')
RCmdFile   = ConcatStrings(RCmdFile, 'Install.cmds')

      Run ([Sys]<Sys>CmdFileEditor.run,, 'MC'), 
           RCmdFile, CmdFileTo, yes, VolName

ENDIF ;(InstallType = SWD)
;


IF (InstallType <> SWD)
;
; make some space on the screen so the message is more noticable
;
	i = 0
	While (i < 15)
		i = i + 1
		DisplayLine
	EndWhile

	Displayline (InstDoneMsg)

	i = 0
	While (i < 8)
		i = i + 1
		DisplayLine
	EndWhile

ENDIF ;(InstallType <> SWD)



END