Job IsamIIEMU
;SJCSJK 941020
EchoSome
CancelOnError
PauseOff

EMUVer    = 's1.2.6'
Datasheet = '<Datasheet>ISAMIIs1.2.6.def'
Floppy2   = 'ISAM II s1.2.6 EMU 2 of 2'
ServerIns = 4
FloppyIns = 0

ClearScreen = '\\0Ch'
Beep        = '\\07h'

f5inch = ( DeviceType( DeviceFrom ) < 3 )

Datasheet = ConcatStrings(DeviceFrom, Datasheet)

if Public
	ToPath     = '[Sys]<Sys>'
	ISAMReqtxt = ConcatStrings(ToPath,'Request.I.Txt')
	ReqFile    = ConcatStrings(ToPath,'Request.Sys')
else
	ToPath     = '[Sys]<Sys>'
	ISAMReqtxt = ConcatStrings(ToPath,'Request.I.Txt')
	ReqFile    = ConcatStrings(ToPath,'Request.Sys')
endif

Displayline(ClearScreen)
Display    ('    AEWelcome to the CTOS ISAM II ')
Display( EMUVer )
DisplayLine(' EMU InstallationAA')
DisplayLine
DisplayLine
DisplayLine('             ***** Important  Please Read ***** ')
DisplayLine
DisplayLine
DisplayLine('     This EMU requires that the ISAMII1.2.0 or a later EMU')
DisplayLine('     have previously been installed.  It should be installed')
DisplayLine('     on each workstation loaded with the ISAMII 1.2 software')
DisplayLine('     exhibiting the problem corrected by the EMU.')
DisplayLine
DisplayLine('     The data sheet describing the problems corrected is on')
Display    ('     the floppy as the file ')
Display    ( Datasheet )
DisplayLine('.')
DisplayLine
DisplayLine('     If you are installing the EMU to the server workstation')
DisplayLine('     it is important to ensure the client workstations will')
DisplayLine('     not interfere with the installation.   This may require')
DisplayLine('     you to turn some or all of them off, however doing this')
DisplayLine('     may not be strictly necessary.')
DisplayLine
Displayandwait('          AEPress GO to proceed with the EMU installationAA')

;user selects items to install
MainMenu:
Displayline(ClearScreen)
DisplayLine
DisplayLine
DisplayLine
DisplayLine('   Please select the ISAM II software items to install:')
DisplayLine
DisplayLine

Options = UserSelectMultiple( 
	'Please select the ISAM II software items to install:',
	'ISAM II Service and Utilities (memoryresident version)',
	'ISAM II Service and Utilities (overlayswapping version)',
	'SingleUser highmemory ISAM II Service',
	'ISAM II development library (ISAM.lib)')

fResident = (SubString('memoryresident',Options) <> 0FFFFh)
fSwapping = (SubString('overlayswapping',Options) <> 0FFFFh)
fSingle   = (SubString('SingleUser',Options) <> 0FFFFh)
fLibrary  = (SubString('ISAM.lib',Options) <> 0FFFFh)

;check for consistent options
if ( fResident and fSwapping )
	DisplayLine('	AEPlease select either the Resident or Swapping version.AA')
	DisplayAndWait('			Press GO to reselect.')
	Goto MainMenu
endif

;user selects file path for installation
Displayline(ClearScreen)
DisplayLine
DisplayLine
DisplayLine
DisplayLine('   Please specify the file path to which the ISAM II software')
DisplayLine('   is to be installed, then press GO.  The default path is to')
Display    ('   ')
Display    ( ToPath )
DisplayLine('.')
DisplayLine
DisplayLine

ToPath = UserEnterValue( 'Please specify the destination file path', ToPath )

CfgFrom = ConcatStrings(DeviceFrom,'<Sys>')
CfgTo   = ConcatStrings(VolumeTo,'<Sys>')
$dump
$Run ([Sys]<Sys>LCopy.Run, 'LCopy', '00'),
		'ISAMII.Config',CfgFrom,CfgTo,,n,,,n

$Run ([Sys]<Sys>LCopy.Run, 'LCopy', '00'),
		'Request.I.Txt',CfgFrom,CfgTo,,y,,,n

		$Run [Sys]<sys>ListRqSet.run, ReqFile, [scr]<$>req.txt,,
		$Run [Sys]<sys>MakeRqSet.run,([scr]<$>req.txt, ISAMReqtxt),ReqFile

if Public
	$Run ([Sys]<Sys>CmdFileEditor.run, 'Merge Command Files', 'MC'),
		CmdFileFrom,CmdFileTo,y,Sys
else
	$Run ([Sys]<Sys>CmdFileEditor.run, 'Merge Command Files', 'MC'),
		CmdFileFrom,CmdFileTo,y,Sys
endif

if ( fResident )
	Spec0 = '\'<ISAMII1.2>Pm*\''
else
	if ( fSwapping )
		Spec0 = '\'<ISAMII1.2>Swp*\''
	endif
endif

if ( fResident or fSwapping )
	Spec1 = '\'<ISAMII1.2>ISAM*\''
	Spec2 = '\'*\''
	Spec3 = '\'ISAM*\''
else
	Spec0 = '\'\''
	Spec1 = '\'\''
	Spec2 = '\'\''
	Spec3 = '\'\''
endif

if ( fSingle )
	Spec4 = '<ISAMII1.2>HighMemPmISAMService.run'
	Spec5 = 'HighMemPmISAMService.run'
else
	Spec4 = '\'\''
	Spec5 = '\'\''
endif

if ( fLibrary )
	Spec6 = '<ISAMII1.2>ISAM.lib'
	Spec7 = 'ISAM.lib'
else
	Spec6 = '\'\''
	Spec7 = '\'\''
endif

;path to selfextracting SuperZipt archive
Path '',DeviceFrom,Sys,''

;restore archived files
if ( f5inch )
	;resident version  utilities
	RUN ISAMIIs1.2.6.run, 
		( Spec0, Spec1 ), 
		( Spec2, Spec3 ), 
		y, n, , , ToPath
	;swapping version, single user, or library on disk 2 of 5 media
	if ( fSwapping or fSingle or fLibrary )
		NextFloppy( Floppy2 )
		RUN ISAMIIs1.2.6.run, 
			( Spec0, Spec4, Spec6 ), 
			( Spec2, Spec5, Spec7 ), 
			y, n, , , ToPath
	endif
else
	RUN ISAMIIs1.2.6.run, 
		( Spec0, Spec1, Spec4, Spec6 ), 
		( Spec2, Spec3, Spec5, Spec7 ), 
		y, n, , , ToPath
endif

Path '',Sys,Sys,''

Displayline(ClearScreen)
DisplayLine
DisplayLine
DisplayLine('           The ISAM II s1.2.6 EMU installation is complete.')
DisplayLine('       Please remove the diskette and store it in a safe place.')
DisplayLine
DisplayLine
Displayandwait('    	            AEPress any key to finishAA ')

End
t = '<Datasheet>ISAMIIs1.2.6.def'
Floppy2   = 'ISAM II s1.2.6 EMU 2 of 2'
ServerIns = 4
FloppyIns = 0

ClearScreen = '\\0Ch'
Beep        = '\\07h'

f5inch = ( DeviceType( DeviceFrom ) < 3 )

Datasheet = ConcatStrings(DeviceFrom, Datasheet)

if Public
	ToPath     = '[Sys]<Sys>'
	ISAMReqtxt = ConcatStrings(ToPath,'Request.I.Txt')
	ReqFile    = ConcatStrings(ToPath,'Request.Sys')
else
	ToPath     = '[Sys]<Sys>'
	ISAM