$Job XVT

lOn        = 0
lSome      = 1
lOff       = 2
FLOPPY     = 0
SERVER     = 2
TRUE       = 65535
NotFound   = 65535
FALSE      = 0
fromServ   = FALSE
;
; Translate the following text strings
createMsg   = 'Creating directory ...'
copyMsg     = 'Copying files ...'
cmdMsg      = 'Adding new commands ...'
requestMsg  = 'Adding new request codes ...'
doneMsg     = ' done.'
yesMsg      = 'yes'
noMsg       = 'no'
instCmd     = 'Install XVTCH 2.0 Service'
deinstCmd   = 'Deinstall XVTCH 2.0 Service'
; end text string translation

clearscrn  = ''
; initialization

vidSave = VideoLevel
echoOff

; warnings
DisplayLine(clearscrn)
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	     XVT Service 2.1.8 Installation             	AA')
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	This is the installation of the XVTCH          	AA')
DisplayLine('AF	system service.  The system service is used       	AA')
DisplayLine('AF	by XVT applications that require a service      	AA')
DisplayLine('AF	to provide a graphicsindependent user interface.  	AA')
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	For details on memory usage, installation and      	AA')
DisplayLine('AF	deinstallation instructions, as well as general    	AA')
DisplayLine('AF	information about this product, see the            	AA')
DisplayLine('AF	Software Release Announcement.                     	AA')
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	Press GO to continue with the installation.        	AA')
DisplayAndWait('AF	                                                   	AA')
DisplayLine(clearscrn)

$If (vidSave = lOn)
	$EchoOn
$EndIf

; VolumeTo is not defined for 12.0 installation manager installations.
ver = FileVersion('[Sys]<Sys>InstallMgr.run')
$If Substring('12.0',ver) <> TRUE
	VolumeTo = '[sys]'
$EndIf

toSys   =  ConcatStrings(VolumeTo, '<sys>')
fromSys =  ConcatStrings(DeviceFrom, '<sys>')

$If InstallType = SERVER 
	fromServ = TRUE
$EndIf

; copy files
$Display (copyMsg)

; set the destination path
destPath  =  ConcatStrings (VolumeTo, '<sys>')

$If FromServ
	$Command LCopy, (2.0>XvtNls.sys, 
					 2.0>XvtNlsKbd.tbl, 
					 2.0>XvtChMsg.bin, 
					 2.0>Xvt.hlp, 
					 2.0>Request.Xvt.sys, 
					 2.0>1024x768_146xvt.font, 
					 2.0>1024x768_80xvt.font, 
					 2.0>640x480_80xvt.font, 
					 2.0>132x29_CharXvt.font, 
					 2.0>132x34_CharXvt.font, 
					 2.0>720x348_80Xvt.font, 
					 2.0>80x29_CharXvt.font, 
					 2.0>80x34_CharXvt.font, 
					 2.0>XvtChService.run, 
					 2.0>DeinstallXvtChService.run), 
					 fromSys,
					 toSys,
					 ,
					 yesMsg,
					 noMsg,
					 noMsg,
					 yesMsg

$Else
	restSpec  =  ConcatStrings (DeviceFrom, '<ctos>XvtChService')
	destSpec  =  ConcatStrings ('\'', destPath)
	destSpec  =  ConcatStrings (destSpec, '\*\'')

	$EchoSome
	$DisplayLine(clearscrn)
	$DisplayLine(copyMsg)
	$Command Restore, restSpec, 
				  '<*>*', 
				  destSpec, 
				  yesMsg, 
				  noMsg
	$If (vidSave = lOn)
		$EchoOn
	$Else
		$EchoOff
	$EndIf
$Endif

$DisplayLine (doneMsg)

; create new commands

$Display (cmdMsg)
destFile = ConcatStrings(destPath, '2.0>XvtChService.run')
$Command New Command, instCmd, 
					  destFile, 
					  ,,yesMsg, 
					  '00', 
					  CmdFileTo

destFile = ConcatStrings(destPath, '2.0>DeinstallXvtChService.run')
$Command New Command, deinstCmd, 
					  destFile, 
					  ,,yesMsg, 
					  '00', 
					  CmdFileTo

$DisplayLine (doneMsg)

; merge request codes
$Display (requestMsg)

rq1 = ConcatStrings(VolumeTo, '<sys>Request.sys')
rq2 = ConcatStrings(VolumeTo, '<sys>2.0>Request.XVT.sys')
$Command List Request Set, (rq1, rq2), [scr]<$>request.txt
$Command Make Request Set, [scr]<$>request.txt, rq1
$DisplayLine (doneMsg)

$DisplayLine(clearscrn)

vidSave = VideoLevel
echoOff
DisplayLine(clearscrn)
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	     XVTCH Service Installation Complete         	AA')
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	This installation updated your request file, so    	AA')
DisplayLine('AF	you must reboot your workstation before installing 	AA')
DisplayLine('AF	the XVTCH Service in memory.                      	AA')
DisplayLine('AF	                                                   	AA')
DisplayLine('AF	      Press GO to complete the installation.       	AA')
DisplayAndWait('AF	                                                   	AA')
$End
