;* ***************************** MODULE HEADER *************************** *;
;*                                                                         *;
;*   MACHINE: B2xB3x                             OS: BTOSCTOS            *;
;*                                                                         *;
;*   DESCRIPTION:     CTOS OFIS Organizer JCL installation script          *;
;*                                                                         *;
;*   THIS MODULE CONTAINS THE INSTALLATION JOB USED TO INSTALL THE         *;
;*   CTOS OFIS ORGANIZER PRODUCT                                           *;
;*                                                                         *;
;* HISTORY:                                                                *;
;*                                                                         *;
;* MMDDYY VVVVMM   PROGRAMMER    DESCRIPTION                           *;
;*                                                                         *;
;* 050692 021B08   B. Burkhardt  Fixed CMDefault for Public Install    *;
;* 050692 021B07   B. Burkhardt  Changed Public installation command   *;
;*								    file from Sys.cmds to Cluster.cmds and*;
;*								    Server install from path from <sys>   *;
;*								    directory to <Organizer> directory.   *;
;* 050592 021B06   Tim Dooley    Fixed Erc 215 when doing Server       *;
;*								    Installation.						   *;
;* 050592 021B05   B. Burkhardt  Now copy Organizer.cmds to server if  *;
;*								    a Public installation.				   *;
;* 050492 021B04   Tim Dooley    Added faster screen scroll mechanism. *;
;* 042992 021B03   B. Burkhardt  Use ServerSpec instead of InstallPath *;
;* 042992 021B02   B. Burkhardt  Removed Deassign(ServerSpec) from     *;
;*								    line 227.  						   *;
;* 041692 021B01   Tim Dooley    Added Rebuild help file installation  *;
;* 032092 021000   Tim Dooley    Created                               *;
;*                                                                         *;
;* TITLE:  CTOS OFIS ORGANIZER                                             *;
;*                                                                         *;
;*             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 PATENT DIVISION OF UNISYS          *;
;* CORPORATION, DETROIT, MICHIGAN 48232, USA.                              *;
;*                                                                         *;
;* COPYRIGHT (C) 1992 UNISYS CORPORATION                                   *;
;*                                                                         *;
;* UNISYS BELIEVES THAT THE SOFTWARE FURNISHED HEREWITH IS ACCURATE AND    *;
;* RELIABLE, AND MUCH CARE HAS BEEN TAKEN IN ITS PREPARATION.  HOWEVER,    *;
;* NO RESPONSIBILITY, FINANCIAL OR OTHERWISE, CAN BE ACCEPTED FOR ANY      *;
;* CONSEQUENCES ARISING OUT OF THE USE OF THIS MATERIAL, INCLUDING LOSS OF *;
;* PROFIT, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES, THERE ARE NO       *;
;* WARRANTIES WHICH EXTEND BEYOND THE PROGRAM SPECIFICATION.               *;
;*                                                                         *;
;* THE CUSTOMER SHOULD EXERCISE CARE TO ASSURE THAT USE OF THE SOFTWARE    *;
;* WILL BE IN FULL COMPLIANCE WITH LAWS, RULES AND REGULATIONS OF THE      *;
;* JURISDICTIONS WITH RESPECT TO WHICH IT IS USED.                         *;
;*                                                                         *;
;* ************************* END OF MODULE HEADER ************************ *;

;  THIS IS AN INSTALLATION OF THE CTOS OFIS ORGANIZER USING INSTALLATION 
;  MANAGER.  INSTALLATION FROM FLOPPY AND SERVER ARE SUPPORTED.

JOB ORGINSTALL

PauseOff
CancelOnError

	;NATIONALIZABLE STRINGS

	TapeMsg		   = 'OFIS Organizer cannot be installed from Tape.'
	DoneMsg		   = 'done.'
	FlopInst	   = 'Unattended mode is not supported on floppy installation.'
	PressGo		   = '              Press <GO> to exit.'
	PubInst		   = 'Public installation from server is invalid.'
	CreateMsg	   = 'Creating Organizer directory .......................... '
	CopyMsg1	   = 'Copying OM.run, OM_Reminder.run, OM_DiReminder.run .... '
	CopyMsg2 	   = 'Copying OM_Text.sys, OM_Data.sys ...................... '
	CopyMsg3	   = 'Copying OM_Caln.hlp, OM_Note.hlp, OM_Calc.hlp ......... '
	CopyMsg4	   = 'Copying OM_PhDr.hlp, OM_PhMg.hlp, OM_Scrt.hlp ......... '
	CopyMsg5	   = 'Copying OM_Edit.hlp, OM_ToDo.hlp, OM_Rbld.hlp ......... '
	CopyMsg6	   = 'Copying OM_SendService.run, OM_DiSendService.run ...... '
	CopyMsg7	   = 'Copying Request.OMSend.txt, mRequest.OMSend.txt ....... '
	CommandMsg	   = 'Creating the OFIS Organizer Commands .................. '
	InstallMsg	   = 'Installation complete.  '
	InstallMsg1	   = 'Installation complete.  Remove and store diskettes.'
	InstallMsg2	   = 'Resume Cluster if Disable Cluster was invoked.'
	InstallMsg3	   = 'Reboot the system to complete installation.'
	InstallMsg4	   = 'Press any key to finish.'
	UserPrompt	   = 'Press any key to continue.'
	ReqMsg		   = 'Merging OFIS Organizer request codes .................. '
	Add1		   = 'To update your Context Manager configuration'
	Add2		   = 'file, select YES.  To continue with the'
	Add3		   = 'installation select NO.'
	YorNPrompt	   = 'Do you want to update your Context Manager config file?'
	Default		   = 'YES'
	Blank		   = '          '
	CM1			   = 'Enter the name of the Context Manager'
	CM2			   = 'configuration file which is to be updated,'
	CM3			   = 'then press <GO>, or simply press <GO> to'
	CM4			   = 'accept the default of [Sys]<sys>CMConfig.sys.'
	CMPrompt	   = 'Enter the CM filename to be updated'
	CMDefault	   = '[Sys]<Sys>CMConfig.sys'
	AddToCM		   = 'Updating Context Manager configuration file ........... '
    	
	;THE NEXT FOUR LINES WILL BE CHANGED TO MATCH THE APPROPRIATE ENTRY
	;IN THE SYS.CMDS OR CLUSTER.CMDS FILE

	MCF			   = 'Merge Command Files'
	LRS			   = 'List Request Set'
	MRS			   = 'Make Request Set'
	
	;IF THIS NEXT LINE IS TO BE NATIONALIZED THEN THE SAME FILE ON 
	;DISKETTE 2 MUST BE CHANGED TO MATCH THIS TEXT.

	Disk2of2	   = 'OFIS Organizer Diskette 2 of 2'

	;NATIONALIZATION OF THIS SCRIPT ENDS HERE
	
	;VARIABLE INITIALIZATION  DO NOT NATIONALIZE

	Floppy			= 0
	Tape			= 1
	FromServer		= 2
	ClientVol		= '[Sys]'
	ServerVol		= '[Sys]'
	ClientSpec		= '[Sys]<Sys>'
	ServerSpec		= '[Sys]<Sys>'
	CopyPath		= '[B20OM21]<sys>'	
	ClstrCmds		= '[Sys]<Sys>Cluster.cmds'

	;SCROLL THE SCREEN FOUR LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	IF Unattended AND (InstallType = Floppy)
		
		DisplayLine
		DisplayLine
		DisplayLine('  AE ', FlopInst, ' AA')
		Displayline('  AE ', PressGo,'                         AA')
		DisplayLine
		DisplayLine
		DisplayAndWait

		Cancel
		
	ENDIF

	SvrSysType = FileVersion('[Sys]<Sys>SysImage.sys')
	ClstrSysType = FileVersion('[Sys]<Sys>SysImage.sys')

	IF (InstallType = FromServer) AND (Public OR (SvrSysType = ClstrSysType))
		
		DisplayLine
		DisplayLine
		Displayline('  AE ', PubInst, ' AA')
		Displayline('  AE ', PressGo, '           AA')
		DisplayLine
		DisplayLine
		DisplayAndWait
		
		Cancel
		
	ENDIF

	Deassign(SvrSysType)
	Deassign(ClstrSysType)
	Deassign(PubInst)
    Deassign(PressGo)
	Deassign(FlopInst)

	If Public
	   CmdFileTo 	= ClstrCmds
	   DefVol 		= ServerVol
	
	   Run [Sys]<Sys>LCopy.run, Organizer.cmds, 
					 [B20OM21]<Sys>, [Sys]<Installed>,,y,n,n,y
   
	   CmdSpec = ConcatStrings(CopyPath, 'Install>English.cmds')
   	   ToCmdSpec = ConcatStrings(ServerSpec, 'Install>English.cmds')

	   Run ([Sys]<Sys>CmdFileEditor.run, MCF, 'MC'), 
						CmdSpec,				 ;File From
						ToCmdSpec,			  	 ;FileTo
						No						  ;Overwrite

	Else
	   PathDef 		= '[Sys]<sys>'
	   DefVol 		= ClientVol
	   
	   ContinueOnError

	   IF InstallType = FromServer
		  CopyPath = ServerSpec
		  
       EndIf
		  
	   CmdSpec = ConcatStrings(CopyPath, 'Install>English.cmds')
   	   ToCmdSpec = ConcatStrings(PathDef, 'Install>English.cmds')

	   Run ([Sys]<Sys>CmdFileEditor.run, MCF, 'MC'), 
						CmdSpec,				 ;File From
						ToCmdSpec,			  	 ;FileTo
						No						 ;Overwrite
	
       CancelOnError
       	   
	   DisplayLine
	   DisplayLine

	EndIf

    If Public or 
      InstallPath = '[Sys]<Organizer>'
    Else
      InstallPath = '[Sys]<Organizer>'
    EndIf

	Display(CreateMsg)

	Command 'Create Directory', InstallPath, , 1000
    
    DisplayLine(DoneMsg)
    DisplayLine
	DisplayLine

	If InstallType EQ Floppy
		InstallFrom = ConcatStrings(DeviceFrom, '<Unisys>')
	Endif

	If InstallType EQ FromServer
		InstallFrom = '[Sys]<Organizer>'
	Endif

	If InstallType EQ Tape
		DisplayLine
		DisplayLine(TapeMsg)
		DisplayLine(InstallMsg4)
		DisplayAndWait
		Cancel
	Endif

	Deassign(TapeMsg)
	Deassign(Tape)

	DisplayLine

	;ADD THE OFIS ORGANIZER COMMANDS

	Display(CommandMsg)
	Deassign(CommandMsg)

    If Public
       ToCmdSpec  = ClstrCmds
       DestVol    = '[Sys]'
    Else
       ToCmdSpec  = '[Sys]<sys>Sys.cmds'
       DestVol    = '[Sys]'
    EndIf
    
    If (InstallType = FromServer)

	  Run ([Sys]<Sys>CmdFileEditor.run, MCF, 'MC'),	
				   [Sys]<Installed>Organizer.cmds,	 ;File From
				   ToCmdSpec,						 ;FileTo
				   Yes,								 ;Overwrite
				   DestVol							  ;Destination Volume

	Else

	   Run ([Sys]<Sys>CmdFileEditor.run, MCF, 'MC'),	
				   [B20OM21]<Sys>Organizer.cmds,	 ;File From
				   ToCmdSpec,						 ;FileTo
				   Yes,								 ;Overwrite
				   DestVol							  ;Destination Volume

    EndIf

	Display(DoneMsg)				   
	Deassign(DestVol)			   

	;SCROLL THE SCREEN FOUR LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	;COPY FILES FROM THE FLOPPY

	Display(CopyMsg1)

	Run [Sys]<Sys>LCopy.run, (OM.run, OM_Reminder.run, OM_DiReminder.run),
							 InstallFrom, InstallPath,,y,n,n,y

	DisplayLine(DoneMsg)
	DisplayLine
	DisplayLine
    Display(CopyMsg2)

	 Run [Sys]<Sys>LCopy.run, (OM_Data.sys, OM_Text.sys), InstallFrom, 
	 						  InstallPath,,y,n,n,y

	DisplayLine(DoneMsg)
	DisplayLine
	DisplayLine
    Display(CopyMsg3)

	 Run [Sys]<Sys>LCopy.run, (OM_Caln.hlp, OM_Note.hlp, OM_Calc.hlp), 
							  InstallFrom, InstallPath,,y,n,n,y

	DisplayLine(DoneMsg)
	DisplayLine
	DisplayLine
    Display(CopyMsg4)
	 
	Run [Sys]<Sys>LCopy.run, (OM_PhDr.hlp, OM_PhMg.hlp, OM_Scrt.hlp), 
							  InstallFrom, InstallPath,,y,n,n,y

	DisplayLine(DoneMsg)
	DisplayLine
	DisplayLine
    Display(CopyMsg5)
	 
	Run [Sys]<Sys>LCopy.run, (OM_Edit.hlp, OM_ToDo.hlp, OM_Rbld.hlp), 
							  InstallFrom, InstallPath,,y,n,n,y

	DisplayLine(DoneMsg)
	DisplayLine
	DisplayLine

	If  InstallType <> FromServer 
	  NextFloppy(Disk2of2)
	EndIf

	Deassign(Disk2of2)
	
	DisplayLine
	DisplayLine
	Display(CopyMsg6)
	
	Run [Sys]<Sys>LCopy.run, (OM_SendService.run, OM_DiSendService.run), 
							 InstallFrom, InstallPath,,y,n,n,y

	Displayline(DoneMsg)
	DisplayLine
	DisplayLine
	Display(CopyMsg7)
	
	Run [Sys]<Sys>LCopy.run,(mRequest.OMSend.txt, Request.OMSend.txt), 
							InstallFrom, InstallPath,,y,n,n,y

	Display(DoneMsg)
	
	Deassign(CopyMsg1)
	Deassign(CopyMsg2)
	Deassign(CopyMsg3)
	Deassign(CopyMsg4)
	Deassign(CopyMsg5)
	Deassign(CopyMsg6)

	;SCROLL THE SCREEN FOUR LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah)

    If (SRPServer = 255) and ((Public) or (SystemType <> 2))
      
      ReqFile = 'mRequest.OMSend.txt'
	  ReqSys = ConcatStrings(ServerSpec, 'Request.sys')
        
    Else
      
      ReqFile = 'Request.OMSend.txt'
	  ReqSys = ConcatStrings(ClientSpec, 'Request.sys')
        
    EndIf
      
    Display(ReqMsg)
    
    ReqTxt = ConcatStrings(InstallPath, ReqFile)
    
    ReqSet = '[Scr]<$>ReqSet.tmp'
    
    ReqTmp = '[Scr]<$>ReqTmp.tmp'
    
	Run ([Sys]<Sys>MakeRqSet.run, MRS, '00'), ReqTxt, ReqSet
	
	Run ([Sys]<Sys>ListRqSet.run, LRS, '01'), (ReqSet, ReqSys), ReqTmp
	
	Run ([Sys]<Sys>MakeRqSet.run, MRS, '00'), ReqTmp, ReqSys

	Display(DoneMsg)
	DisplayLine
	DisplayLine

    Command Delete, (ReqSet, ReqTmp), N

	Deassign(ReqSet)
	Deassign(Reqfile)
	Deassign(ReqTxt)
	Deassign(ReqTmp)
	
	;SCROLL THE SCREEN 32 LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	Display(Blank)
    DisplayLine(Add1)
    Display(Blank)
    DisplayLine(Add2)
    Display(Blank)
    DisplayLine(Add3)
    DisplayLine
    DisplayLine

    YesOrNo = UserSelectYesNo(YorNPrompt, Default)
    
    ;SCROLL THE SCREEN 32 LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	If YesOrNo = 255

	  Display(Blank)
	  DisplayLine(CM1)
	  Display(Blank)
	  DisplayLine(CM2)
	  Display(Blank)
	  DisplayLine(CM3)
	  Display(Blank)
	  DisplayLine(CM4)
	  DisplayLine

	  If Public 
		CMDefault = '[Sys]<Sys>CMConfig.sys'
	  EndIf

	  CMFile = UserEnterValue(CMPrompt, CMDefault)

	  ;SCROLL THE SCREEN 32 LINES
	  Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	  Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	  Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)
	  Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	  DisplayLine(AddToCM)

	  ;SCROLL THE SCREEN FOUR LINES
	  Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah)

      CMAdd = ConcatStrings(InstallPath, 'OM.run')
    
      Command 'CM Add Application', CMFile, 'OFIS Organizer', CMAdd, 
      							    500,,,,,,,,,,Y,Y
    
    EndIf

	;SCROLL THE SCREEN 32 LINES
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah) 
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)
	Display(\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah,\\0Ah)

	If InstallType = FromServer
		DisplayLine(InstallMsg)
		Deassign(InstallMsg)
	Else
		DisplayLine(InstallMsg1)
		Deassign(InstallMsg1)
	Endif

	DisplayLine(InstallMsg2)
	Deassign(InstallMsg2)
	DisplayLine
	DisplayLine('  AE ',InstallMsg3, ' AA')
	DisplayLine
	DisplayAndWait(InstallMsg4)
	Deassign(InstallMsg4)

	DisplayLine
	DisplayLine

	PauseOn

End
