Job GpsBasic
;GPS R2.7.0 Basic Package Installation
;SJCSJK 940701
CancelOnError
PauseOff

CLS  = '\\0ch'
YES  = 255
NO   = 0
NULL = '0'
fMergeRq = No

VolFrom = DeviceFrom
f5inch  = ( DeviceType( VolFrom ) < 3 )
if ( InstallType = 2 )  ;Installing from Server
  FromGps     = '[Sys]<Gps>'
  FromFontDB  = '[Sys]<FontDB>'
  FromSys     = '[Sys]<Sys>'
  VolFrom     = '[Sys]'
  fFromServer = YES
else
  FromGps     = ConcatStrings(VolFrom, '<Gps>')
  FromFontDB  = ConcatStrings(VolFrom, '<FontDB>')
  FromSys     = ConcatStrings(VolFrom, '<Sys>')
  fFromServer = NO
endif

if ( Public )
	ToVol = '[Sys]'
else
	ToVol = '[Sys]'
endif

;initial consistency checks
if ( fFromServer )
	;check if server has been done correctly, permit later EMUs
	Spec  = ConcatStrings( FromGps, 'GpsPm.run' )
	Ver   = FileVersion( Spec )
	fPM   = (SubString('2.7', Ver) <> 0FFFFh)
	Spec  = ConcatStrings( FromGps, 'GpsInstall.run' )
	Ver   = FileVersion( Spec )
	fIN   = (SubString('2.7', Ver) <> 0FFFFh)
	Spec  = ConcatStrings( FromSys, 'FontTool.run' )
	Ver   = FileVersion( Spec )
	fFT   = (SubString('2.7', Ver) <> 0FFFFh)
	Spec  = ConcatStrings( FromGps, 'GpsStatus.run' )
	Ver   = FileVersion( Spec )
	fST   = (SubString('2.7', Ver) <> 0FFFFh)
	if ( fIN = NO or fPM = NO or fFT = NO or fST = NO )
		Display( CLS )
		DisplayLine('	*** STOP *** GPS R2.7.0 is not installed correctly')
		DisplayLine('	             at the server.  Please reinstall GPS ')
		DisplayLine('	             onto the server before continuing.   ')
		DisplayLine
		DisplayAndWait('	            Press any key to quit installation:')
		Cancel
	endif
	deassign( fPM )
	deassign( fFT )
	deassign( fIN )
	deassign( fST )
endif
	
;initial info  user concerns
Display( CLS )
DisplayLine
DisplayLine('	AE                                                       AA')
DisplayLine('	AE          GPS R2.7.0 Basic Package Installation        AA')
DisplayLine('	AE                                                       AA')
DisplayLine
DisplayLine('	GPS services operating in memory will be shut down if  ')
DisplayLine('	you choose to install any main GPS workstation package.')
DisplayLine('	Optionally, the <Gps> directory will be cleaned up to  ')
DisplayLine('	remove existing obsolete GPS software and data files.  ')
DisplayLine('	Context Manager may operate during this installation.  ')
DisplayLine
DisplayLine('	Any existing workstation GPS configuration files, font ')
DisplayLine('	database files and printer driver configuration files  ')
DisplayLine('	will be retained (e.g., <Gps>*GPS.Printers, <Gps>*.dbs,')
DisplayLine('	<Gps>*.state files, respectively).                     ')
DisplayLine
DisplayLine('	Existing <Gps>*.queue files will be relocated to the   ')
DisplayLine('	[SCR]<SPL> directory, if possible, to retain unprinted')
DisplayLine('	queued jobs for this version of GPS to resume printing.')
DisplayLine
DisplayAndWait('	 more   Press any key to proceed:')
Display( CLS )
DisplayLine
DisplayLine('	If GPS request codes have already been merged into the ')
DisplayLine('	Request.sys file, you will be asked if you want to have')
DisplayLine('	the R2.7.0 request codes merged regardless.  This will ')
DisplayLine('	both update the version information and any old spooler')
DisplayLine('	version request codes to the current released levels.  ')
DisplayLine
DisplayLine('	GPS R2.7.0 is not compatible with GPS 2.6.0 or earlier ')
DisplayLine('	versions.  This requires that all client (cluster) GPS ')
DisplayLine('	workstations must otherwise be upgraded to GPS R2.6.5  ')
DisplayLine('	or R2.7.0 before resuming GPS services upon them.      ')
DisplayLine('	Please refer to the R2.7.0 SRA for additional details. ')
DisplayLine
DisplayLine('	GPS R2.7.0 requires about 6200 sectors fully installed.')
DisplayLine('	If GPS has previously been installed fewer sectors will')
DisplayLine('	be required.  If you plan to install the Application   ')
DisplayLine('	Program Interface or language Product Localization Kit ')
DisplayLine('	items, an additional 190 or 310 sectors will be needed.')
DisplayLine
DisplayAndWait('	 more   Press any key to proceed:')
Display( CLS )
DisplayLine
DisplayLine('	Press GO to run Volume Status to determine if there is ')
DisplayLine('	sufficient free sectors available to continue (only the')
DisplayLine('	<Sys>, <Gps> and possibly a few other directories will ')
DisplayLine('	be shown):')
DisplayAndWait
PauseOn
RUN [Sys]<Sys>VolumeStatus.run,ToVol,y,,'??s'
PauseOff
DisplayLine
DisplayAndWait('	AEPress GO to continue, or ACTIONFINISH to quit:AA')

RestartLabel
MainMenu:

;clear screen
Display( CLS )

;Select GPS Basic Pkg items to install
;these menus are different when installing from the server or the media
if ( fFromServer )
	DisplayLine('Installing software from server ...')
	Options = UserSelectMultiple( 
	  'Please select R2.7.0 GPS Basic Package components to install:', 
	  'Client workstation installation package', 
	  'Standard Font Database  contains Laser and Dot Matrix fonts', 
	  'Font data for HP font cartridges, AP9210 font cards, Imagen', 
	  'Basic Package Pipe Device Drivers (outputs to disk files)' )
else ;from floppy
	DisplayLine('Installing software from installation media ...')
	Options = UserSelectMultiple( 
	  'Please select R2.7.0 GPS Basic Package components to install:', 
	  'Server system installation package (required if Public)', 
	  'Client workstation installation package', 
	  'Standalone workstation installation package', 
	  'Standard Font Database  contains Laser and Dot Matrix fonts', 
	  'Font data for HP font cartridges, AP9210 font cards, Imagen', 
	  'Basic Package Pipe Device Drivers (outputs to disk files)', 
	  'Application Program Interface (API) for software developers', 
	  'Language Product Localization Kit (PLK) to change languages', 
	  'Copy R2.7.0 GPS SRA DEF format document to <Gps> directory' )
endif

fServer = (SubString('Server system',           Options) <> 0FFFFh)
fClient = (SubString('Client workstation',      Options) <> 0FFFFh)
fStand  = (SubString('Standalone workstation', Options) <> 0FFFFh)
fFontDB = (SubString('Standard Font Database',  Options) <> 0FFFFh)
fFonts  = (SubString('Font data for HP font',   Options) <> 0FFFFh)
fPipes  = (SubString('Basic Package Pipe',      Options) <> 0FFFFh)
fAPI    = (SubString('Application Program',     Options) <> 0FFFFh)
fPLK    = (SubString('Language Product',        Options) <> 0FFFFh)
fSRA    = (SubString('Copy R2.7.0 GPS SRA',     Options) <> 0FFFFh)

;force fServer if Public  not just SRA, API or PLK
if ( Public and not fServer )
	if ( fClient or fStand or fFontDB or fFonts or fPipes )
		fServer = UserSelectYesNo( 
			'PUBLIC requires GPS Server system.  Proceed?','Yes')
		if ( fServer <> YES )
			Goto MainMenu
		endif
	endif
endif

;check for consistent options
if ( (fServer and fClient) or (fServer and fStand) )
	DisplayLine('		AEInconsistent options were selected.AA')
	DisplayAndWait('		Please press GO to try again.')
	Goto MainMenu
endif

if ( fServer )		;Installing to Server
	ToGps    = '[Sys]<Gps>'
	ToFontDB = '[Sys]<FontDB>'
	ToSys    = '[Sys]<Sys>'
	ToVol    = '[Sys]'
	CmdFileTo = '[Sys]<Sys>Cluster.cmds'
	fCmds = FileVersion( CmdFileTo )
	if ( fCmds = NULL )
		;no cluster.cmds file
		CmdFileTo = '[Sys]<Sys>Sys.cmds'
	endif
	Deassign( fCmds )
else
	ToGps     = '[Sys]<Gps>'
	ToFontDB  = '[Sys]<FontDB>'
	ToSys     = '[Sys]<Sys>'
	ToVol     = '[Sys]'
	CmdFileTo = '[Sys]<Sys>Sys.cmds'
endif

RestartLabel
;setup font loading options
fGenDB  = NO
fCopyDB = NO
if ( fFontDB or fFonts )
	RedoFonts:
	if ( fFromServer )
		fCopyDB = UserSelectYesNo( 
			'Copy runtime Font Database from server?','Yes')
		if ( fCopyDB )
			fFonts = NO
			FromFontDB = UserEnterValue( 
			  'Please enter the font database name','[Sys]<FontDB>Font.dbs')
		else
			FromFontDB = UserEnterValue( 
			  'Please enter the server font database directory path', 
				FromFontDB )
		endif
	endif
	if ( fFonts )
		Options = UserSelectMultiple( 
		  'Please Select the additional fonts for the font database:', 
		  'Imagen  requires printer floppy from OEM (not included)', 
		  'HP Laserjet font cartridge fonts', 
		  'AP9210 HP Laserjet emulation font card fonts' )
		fImagen = (SubString('Imagen',      Options) <> 0FFFFh)
		fHPCart = (SubString('HP Laserjet', Options) <> 0FFFFh)
		fAP9210 = (SubString('AP9210',      Options) <> 0FFFFh)
		if ( fFromServer )
			fFile = '255'
			if ( fImagen )
				Spec = ConcatStrings(FromFontDB, 
					'ExtraImagen>FontFamily.port')
				fFile = FileVersion( Spec )
				if ( fFile = NULL )
					Display('The Imagen font data is not in ')
					DisplayLine(FromFontDB)
					DisplayLine
				endif
			endif
			if ( fHPCart and fFile = '255' )
				Spec = ConcatStrings(FromFontDB, 
					'HPCart>FontFamily.port')
				fFile = FileVersion( Spec )
				if ( fFile = NULL )
					Display('The HP Cartridge font data is not in ')
					DisplayLine(FromFontDB)
					DisplayLine
				endif
			endif
			if ( fAP9210 and fFile = '255' )
				Spec = ConcatStrings(FromFontDB, 
					'AP9210HP>FontFamily.port')
				fFile = FileVersion( Spec )
				if ( fFile = NULL )
					Display('The AP9210 HP font data is not in ')
					DisplayLine(FromFontDB)
					DisplayLine
				endif
			endif
			if ( fFile = NULL )
				DisplayLine
				DisplayAndWait('Press any key to choose again:')
				Goto RedoFonts
			endif
			Deassign( fFile )
		endif
		if ( not fImagen and not fHPCart and not fAP9210 )
			fFonts = NO
		endif
	endif
	if ( not fCopyDB )
		ToFontDB = UserEnterValue( 
		  'Please enter the new font database directory path', ToFontDB )
		;ask user about generating
		fGenDB = UserSelectYesNo(
			'Perform generation of new runtime Font Database?','Yes')
		Spec = ConcatStrings( ToSys, 'FontTool.run' )
		if ( fGenDB and not fServer and not fClient and not fStand )
			Ver = FileVersion( Spec )
			if ( Ver = NULL )
				DisplayLine
				DisplayLine(
	'The Font Tool is required for this but it has not been installed.')
				DisplayLine
				DisplayLine(
	'Press GO to reselect menu options or press ACTIONFINISH:')
				DisplayAndWait
				Goto MainMenu
			endif
		endif
		if ( fFonts and not fFontDB )
			Spec = ConcatStrings( FromFontDB, 'FontFamily.isam' )
			Ver = FileVersion( Spec )
			if ( Ver = NULL )
				DisplayLine
				Display(
	'An existing editable font database is not in ')
				DisplayLine( FromFontDB )
				DisplayLine
				DisplayAndWait('Press any key to choose again:')
				Goto RedoFonts
			endif
		endif
	endif
endif

RestartLabel
Display( CLS )
fClean = NO
if ( fServer or fClient or fStand or fSRA )
	Spec = ConcatStrings( ToGps, 'GpsInstall.run' )
	Ver = FileVersion( Spec )
	if ( (Ver <> NO) and ( fServer or fClient or fStand ) )
		fClean = UserSelectYesNo('Perform cleanup of <GPS> directory?','Yes')
	else
		Display('Creating directory ')
		Display(ToGps)
		Display(' ... ')
		Command 'Create Directory',ToGps
		DisplayLine('done.')
		DisplayLine
	endif
endif

RestartLabel
;set path to installing <Gps> directory
PATH '',ToVol,Gps,''
if ( fServer or fClient or fStand )
	DisplayLine
	DisplayLine('Preparing to check status of GPS services ...')
	if ( fFromServer = NO )
		PATH '',DeviceFrom,Sys,''
		RUN BasicGps.run,<Gps>GpsStatus.run,,y,n,,,ToVol
		PATH '',ToVol,Gps,''
	else
		Command LCopy,GpsStatus.run,FromGps,ToGps,,y,n
	endif
	DisplayLine

	;get status in ErcMsg
	RUN GpsStatus.run,GpsPm.run
	fQMgr    = SubString('1',ErcMsg) <> 0ffffh
	fFsServ  = SubString('2',ErcMsg) <> 0ffffh
	fFsLocal = SubString('3',ErcMsg) <> 0ffffh
	fPsServ  = SubString('4',ErcMsg) <> 0ffffh
	fPsLocal = SubString('5',ErcMsg) <> 0ffffh
	fMergeRq = SubString('8',ErcMsg) <> 0ffffh
	if ( not fMergeRq )
		fMergeRq = UserSelectYesNo( 
	'Request codes are already installed.  Merge anyway? (recommended)','Yes')
	endif
	if ( (fQMgr and SystemType = 3) or (fQMgr and SystemType = 0) )
		fQmLocal = YES
	else
		fQmLocal = NO
	endif
	if (fPsServ and SystemType = 3)
		fPsLocal = YES
	endif
	if (fFsServ and SystemType = 3)
		fFsLocal = YES
	endif

	if ( fQmLocal or fFsLocal or fPsLocal )
		DisplayLine('Deinstalling:')
		if ( fQmLocal )
			DisplayLine('	Queue Manager')
		endif
		if ( fFsLocal )
			DisplayLine('	Font Service')
		endif
		if ( fPsLocal )
			DisplayLine('	Print Service (and device drivers)')
		endif
		Display('... ')
		RUN (GpsStatus.run,,DE),GpsPm.run,7
		DisplayLine('done.')
		DisplayLine
	else
		DisplayLine('	No local GPS services are operating; proceeding ...')
		DisplayLine
	endif

	;refresh flags
	fQMgr    = SubString('1',ErcMsg) <> 0ffffh
	fFsServ  = SubString('2',ErcMsg) <> 0ffffh
	fFsLocal = SubString('3',ErcMsg) <> 0ffffh
	fPsServ  = SubString('4',ErcMsg) <> 0ffffh
	fPsLocal = SubString('5',ErcMsg) <> 0ffffh
	fGpsPm   = SubString('7',ErcMsg) <> 0ffffh

	if ( fServer or ( (not fServer) and (SystemType <> 2) ) )
		if ( fQMgr )
		DisplayLine
		DisplayLine('	*** STOP *** The Queue Manager must be deinstalled at')
		DisplayLine('	             the server before installing GPS R2.7.0.')
		DisplayLine
		endif
		if ( fFsServ )
		DisplayLine
		DisplayLine('	*** STOP *** The Font Service or Scaling Font Service')
		DisplayLine('	             must be deinstalled at the server before')
		DisplayLine('	             attempting to install GPS R2.7.0.')
		DisplayLine
		endif
		if ( fQMgr or fFsServ )
		DisplayAndWait('	            Press any key to quit installation:')
		Cancel
		endif
	endif
	if ( fGpsPm )
		DisplayLine
		DisplayLine('	*** STOP *** Print Manager is running from the <Gps>')
		DisplayLine('	             installation destination directory.')
		DisplayLine('	             Please exit the Print Manager before')
		DisplayLine('	             attempting to install GPS R2.7.0.')
		DisplayLine
		DisplayAndWait('	            Press any key to quit installation:')
		Cancel
	endif
	Deassign( fQmLocal )
	Deassign( fFsServ )
	Deassign( fFsLocal )
	Deassign( fPsServ )
	Deassign( fPsLocal )
	Deassign( fGpsPm )
endif

if ( fServer or fClient or fStand )
	dirSpec = ConcatStrings( ToVol, '<$000>' )
	DisplayLine
	Display('Creating directory ')
	Display(dirSpec)
	Display(' ... ')
	Command 'Create Directory',dirSpec,,750
	DisplayLine('done.')
	DisplayLine
endif

RestartLabel
if ( fFontDB or fFonts )
	DisplayLine
	Display('Creating directory ')
	Display(ToFontDB)
	Display(' ... ')
	Command 'Create Directory',ToFontDB,,150
	DisplayLine('done.')
	DisplayLine
endif

RestartLabel
;setup API  PLK directories
if ( fAPI )
	ToAPI = ConcatStrings( ToVol, '<GpsAPI>' )
	ToAPI = UserEnterValue('Enter API files destination path', ToAPI )
	DisplayLine
	Display('Creating directory ')
	Display(ToAPI)
	Display(' ... ')
	Command 'Create Directory',ToAPI,,200
	DisplayLine('done.')
	DisplayLine
endif

RestartLabel
if ( fPLK )
	DisplayLine
	DisplayLine('GPS PLK files will be loaded into <GpsPLK>.')
	DisplayLine
	Spec2 = ConcatStrings( ToVol, '<GpsPLK>' )
	Display('Creating directory ')
	Display(Spec2)
	Display(' ... ')
	Command 'Create Directory',Spec2,,200
	DisplayLine('done.')
	DisplayLine
endif

RestartLabel
if ( fServer or fClient or fStand )
	DisplayLine
	if ( not fFromServer )
	if ( fQMgr )
		DisplayLine( 
		'Did not attempt queue relocation; Queue Manager is running.')
	else
		Display('Relocating [Sys]<Gps> queue files to [SCR]<SPL> ... ')
		Command Move,'[Sys]<Gps>*.queue',,'[SCR]<SPL>',,n,n,y,y
		Display('done.')
	endif
	DisplayLine
	endif

	;cleanup <Gps> directory
	if ( fClean )
		DisplayLine
		Display('Cleaning obsolete GPS software from <Gps> directory ... ')
		PATH '',ToVol,Gps,''
		Command Delete,('*.tmp','*.config',GpsStatusMsg.txt,
			LPTSimpleDD.run,LPTSimplePipe.run,
			DaisyDD.run,DaisyPipe.run,
			HPPlotterDD.run,HPPlotterPipe.run,
			BinaryModeDD.run,GpsPsMsg.bin,GpsInstall.run,
			GpsPsMstr.run,GpsPsClstr.run,GpsStndAln.run,
			GpsPm.run,GpsPmMsg.bin,GpsForms.lib,GpsDDMsg.bin),n
		Display('done.')
		DisplayLine
	endif
	Deassign( fClean )
endif
if ( fServer or fClient or fStand )
	Deassign( fQMgr )
endif

RestartLabel
if ( fFromServer )
	if ( fServer or fClient or fStand )
		DisplayLine
		DisplayLine('Installing Print Service ... ')
		if ( fServer )
			Command LCopy,GpsPsMstr.run,FromGps,ToGps,,y,n,n,
		endif
		if ( fStand )
			Command LCopy,GpsPsStndAln.run,FromGps,ToGps,,y,n,n,
		endif
		if ( fClient )
			Command LCopy,GpsPsClstr.run,FromGps,ToGps,,y,n,n,
		endif
		DisplayLine('done.')
		DisplayLine
		; do not copy Request.GPS.txt,BasicGps.cmds,GpsStatus.run
		Display(
	'Installing Print Manager, utilities and basic device drivers ... ')
		Command LCopy, ( GpsStatus.run,
			GpsInstall.run,GpsPm.run,GpsPmMsg.bin,
			DefaultDevHelp,GpsForms.lib,
			GpsPsMsg.bin,GpsDDMsg.bin,LptSimpleDD.run,
			BinaryModeDD.run,HPPlotterDD.run,
			DaisyDD.run,UniversalDD.run ),
				FromGps,ToGps,,y,n,n,
		DisplayLine('done.')
		DisplayLine
		Display('Installing Font Service and Font Tool ... ')
		Command LCopy, ( 
			FontTool.run,FontToolMsg.bin,FontForms.lib,
			FontIsam.config,
			GpsMakeFontDB.run,MakeFontDatabase.sub, Gps.user,
			FontIsam.run,FontService.run,DeinstallFS.run ),
				FromSys,ToSys,,y,n,n,
		DisplayLine('done.')
		DisplayLine
	endif
	if ( fFontDB )
		if ( fCopyDB )
			Display('Copying runtime Font Database from server ... ')
			Command LCopy, FromFontDB,,ToGps,,y,n,n,
		else
			Display('Installing Standard Font Database ... ')
			Command LCopy, ( 
				Gps>FontCharacterSet.port,Gps>FontDevice.port,
				Gps>FontFamily.port,Gps>FontKey.port,
				Gps>FontPseudoFamily.port,Gps>FontRaster.port,
				Gps>FontReduction.port,Gps>FontTranslate.port,
				Gps>FontWidth.port,FontWidthTest.script,
				TextSet.Font,VM003TextSet.Font ),
					FromFontDB,ToFontDB,,y,n,n,
		endif
		DisplayLine('done.')
		DisplayLine
	endif
	if ( fFonts )
		if ( fImagen )
			Display('Installing additional Imagen Font Data ... ')
			Command LCopy, ( 
				ExtraImagen>FontCharacterSet.port,ExtraImagen>FontDevice.port,
				ExtraImagen>FontFamily.port,ExtraImagen>FontKey.port,
				ExtraImagen>FontPseudoFamily.port,ExtraImagen>FontRaster.port,
				ExtraImagen>FontReduction.port,ExtraImagen>FontTranslate.port,
				ExtraImagen>FontWidth.port ), 
					FromFontDB,ToFontDB,,y,n,n,
			DisplayLine('done.')
		endif
		if ( fHPCart )
			Display('Installing HP Laserjet Font Cartridge Data ... ')
			Command LCopy, ( 
				HPCart>FontCharacterSet.port,HPCart>FontDevice.port,
				HPCart>FontFamily.port,HPCart>FontKey.port,
				HPCart>FontPseudoFamily.port,HPCart>FontRaster.port,
				HPCart>FontReduction.port,HPCart>FontTranslate.port,
				HPCart>FontWidth.port, HPCart>FontDatabase.doc ), 
					FromFontDB,ToFontDB,,y,n,n,
			DisplayLine('done.')
			DisplayLine
		endif
		if ( fAP9210 )
			Display('Installing AP9210 HP Font Card Data ... ')
			Command LCopy, ( 
				AP9210HP>FontCharacterSet.port,AP9210HP>FontDevice.port,
				AP9210HP>FontFamily.port,AP9210HP>FontKey.port,
				AP9210HP>FontPseudoFamily.port,AP9210HP>FontRaster.port,
				AP9210HP>FontReduction.port,AP9210HP>FontTranslate.port,
				AP9210HP>FontWidth.port, AP9210HP>FontDatabase.doc ), 
					FromFontDB,ToFontDB,,y,n,n,
			DisplayLine('done.')
			DisplayLine
		endif
	endif

	;get basic pipe drivers
	if ( fPipes )
		Spec = ConcatStrings( FromGps, 'BasicPipe.cmds' )
		Ver = FileVersion( Spec )
		if ( Ver = NULL )
			DisplayLine
			DisplayLine('The GPS Basic Package Pipe Drivers have not been')
			DisplayLine('installed at the server.  Press any key to proceed:')
			DisplayAndWait
			fPipes = NO
		else
			Display('Installing Basic Package Pipe Drivers ... ')
			Command LCopy, ( 
				LptSimplePipe.run,HPPlotterPipe.run, 
				DaisyPipe.run ),FromGps,ToGps,,y,n,n,
			DisplayLine('done.')
		endif
		DisplayLine
	endif

else	; fFromServer = NO

	PATH '',DeviceFrom,Sys,''

	if ( fServer or fClient or fStand )
		DisplayLine
		Display(
	'Installing Print Manager, utilities and basic device drivers ... ')
		DisplayLine
		Spec = ConcatStrings( FromSys, 'BasicGps.run' )
		Spec2 = '\'\''
		Spec3 = '\'\''
		Spec4 = '\'\''
		if ( fServer )
			Spec2 = '<Gps>GpsPsMstr.run'
		endif
		if ( fStand )
			Spec3 = '<Gps>GpsPsStndAln.run'
		endif
		if ( fClient or fServer )
			Spec4 = '<Gps>GpsPsClstr.run'
		endif
		RUN BasicGps.run, ( Spec2, Spec3, Spec4, 
			<Gps>Request.GPS.txt,<Gps>BasicGps.cmds,
			<Gps>GpsStatus.run,
			<Gps>GpsInstall.run,<Gps>GpsPm.run,
			<Gps>GpsPmMsg.bin,<Gps>DefaultDevHelp, 
			<Gps>GpsForms.lib,<Gps>GpsPsMsg.bin, 
			<Gps>GpsDDMsg.bin,<Gps>LptSimpleDD.run,
			<Gps>BinaryModeDD.run,<Gps>HPPlotterDD.run,
			<Gps>DaisyDD.run,<Gps>UniversalDD.run ),,y,n,,,ToVol
		DisplayLine
		DisplayLine('Installing Font Tool and Font Service ...')
		DisplayLine
		RUN BasicGps.run,
			('<Sys>FontISAM.*',<Sys>FontForms.lib),,y,n,,,ToVol
	endif
	if ( f5inch )
		if ( fFontDB or fFonts or fPipes or fSRA or fAPI or fPLK )
			DisplayLine
			DisplayLine
			NextFloppy('R2.7.0 Gps Basic Package 2 of 2')
			DisplayLine
		endif
	endif
	if ( fServer or fClient or fStand )
		RUN BasicGps.run, ( 
			<Sys>FontService.run,<Sys>DeinstallFS.run, 
			<Sys>FontTool.run,<Sys>FontToolMsg.bin, 
			<Sys>GpsMakeFontDB.run,<Sys>Gps.user, 
			<Sys>MakeFontDatabase.sub ),,y,n,,,ToVol
		DisplayLine
	endif
	if ( fFontDB )
		DisplayLine('Installing Standard Font Database ...')
		DisplayLine
		dirSpec = ConcatStrings( '\'', ToFontDB )
		Spec2 = ConcatStrings( dirSpec, 'Gps>*\'' )
		Spec3 = ConcatStrings( dirSpec, 'TextSet.font\'' )
		Spec4 = ConcatStrings( dirSpec, 'VM003TextSet.font\'' )
		Spec5 = ConcatStrings( dirSpec, 'FontWidthTest.script\'' )
		RUN BasicGps.run, ( 
			'<FontDB>Gps>*', <FontDB>TextSet.font, 
			 <FontDB>VM003TextSet.font, 
			'<FontDB>FontWidthTest.script' ), 
			( Spec2, Spec3, Spec4, Spec5 ),y,n
		Deassign( Spec5 )
		DisplayLine
	endif
	if ( fFonts )
		DisplayLine('Installing additional selected Font Data ...')
		DisplayLine
		dirSpec = ConcatStrings( '\'', ToFontDB )
		if ( fImagen )
			Spec2f = \''<FontDB>ExtraImagen>*\''
			Spec2  = ConcatStrings( dirSpec, 'ExtraImagen>*\'' )
		else
			Spec2f = '\'\''
			Spec2  = '\'\''
		endif
		if ( fHPCart )
			Spec3f = \''<FontDB>HPCart>*\''
			Spec3  = ConcatStrings( dirSpec, 'HPCart>*\'' )
		else
			Spec3f = '\'\''
			Spec3  = '\'\''
		endif
		if ( fAP9210 )
			Spec4f = '\'<FontDB>AP9210HP>*\''
			Spec4  = ConcatStrings( dirSpec, 'AP9210HP>*\'' )
		else
			Spec4f = '\'\''
			Spec4  = '\'\''
		endif
		RUN BasicGps.run,(Spec2f,Spec3f,Spec4f), 
			(Spec2,Spec3,Spec4),y,n
		Deassign( Spec2f )
		Deassign( Spec3f )
		Deassign( Spec4f )
		DisplayLine
	endif

	;get pipe driver items
	if ( fPipes )
		DisplayLine('Installing Basic Package Pipe Drivers ...')
		DisplayLine
		RUN BasicGps.run, ( 
			<Gps>BasicPipe.cmds,<Gps>LptSimplePipe.run,
			<Gps>HPPlotterPipe.run,<Gps>DaisyPipe.run ),
			,y,n,,,ToVol
		DisplayLine
	endif

	;get SRA
	if ( fSRA )
		DisplayLine('Copying GPS R2.7.0 SRA document ... ')
		DisplayLine
		RUN BasicGps.run,<Gps>R2.7.0>BasicGps.SRA,,y,n,,,ToVol
		DisplayLine
	endif

	;get API items
	if ( fAPI )
		Display('Installing GPS API software to ')
		Display(ToAPI)
		DisplayLine(' ...')
		Spec2 = ConcatStrings( '\'', ToAPI )
		Spec2 = ConcatStrings( Spec2, '*\'' )
		RUN BasicGps.run,'<GpsAPI>*',Spec2,y,n
		DisplayLine
	endif

	;get PLK items
	if ( fPLK )
		DisplayLine('Installing GPS PLK software ...')
		RUN BasicGps.run,('<GpsNLS>*','<GpsPLK>*'),,y,n,,,ToVol
		DisplayLine
	endif

endif

RestartLabel
PATH '',ToVol,Gps,''
;all selected BASIC PKG items are now assumed installed or locally available
if ( fServer or fClient or fStand )
	;merge basic commands  request codes
	if ( fMergeRq )
		Display('Merging GPS request codes ... ')
		Spec  = ConcatStrings( ToSys, 'Request.sys' )
		if ( fFromServer )
			Spec2 = ConcatStrings( FromGps, 'Request.GPS.txt' )
		else
			Spec2 = ConcatStrings( ToGps, 'Request.GPS.txt' )
		endif
		;exclude WriteGPSFile request to update to 2.7 level
		Command 'List Request Set',Spec,[SCR]<$>Rq.sys.txt,,8039h
		Command 'Make Request Set',([SCR]<$>Rq.sys.txt,Spec2),
			[SCR]<$>Request.sys
		Command Move,[SCR]<$>Request.sys,,ToSys,,y,n,n,y
		DisplayLine('done.')
		DisplayLine
	else
		DisplayLine('GPS request codes have already been installed.')
	endif
	Display('Merging GPS Basic Package commands ... ')
	if ( fFromServer )
		Spec2 = ConcatStrings( FromGps, 'BasicGps.cmds' )
	else
		Spec2 = ConcatStrings( ToGps, 'BasicGps.cmds' )
	endif
	Command 'Merge Command Files',Spec2,CmdFileTo,y,ToVol
	DisplayLine('done.')
endif
if ( fPipes )
	Display('Merging GPS Basic Package Pipe Driver commands ... ')
	if ( fFromServer )
		Spec2 = ConcatStrings( FromGps, 'BasicPipe.cmds' )
	else
		Spec2 = ConcatStrings( ToGps, 'BasicPipe.cmds' )
	endif			
	Command 'Merge Command Files',Spec2,CmdFileTo,y,ToVol
	DisplayLine('done.')
	DisplayLine
endif

RestartLabel
;create runtime font database or merge font data
if ( fGenDB or fFonts )
	Display( CLS )
	DisplayLine
	if ( fGenDB )
	  DisplayLine('Preparing to generate new runtime Font Database ...')
	else
	  DisplayLine('Preparing Font Tool to merge additional font data ...')
	endif
	FtRun = ConcatStrings( ToSys, 'FontTool.run' )
	Command 'New Command','Font Tool',FtRun, 
		('[Batch mode commands]','[Variant database]'),,n,, 
		[Sys]<Sys>Install>English.cmds
	Deassign( FtRun )
	;set path to user's font database
	p = SubString( '<', ToFontDB )
	l = StringLength( ToFontDB )
	l = l  p
	Spec3 = CopyString( ToFontDB, p, l )
	p = SubString( ']', ToFontDB )
	l = p  1
	Spec2 = CopyString( ToFontDB, 1, l )
	Deassign( p )
	Deassign( l )
	if ( Public )
		; get local copy of FontISAM first
		Command LCopy, (FontISAM.run,FontISAM.config), 
			ToSys,'[Sys]<Sys>',,y,n,y,
	endif
	PATH '',Spec2,Spec3,''

	if ( fFonts )
		DisplayLine
		DisplayLine('Importing additional selected font data will now begin.')
		DisplayLine
		DisplayLine('This procedure requires considerably more time than the')
		DisplayLine('creation of the Standard Font Database.  Please wait')
		DisplayLine('while the font database is prepared for the new data.')
		DisplayLine
		if ( fFontDB )
			;import Standard Font Database first
			DisplayLine('Importing required standard font data ...')
			Command 'Font Tool',( Create, Import:Gps> )
		endif
		;import other font data next
		;save standard Gps font data
		Command Rename,'Gps>Font*.port','Save>Gps>Font*.port',y,n
		if ( fImagen )
			DisplayLine('Importing Imagen font data ...')
			Command 'Font Tool',( Create, Import:ExtraImagen> )
		endif
		if ( fHPCart )
			DisplayLine('Importing HP Cartridge font data ...')
			Command 'Font Tool',( Create, Import:HPCart> )
		endif
		if ( fAP9210 )
			DisplayLine('Importing AP9210 HP font data ...')
			Command 'Font Tool',( Create, Import:AP9210HP> )
		endif
		DisplayLine
		DisplayLine('Creating new font data files for reimport ...')
		DisplayLine
		Command 'Font Tool',ExportAll
		Command Rename,'Font*.port','Gps>Font*.port',y,n
	endif

	if ( fGenDB )
		Display( CLS )
		DisplayLine
		DisplayLine('	AE                                                      AA')
		DisplayLine('	AE           Generate a New RunTime Font Database      AA')
		DisplayLine('	AE                                                      AA')
		DisplayLine
		DisplayLine('	For each Font Device Type you wish to generate in the ')
		DisplayLine('	runtime font database, please mark the Gen? column ')
		DisplayLine('	with a Yes.  The UP and DOWN arrow keys will scroll ')
		DisplayLine('	the window for more Font Device Types.  Some printers ')
		DisplayLine('	can use more than one Font Device Type, but GPS device')
		DisplayLine('	drivers use only one of these at a time.              ')
		DisplayLine
		DisplayLine('	Please refer to the GPS R2.7.0 SRA for additional     ')
		DisplayLine('	information about selecting Font Device Types.        ')
		DisplayLine
		DisplayAndWait('	Press GO to proceed:')
		Spec2 = ConcatStrings( ToSys, 'GpsMakeFontDB.run' )
		Command Run,Spec2
		Command Rename,( FontFamily.tmp, FontDevice.tmp ),
			( Gps>FontFamily.port, Gps>FontDevice.port ),y,n

		Display( CLS )
		DisplayLine
		DisplayLine('Generating new runtime font database.  Please wait ...')
		DisplayLine
		Command 'Font Tool',( Create, Import:Gps>, Generate, ExportAll )
	endif

	if ( fGenDB )
		DisplayLine
		Display('AECopying runtime font database to ')
		Display(ToGps)
		Display(' ... ')
		Command LCopy,Font.dbs,,ToGps,,y,n
		DisplayLine('done.AA')
	endif
endif

Display( CLS )
DisplayLine
DisplayLine('	AE                                                           AA')
DisplayLine('	AE        Installation of GPS Basic Package Complete         AA')
if ( fMergeRq )
DisplayLine('	AE                                                           AA')
DisplayLine('	AE  Reboot the installation target system before using GPS.  AA')
DisplayLine('	AE                                                           AA')
endif
DisplayLine('	AE                                                           AA')
DisplayAndWait('	                Press any key to Finish')

END
;End GpsBasic
et',Spec,[SCR]<$>Rq.sys.txt,,8039h
		Command 'Make Request Set',([SCR]<$>Rq.sys.txt,Spec2),
			[SCR]<$>Reque