$Job MdSInstall

	$RestartLabel

	; this is a floppy install of Modem Service
    ; Modified 930802 s5.2.03 Aaron Coleman UCF 17426729  PLE 15990546
    ;     Assorted references to F0 replace by DeviceFrom

	; suppress video pause
		
	$PauseOff

	; nationalizable strings

	DefPrt = '[SPL]'
	CheckMsg = 'Checking configuration file ...'
	CommandMsg = 'Creating commands ...'
	cnfgmsg1 = '  '
	cnfgmsg2 = '                                                                  '
	cnfgmsg3 = '   If Modem Service has been previously installed on this system, '
	cnfgmsg4 = '      there may be a user customized configuration file already   '
	cnfgmsg5 = '      in existance.  If you wish to continue to use this file as  '
	cnfgmsg6 = '      the default file, please type the name of the file and its  '
	cnfgmsg7 = '      path in the space provided. Press GO to continue.           '
	cnfgmsg8 = '                                                                  '
	cnfgmsg9 = '  '
	Cnfgquest = 'Configuration File Name'
	CnfgMsg = 'Updating previous configuration file name ... '
	DevMsg = 'Copying development library ... '
	DevYesNoMsg = 'Do you wish to use the Modem Services development library?'
	DoneMsg = ' done.'
	FloppyMsg = 'Copying files from floppy ...'	
	FLoppyMsg2 = 'Copying Configuration file from floppy ... '
	InstDoneMsg = 'When installation is completed, please reboot your system.'
	MergeMsg = 'Updating system files ...'
	PtrNameMsg = 'Enter your printer name and Press GO.'
	RifViewMsg = 'Do you wish to view the Release Notes at this time?'
	RifPrintMsg = 'Do you wish to print the Release Notes at this time?'
	RemovingMsg = 'Removing Old Files ...'
	Removing2Msg = 'Removing Old Commands ...'
	
	; initialize variables
	
	TRUE = 1
	FALSE = 0
	CLSTRLFS = 2

	;notify users of installation
	
	;$Sendmail(admin, 'Installation of Modem Services','Version 5.3')
	;$BroadcastMessage('Installation of Modem Services', 'Version 5.3')

	$RestartLabel
			$If VideoLevel>0
			VidLev = 1
			$EndIf
	RIFView = UserSelectYesNo(RIFViewMsg,Yes)

;
;	The command Copy must be translated to the local language.
;
          $If RIFView 
				$PauseOn
;				$EchoOn
				Relnotes = ConcatStrings(DeviceFrom,'<sys>ReLeaseNotes.doc')
				$Command Copy,Relnotes,[VID],
                		$If VidLev>0
;	               		$EchoOff
                		$PauseOff
                		i = 0
                         $While i < 20
                              i = i + 1
                              $DisplayLine
                         $EndWhile
                         $EndIf
               $PauseOff
          $EndIf



	RIFPrint = UserSelectYesNo(RIFPrintMsg)

	$If RIFPrint
		PrintName = $UserEnterValue(PtrNameMsg,DefPtr)
;
;	The command Copy must be translated to the local language.
;
			RelNotes = ConcatStrings(DeviceFrom,'<sys>ReleaseNotes.doc')
			$Command copy,RelNotes,PrintName
	$EndIf

	$RestartLabel


	$If Public 
		MasterSpec = '[Sys]<Sys>'
		DestPath = MasterSpec
		DefVol = '[Sys]'
	$Else
		LocalSpec = '[Sys]<Sys>'
		DestPath = LocalSpec
		DefVol = '[Sys]'

	$EndIf

	$If Public
		CmdFileTo = '[Sys]<sys>Cluster.cmds'
	$EndIf	

	; see if the user wants the development library
	
	InstallLib = UserSelectYesNo(DevYesNoMsg)

	; scroll twentyfive lines on the screen
	i = 0
	$While (i < 25)
		i = i + 1
		$DisplayLine
	$EndWhile

	$DisplayLine (cnfgmsg1)
;	$DisplayLine (cnfgmsg2)
	$DisplayLine (cnfgmsg3)
	$DisplayLine (cnfgmsg4)
	$DisplayLine (cnfgmsg5)
	$DisplayLine (cnfgmsg6)
	$DisplayLine (cnfgmsg7)
;	$DisplayLine (cnfgmsg8)
	$DisplayLine (cnfgmsg9)

	$RestartLabel

	OverConfig = UserEnterValue(Cnfgquest,' ')

	$Path ,DeviceFrom, Sys

	; copy files from floppy  

	; scroll twelve lines on the screen
	i = 0
	$While (i < 12)
		i = i + 1
		$DisplayLine
	$EndWhile


	$Display (FloppyMsg)
	$Run [Sys]<sys>LCopy.run,<Unisys>*.run,,DestPath,,y,,no
	$DisplayLine (DoneMsg)

	$If Public
	$Run [Sys]<sys>LCopy.run,(<sys>Request.Modem.sys, <Unisys>*bin, <Unisys>*.modems, <Unisys>*.form),,[Sys]<Sys>,,y,,no
	$Else
	$Run [Sys]<sys>LCopy.run,(<sys>Request.Modem.sys, <Unisys>*bin, <Unisys>*.modems, <Unisys>*.form),,[Sys]<Sys>,,y,,no

	$EndIf

$Dump
	
	$Display (CheckMsg)

	$If OverConfig <> ' '
	
	$DisplayLine (DoneMsg)

	$Display (CnfgMsg)

	CnfgSpec = $ConcatStrings(DestPath,'ModemService.config')
;
;Nationalize the word 'save' in the following command
;
	SaveSpec = $ConcatStrings(DestPath,'save.')
;
;Nationalize the following copy command
;
	$Command Copy,overconfig,CnfgSpec,y,n
	$Run [Sys]<Sys>Lcopy.run,<Unisys>ModemService.config,,SaveSpec,,y,,no

	$DisplayLine (DoneMsg)

	$Else
	$DisplayLine (DoneMsg)

	$Display (FLoppyMsg2)
	$Run [Sys]<Sys>Lcopy.run,<Unisys>ModemService.config,,DestPath,,y,,no
	$DisplayLine (DoneMsg)
	$EndIf

	; removing old modemserver run files and commands


	$Display (RemovingMsg)

;Nationalize the following Delete commands

	$Command Delete,[Sys]<Sys>ModemServer.Run,no
	$Command Delete,[Sys]<Sys>ModemServerStatus.Run,no
	$Command Delete,[Sys]<Sys>DeInstallModemServer.Run,no

	$DisplayLine (DoneMsg)

	$Display (Removing2Msg)

	$Run ([Sys]<Sys>CmdFileEditor.run, 'Remove Command', 'RC'), 
		'Modem Server Status', CmdFileTo
	$Run ([Sys]<Sys>CmdFileEditor.run, 'Remove Command', 'RC'), 
		'Install Modem Server', CmdFileTo
	$Run ([Sys]<Sys>CmdFileEditor.run, 'Remove Command', 'RC'), 
		'Deinstall Modem Server', CmdFileTo

	$DisplayLine (DoneMsg)

	; merge request files with local request file

	$RestartLabel

	$Display (MergeMsg)
	$Run [Sys]<sys>ListRqSet.run,([sys]<sys>request.sys,  
			[Sys]<sys>Request.Modem.sys), [scr]<$>x
	$Run [Sys]<sys>MakeRqset.run, [scr]<$>x, [Sys]<sys>request.sys
	$DisplayLine (DoneMsg)

	; if the user wants the library, copy it local 
	$If InstallLib 
		$Display (DevMsg)
		$Run [Sys]<sys>LCopy.run, <Unisys>RqLablModem.Lib,,LocalSpec,,y,,no
		$DisplayLine (DoneMsg)
	$EndIf

	; merge Modem Service command file with user selected command file

	$RestartLabel

	$Display (CommandMsg)
	Mdm = ConcatStrings(DeviceFrom,'<sys>mdm.cmds')
	$Run ([Sys]<Sys>CmdFileEditor.run, 'Merge Command Files', 'MC'), 
		Mdm, CmdFileTo, yes, DefVol
	$DisplayLine (DoneMsg)
	i = 0
	$While (i < 20)
		i = i + 1
		$DisplayLine
	$EndWhile
	$Displayline (InstDoneMsg)

	i = 0
	$While (i < 10)
		i = i + 1
		$DisplayLine
	$EndWhile


	$Path ,Sys, Sys
	$PauseOn	

$END
 $While i < 20
                              i = i + 1
                              $DisplayLine
                         $EndWhile
                         $EndIf
               $PauseOff
          $EndIf



	RIFPrint = UserSelectYesNo(RIFPrintMsg)

	$If RIFPrint
		PrintName = $UserEnterValue(PtrNameMsg,DefPtr)
;