;* ***************************** MODULE HEADER *************************** *;
;*                                                                         *;
;*   MACHINE: B2xB3x                             OS: BTOSCTOS            *;
;*                                                                         *;
;*   DESCRIPTION:     CTOS Forms Designer Install.jcl installation script  *;
;*					  for 3.5 and 5.25 inch floppies     				   *;
;*                                                                         *;
;*   THIS MODULE CONTAINS THE INSTALLATION JOB USED TO INSTALL THE         *;
;*   CTOS FORMS DESIGNER PRODUCT                                           *;
;*                                                                         *;
;* HISTORY:                                                                *;
;*                                                                         *;
;* MMDDYY VVVVMM   PROGRAMMER    DESCRIPTION                           *;
;*                                                                         *;
;* 100693 06040A   Tim Dooley    Modified for 6.4 release              *;
;* 063092 06030A   Tim Dooley    Modified for single JCL 3.5 and 5.25  *;
;* 111991 060300   Tim Dooley    Created                               *;
;*                                                                         *;
;* TITLE:  CTOS FORMS DESIGNER                                             *;
;*                                                                         *;
;*             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) 1993 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 FORMS DESIGNER USING INSTALLATION 
;  MANAGER.  INSTALLATION FROM FLOPPY AND SERVER ARE SUPPORTED.

JOB FORMINSTALL

PauseOff
CancelOnError

	;NATIONALIZABLE STRINGS

	DoneMsg		   = 'Done.'
	CommandMsg	   = 'Creating the Forms Designer Commands ... '
	CopyMsgP	   = 'Copying FormsEditor.Run, sFormsEditor.Run ... '
	CopyMsg1g	   = 'Copying FormsEditor.Run ... '
	CopyMsg1	   = 'Copying sFormsEditor.Run ... '
	CopyMsg2	   = 'Copying FormsReporter.Run'
	CopyMsg3	   = ' ... '
	CopyMsg4	   = ', Forms.Lib ... '
	InstallMsg	   = 'Installation complete.  '
	InstallMsg1	   = 'Installation complete.  Remove and store diskettes.'
	InstallMsg2	   = 'Resume Cluster if Disable Cluster was invoked.'
	InstallMsg3	   = 'Press any key to finish.'
	TapeMsg		   = 'Forms Designer cannot be installed from Tape.'
	UserMsg1	   = 'The Forms Designer files may be installed to any valid'
	UserMsg2	   = 'Volume and Directory, at the prompt, enter Volume'
	UserMsg3	   = 'and Directory names and then press GO, or simply'
	UserMsg4	   = 'press GO to accept the default.'	
	UserMsg5	   = 'If the specified Volume does not exist, then the'
	UserMsg6	   = 'installation will not successfully finish.'
	UserMsg7	   = 'If the specified Directory does not exist, it will'
	UserMsg8	   = 'be created for you.'
	UserPrompt	   = 'Press any key to continue.'
	EPrompt		   = 'Enter a Volume and Directory'
	Descript1	   = 'Design  Edit a Form.'
	Descript2	   = 'Produce a report describing a form and its fields.'
	Descript3	   = 'Print a form to the designated printer.'
	GraphPrompt	   = 'Do you want Forms Editor Graphics capability?'
	SelectY		   = 'Yes'
	SelectN		   = 'No'
	LibPrompt	   = 'Do you want to install the Forms runtime library?'
	FEdCommand	   = 'Forms Editor Graphics'
	sFEdCommand	   = 'Forms Editor'
	FRepCommand	   = 'FReport'
	PrintCommand   = 'Print Form'
	CopyLater1	   = 'The second diskette contains the FmrGtd.Asm,'
	CopyLater3.5   = 'This diskette contains the FmrGtd.Asm,'
	CopyLater2	   = 'FMTabKey.Asm, FmValProc.Asm files.  It also'
	CopyLater3	   = 'contains three object modules, 4.0FmChar.Obj,'
	CopyLater4	   = '4.0FmUser.Obj, and 4.0FmRun1.Obj, for configuration'
	CopyLater5	   = 'of Forms.Lib.  You may copy any of these files as you'
	CopyLater6	   = 'require them.'
	FlopInst	   = 'Unattended mode is not supported on floppy installation.'
	PressGo		   = '              Press <GO> to exit.'
	PubInst		   = 'Public installation from server is invalid.'

	;THE NEXT THREE LINES WILL BE CHANGED TO MATCH THE APPROPRIATE ENTRY
	;IN THE SYS.CMDS OR CLUSTER.CMDS FILE
	MCF			   = 'Merge Command Files'
	RC			   = 'Remove Command'
	NC			   = 'New Command'	
	
	;IF THIS NEXT LINE IS TO BE NATIONALIZED THEN THE SAME FILE ON 
	;DISKETTE 2 MUST BE CHANGED TO MATCH THIS TEXT.
	Disk2of2	   = 'Forms Designer 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		= Concatstrings(DeviceFrom, '<sys>')
	ClstrCmds		= '[Sys]<Sys>Cluster.cmds'
	Clear			= '\\0Ch'
	Scr4			= '\\0Ah\\0Ah\\0Ah\\0Ah'


	;SCROLL THE SCREEN FOUR LINES
    Display(Scr4)

	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)

	;THE USERSELECTYESNO CONSTRUCT IS USED TO ALLOW THE USER TO
	;SELECT EITHER GRAPHICS FORMS EDITOR OR NONGRAPHICS FORMS EDITOR
	  
    GraphicsYes = UserSelectYesNo(GraphPrompt, SelectN)

	Deassign(GraphPrompt)

	;THE USERSELECTYESNO CONSTRUCT IS USED TO ALLOW THE USER TO
	;CHOOSE WHETHER OR NOT TO INSTALL THE FORMS LIBRARY.

	LibYes = 255
	
    IF not Public
	  LibYes = UserSelectYesNo(LibPrompt, SelectY)
    ENDIF

	Deassign(LibPrompt)

	;THE USERENTERVALUE CONSTRUCT WILL ALLOW THE ASSIGNMENT OF
	;A VOLUME AND DIRECTORY PATH FOR THE CTOS FORMS DESIGNER SOFTWARE,
	;IF IT IS A PUBLIC INSTALLATION WE WILL FORCE IT TO [SYS]<SYS>

	IF Public
	   CmdFileTo 	= ClstrCmds
	   DefVol 		= ServerVol
	   InstallPath = ServerSpec
	   
	   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

       ContinueOnError

	   ;REMOVE THE OLD FORMS EDITOR, FREPORT,AND PRINT FORM COMMANDS

       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						sFEdCommand,			 ;CommandName
						[sys]<sys>sys.cmds,	 ;CommandFile
						No						 ;Public Command?
   
       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						FRepCommand,			 ;CommandName
						[sys]<sys>sys.cmds,	 ;CommandFile
						No						 ;Public Command?
						
       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						PrintCommand,			 ;CommandName
						[sys]<sys>sys.cmds,	 ;CommandFile
						No						 ;Public Command?
        
       ;DELETE THE OLD FORMSEDITOR.RUN, FORMSREPORTER.RUN, FORMS.LIB
       ;FORMSUNINSTALL.SUB

       DelFile = ConcatStrings(ServerSpec, 'FormsEditor.run')
       Command Delete, DelFile, N			

       DelFile = ConcatStrings(ServerSpec, 'FormsReporter.run')
       Command Delete, DelFile, N			
 
       DelFile = ConcatStrings(ServerSpec, 'Forms.Lib')
       Command Delete, DelFile, N			
 
       DelFile = ConcatStrings(ServerSpec, 'FormsUninstall.sub')
       Command Delete, DelFile, N			

       Deassign(DelFile)
                
       CancelOnError
	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
	
       ContinueOnError

	   ;REMOVE THE OLD FORMS EDITOR, FREPORT, AND PRINT FORM COMMANDS

       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						sFEdCommand,			 ;CommandName
						[sys]<sys>sys.cmds,		 ;CommandFile
						No						 ;Public Command?
 
       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						FRepCommand,			 ;CommandName
						[sys]<sys>sys.cmds,		 ;CommandFile
						No						 ;Public Command?
  
       Run ([Sys]<Sys>CmdFileEditor.run, RC, 'RC'), 
						PrintCommand,			 ;CommandName
						[sys]<sys>sys.cmds,		 ;CommandFile
						No						 ;Public Command?
         
       ;DELETE THE OLD FORMSEDITOR.RUN, FORMSREPORTER.RUN, FORMS.LIB
       ;FORMSUNINSTALL.SUB

       DelFile = ConcatStrings(PathDef, 'FormsEditor.run')
       Command Delete, DelFile, N			

       DelFile = ConcatStrings(PathDef, 'FormsReporter.run')
       Command Delete, DelFile, N			
 
       DelFile = ConcatStrings(PathDef, 'Forms.Lib')
       Command Delete, DelFile, N			
 
       DelFile = ConcatStrings(PathDef, 'FormsUninstall.sub')
       Command Delete, DelFile, N			

       Deassign(DelFile)

       CancelOnError
       	   
	   DisplayLine(UserMsg1)
	   DisplayLine(UserMsg2)
	   DisplayLine(UserMsg3)
	   DisplayLine(UserMsg4)
	   DisplayLine
	   DisplayLine(UserMsg5)
	   DisplayLine(UserMsg6)
	   DisplayLine(UserMsg7)
	   DisplayLine(UserMsg8)
	   DisplayLine
	   DisplayAndWait(UserPrompt)

	   ;CLEAR THE SCREEN
	   Display(Clear)
	   
	   InstallPath = UserEnterValue(EPrompt, PathDef)

 	   Deassign(PathDef)
 
	   Command 'Create Directory', InstallPath
	   
	   CancelOnError
 	   
	   Display(Scr4)
	ENDIF
    
	Deassign(UserMsg1)
	Deassign(UserMsg2)
	Deassign(UserMsg3)
	Deassign(UserMsg4)
	Deassign(UserMsg5)
	Deassign(UserMsg6)
	Deassign(UserMsg7)
	Deassign(UserMsg8)
	Deassign(EPrompt)
	Deassign(CmdSpec)
	Deassign(ToCmdSpec)

	IF InstallType EQ Floppy
		InstallFrom = ConcatStrings(DeviceFrom, '<Unisys>')
	ENDIF

	IF InstallType EQ FromServer
		InstallFrom = ServerSpec
	ENDIF

	Deassign(ServerSpec)

	IF InstallType EQ Tape
		DisplayLine
		DisplayLine(TapeMsg)
		DisplayLine(InstallMsg3)
		DisplayAndWait
		Cancel
	ENDIF

	Deassign(TapeMsg)
	Deassign(Tape)

	DisplayLine

	;COPY FILES FROM THE FLOPPY

	DisplayLine

	IF Public
	  Display(CopyMsgP)

	  Run [Sys]<Sys>LCopy.run, (FormsEditor.run, sFormsEditor.run), 
				  InstallFrom, InstallPath,,y,n,n,y
    ELSE
	  IF GraphicsYes = 255

		Display(CopyMsg1g)

	    Run [Sys]<Sys>LCopy.run, FormsEditor.run, 
				  InstallFrom, InstallPath,,y,n,n,y
	  ELSE
		Display(CopyMsg1)

	    Run [Sys]<Sys>LCopy.run, sFormsEditor.run, 
				  InstallFrom, InstallPath,,y,n,n,y
	  ENDIF
    ENDIF

	DisplayLine(DoneMsg)
	Display(Scr4)

	Tvar = ConcatStrings(CopyPath, 'Forms Designer Diskette 1 of 1')
	VerLev = FileVersion(TVar)
	Deassign(TVar)
	
	IF (VerLev = '0')
		IF  InstallType <> FromServer 
	  		NextFloppy(Disk2of2)
		ENDIF
	ENDIF ;This If will check to see if we have a 3.5 floppy drive.  The
		  ;3.5 floppy will have a file called FDrive>3.5 the 5.25 won't.

	Deassign(Disk2of2)
	
	Display(Scr4)
	
	Display(CopyMsg2)
	
	IF LibYes = 255
	  Display(CopyMsg4)
	ELSE
	  Display(CopyMsg3)
	ENDIF
			
	Run [Sys]<Sys>LCopy.run, FormsReporter.run, 
				  InstallFrom, InstallPath,,y,n,n,y
	
	IF LibYes = 255 
	   Run [Sys]<Sys>LCopy.run, Forms.Lib, 
				  InstallFrom, InstallPath,,y,n,n,y
    ENDIF

	Displayline(DoneMsg)

	Deassign(SelectN)	   
	Deassign(MCF)
	Deassign(RC)
	Deassign(CopyMsg1)
	Deassign(CopyMsg1g)
	Deassign(CopyMsgP)
	Deassign(CopyMsg2)
	Deassign(CopyMsg3)
	Deassign(CopyMsg4)
	Deassign(LibYes)

	;SCROLL THE SCREEN FOUR LINES
	Display(Scr4)

	;ADD THE FORMS DESIGNER COMMANDS

	Display(CommandMsg)
	Deassign(CommandMsg)
	
	InstFile = ConcatStrings(InstallPath, 'FormsEditor.Run')
	sInstFile = ConcatStrings(InstallPath, 'sFormsEditor.Run')

	IF Public
	  PubCom = 'Y'
	ELSE
	  PubCom = 'N'
	ENDIF
	
 	 IF GraphicsYes = 255
	   Run ([Sys]<Sys>CmdFileEditor.run, NC, 'AC'), 
				FEdCommand,									;Command Name
				InstFile,									;Run File
				('[File]', '[Form]', '[Graphic File]',		;Field Names
				'[Column]', '[Line]'),						;Field Names
				Descript1,									;Description	
				Yes,,									   ;Overwrite
				CmdFileTo,									;Command File
				PubCom										;Public Command;
	 ELSE
	  Run ([Sys]<Sys>CmdFileEditor.run, NC, 'AC'), 
				sFEdCommand,								;Command Name
				sInstFile,									;Run File
				('[File]', '[Form]'),						;Field Names
				Descript1,									;Description	
				Yes,,									   ;Overwrite
				CmdFileTo,									;Command File
   				PubCom,										;Public Command;
     ENDIF

	InstFile = ConcatStrings(InstallPath, 'FormsReporter.Run')

	Run ([Sys]<Sys>CmdFileEditor.run, NC, 'AC'), 
				FRepCommand,								;Command Name
				InstFile,									;Run File
				('File', '[Form]', '[Fields]',			
				'[Form Image]', '[Output]'),				;Field Names
				Descript2,									;Description	
				Yes,,									   ;Overwrite
				CmdFileTo,									;Command File
				PubCom										;Public Command;

	Run ([Sys]<Sys>CmdFileEditor.run, NC, 'AC'), 
				PrintCommand,								;Command Name
				InstFile,									;Run File
				('File', '[Form]',						
				'[Queue Name (default = SPL)]'),			;Field Names
				Descript2,									;Description	
				Yes,									   ;Overwrite
				'01',										;Command Case
				CmdFileTo,									;Command File
				PubCom										;Public Command;

	DisplayLine(DoneMsg)

	Deassign(NC)
	Deassign(Descript1)
	Deassign(Descript2)
	Deassign(Descript3)
	Deassign(InstFile)

	IF not (InstallType = FromServer)
	  Display(Scr4)
	  
	  IF (VerLev = '0')
	  	DisplayLine(CopyLater1)
	  ELSE
	    DisplayLine(CopyLater3.5)
	  ENDIF
	  
	  DisplayLine(CopyLater2)
	  DisplayLine(CopyLater3)
	  DisplayLine(CopyLater4)
	  DisplayLine(CopyLater5)
	  DisplayLine(CopyLater6)

	  Display(Scr4)
	ENDIF
	
	Deassign(CopyLater1)
	Deassign(CopyLater2)
	Deassign(CopyLater3)
	Deassign(CopyLater4)
	Deassign(CopyLater5)
	Deassign(CopyLater6)

	IF InstallType = FromServer
	    Display(Scr4)

		DisplayLine(InstallMsg)
		Deassign(InstallMsg)
	ELSE
		DisplayLine(InstallMsg1)
		Deassign(InstallMsg1)
	ENDIF

	DisplayLine(InstallMsg2)
	Deassign(InstallMsg2)

	DisplayAndWait(InstallMsg3)
	Deassign(InstallMsg3)

	Display(Scr4)

	PauseOn

End
