; IDMSS>Install.Jcl
; Install the IDMSS subpackage

FirstDisk    = 'IDMSS Software Diskette 1'
SecondDisk   = 'IDMSS Software Diskette 2'
DefaultYes   = 'Yes'
DefaultNo    = 'No'
SelYes       = 255

Msg1 = 'Copying files ...'
Msg2 = 'done.'
Msg3 = 'Merging requests ...'
Msg4 = 'Installing from floppy.'
Msg5 = 'Do you wish to support a LAN (Ethernet andor Token Ring) module?'
Msg6 = 'Do you wish to support an ISDN module?'
Msg7 = 'The Software Release Announcement (SRA) can be found in'
Msg8 = 'Continuing ...'
Msg9 = 'Do you wish to support an IDS andor ID2 module?'
Msg10= 'Please select your installation media type'
Msg11= 'Would you like the SRA copied to your hard disk?'
Msg12= 'The SRA was copied to'
Msg13= '3 inch floppy'
Msg14= '5 inch floppy'

FromFloppy   = 0
FromServer   = 2

ver = FileVersion('[Sys]<Sys>InstallMgr.Run')
If SubString('12.0', ver) <> 65535
	DirectoryTo = '<Sys>'
	If Public
		VolumeTo = '{Master}[Sys]'
	Else
		VolumeTo = '[Sys]'
	EndIf
	If InstallType = FromServer
		MsgFile = '{Master}[Sys]<Installed>IDMSS>5.2.0>InstallMsg.Bin'
	Else
		MsgFile = '[Scr]<$>InstallMsg.Bin'
	EndIf

EndIf

FromSpec     = ConcatStrings(DeviceFrom, '<Unisys>')
FromSpecSys  = ConcatStrings(DeviceFrom, '<Sys>')
ToSpec       = ConcatStrings(VolumeTo, DirectoryTo)
ServerSpec   = ConcatStrings(DeviceFrom, DirectoryTo)

ReqBinFile   = ConcatStrings(ToSpec, 'Request.Sys')
ReqTxtFile   = ConcatStrings(ToSpec, 'Request.IDMSS.Txt')

IDMImgFrom   = ConcatStrings(FromSpec, 'IDM>SysImage.Sys')
IDMImgTo     = ConcatStrings(ToSpec, 'IDM>SysImage.Sys')
IDMImgFSvr   = ConcatStrings(ServerSpec, 'IDM>SysImage.Sys')

LANImgFrom   = ConcatStrings(FromSpec, 'LAN>SysImage.Sys')
LANImgTo     = ConcatStrings(ToSpec, 'LAN>SysImage.Sys')
LANImgFSvr   = ConcatStrings(ServerSpec, 'LAN>SysImage.Sys')

ISDNImgFrom  = ConcatStrings(FromSpec, 'ISDN>SysImage.Sys')
ISDNImgTo    = ConcatStrings(ToSpec, 'ISDN>SysImage.Sys')
ISDNImgFSvr  = ConcatStrings(ServerSpec, 'ISDN>SysImage.Sys')

SRADocFrom   = ConcatStrings(FromSpec, 'IDMSS>SRA.Doc')
SRADocTo     = ConcatStrings(ToSpec, 'IDMSS>SRA.Doc')
SRADocFSvr   = ConcatStrings(ServerSpec, 'IDMSS>SRA.Doc')

If InstallType = FromFloppy
    NextFloppy(FirstDisk)
    EndIf

Command Merge Command Files        ,
          CmdFileFrom              ,
          CmdFileTo                ,
          Yes                      ,
          VolumeTo

If InstallType = FromServer
    Command LCopy                                      ,
                                                       ,
              @[Scr]<$>InstallOverwriteOkFrom.fls      ,
              @[Scr]<$>InstallOverwriteOkTo.fls        ,
                                                       ,
              Yes                                      ,
              No                                       ,
              No                                       ,
              Yes
    GoTo CopyImages
    Endif

DisplayLine(Msg4)

LoDenFloppy = UserSelectSingle(Msg10, Msg13, Msg14)

DisplayLine(Msg7, ' ', SRADocFrom)

If Public
	Command Copy				,
			SRADocFrom			,
			SRADocTo			,
			Yes
Else
	Choice = UserSelectYesNo(Msg11, DefaultNo)
	If Choice = SelYes
		Command Copy				,
				SRADocFrom			,
				SRADocTo			,
				Yes
		DisplayLine(Msg12, ' ', SRADocTo)
	EndIf
EndIf

Display(Msg1)

Command LCopy                      ,
          (ImRun.Run, IMSP.Run, ImBootStrap.Run, IDM>Exec.Run) ,
          FromSpec                 ,
          ToSpec                   ,
                                   ,
          Yes                      ,
          No                       ,
          No                       ,
          Yes

Command LCopy                      ,
          Request.IDMSS.Txt        ,
          FromSpecSys              ,
          ToSpec                   ,
                                   ,
          Yes                      ,
          No                       ,
          No                       ,
          Yes

If LoDenFloppy = Msg14
	NextFloppy(SecondDisk)
	Display(Msg8)
Endif

If Public
	Command Copy             ,
			IDMImgFrom         ,
			IDMImgTo           ,
			Yes

    Command Copy            ,
         LANImgFrom         ,
         LANImgTo           ,
         Yes

    Command Copy            ,
         ISDNImgFrom        ,
         ISDNImgTo          ,
         Yes
Else
	Choice = UserSelectYesNo(Msg9, DefaultYes)
	If Choice = SelYes
		Command Copy          ,
			IDMImgFrom         ,
			IDMImgTo           ,
			yes
		EndIf

	Choice = UserSelectYesNo(Msg5, DefaultYes)
	If Choice = SelYes
		Command Copy          ,
			LANImgFrom         ,
			LANImgTo           ,
			Yes
	EndIf

	Choice = UserSelectYesNo(Msg6, DefaultYes)
	If Choice = SelYes
		Command Copy          ,
			ISDNImgFrom        ,
			ISDNImgTo          ,
			Yes
	EndIf
EndIf

DisplayLine(' ', Msg2)

GoTo MergeRequest

CopyImages:

Choice = UserSelectYesNo(Msg11, DefaultNo)
If Choice = SelYes
	Command Copy			,
		SRADocFSvr			,
		SRADocTo			,
		Yes
EndIf

Choice = UserSelectYesNo(Msg9, DefaultYes)
If Choice = SelYes
	Command Copy          ,
		IDMImgFSvr        ,
		IDMImgTo          ,
		Yes
	EndIf

Choice = UserSelectYesNo(Msg5, DefaultYes)
If Choice = SelYes
    Command Copy             ,
          LANImgFSvr         ,
          LANImgTo           ,
          Yes
    EndIf

Choice = UserSelectYesNo(Msg6, DefaultYes)
If Choice = SelYes
    Command Copy              ,
          ISDNImgFSvr         ,
          ISDNImgTo           ,
          Yes
    EndIf

MergeRequest:

Display(Msg3)

Command List Request Set         ,
         ReqBinFile              ,
         [scr]<$>Request.Txt

Command Make Request Set          ,
        ([scr]<$>Request.Txt, ReqTxtFile) ,
        ReqBinFile

Command Delete                    ,
        [scr]<$>Request.Txt

DisplayLine(' ', Msg2)

RestartLabel

End
FromFloppy   = 0
FromServer   = 2

ver = FileVersion('[Sys]<Sys>InstallMgr.Run')
If SubString('12.0', ver) <> 65535
	DirectoryTo = '<Sys>'
	If Public
		VolumeTo = '{Master}[Sys]'
	Else
		VolumeTo = '[Sys]'
	EndIf
	If InstallType = FromServer
		MsgFile = '{Mast