SaveVidLevel = VideoLevel
EchoOff

; vClusterOs>Install.jcl
; Install the VirtualMode Cluster Operating System subpackage

; Except for yesno strings  'First disk message' the following is the only 
; nationalizable string in this file.
ErrorMsg     = 'Cannot access vClusterOs>InstallMsg.bin'

FromCD       = 5
FromFloppy   = 0
FromServer   = 2
FloppyType   = 0
Floppy5Qtr   = 1
Floppy3Half  = 4
NotFound     = 65535
TotalNoise   = 0

If InstallType = FromFloppy
   FloppyType  = DeviceType(DeviceFrom)
EndIf

; The following message is nationalizable
If FloppyType = Floppy5Qtr
   FirstDisk  = 'Virtual Mode OS Diskette 1 of 6 (B25V1016)'
Else 
   If FloppyType = Floppy3Half
      FirstDisk  = 'Virtual Mode OS Diskette 1 of 3 (B25V1013)'
   EndIf
EndIf

OsName       = 'vClstr.img'
FloppySpec   = ConcatStrings(DeviceFrom, '<CTOS>')
OsFrom       = ConcatStrings(FloppySpec, OsName)
ToSpec       = ConcatStrings(VolumeTo, DirectoryTo)
PublicOsTo   = ConcatStrings(ToSpec, OsName)
WsSpec       = ConcatStrings(DeviceFrom, '<Clstr>*')
EtcFromSpec  = ConcatStrings(DeviceFrom, '<OsInstall>')
ConfigFile   = 'Config.sys'
NlsKbdFile   = 'NlsKbd.sys'
OtherFiles   = ConcatStrings(EtcFromSpec, 'AllClstrCopy.fls')


If InstallType = FromFloppy
   NextFloppy(FirstDisk)
EndIf

InitErc = InitMsgFile(MsgFile)
If InitErc <> 0
   DisplayLine(ErrorMsg)
   Cancel
EndIf

If InstallType = FromServer
   Msg = GetMsg(4)
   DisplayLine(Msg)
   DisplayLine
   Msg = GetMsg(6)
   DisplayAndWait(Msg)
   Cancel    
;GoTo ChkPkgs
EndIf

If Not Public
   Msg = GetMsg(5)
   DisplayLine(Msg)
   DisplayLine
   Msg = GetMsg(6)
   DisplayAndWait(Msg)
   Cancel
;GoTo ChkPkgs
EndIf


If InstallType = FromFloppy

   If SaveVidLevel = TotalNoise
      EchoSome
   EndIf

   DisplayLine
   Command LCopy           ,
              @OtherFiles  ,
              EtcFromSpec  ,
              ToSpec       ,
                           ,
              Yes          ,
              No           ,
              No           ,
              Yes
    DisplayLine
    Command LCopy          ,
               ConfigFile  ,
               EtcFromSpec ,
               ToSpec      ,
                           ,
               No          ,
               No          ,
               No          ,
               Yes

    Msg = GetMsg(12)
    ConfigSpec = ConcatStrings(ToSpec, Msg)
    DisplayLine

    Command LCopy          ,
               ConfigFile  ,
               EtcFromSpec ,
               ConfigSpec  ,
                           ,
               Yes         ,
               No          ,
               No          ,
               Yes

    FileName = ConcatStrings(ToSpec, NlsKbdFile)
    Ver = FileVersion(FileName)
    If Ver <> '0'
       Msg = GetMsg(11)
       SaveSpec = ConcatStrings(ToSpec, Msg)
       FileName = ConcatStrings(SaveSpec, NlsKbdFile)
       Ver = FileVersion(FileName)
       If Ver = '0'
          DisplayLine
          Command LCopy         ,
                     NlsKbdFile ,
                     ToSpec     ,
                     SaveSpec   ,
                                ,
                     No         ,
                     No         ,
                     No         ,
                     Yes
          DisplayLine
          Msg = ConcatStrings(ToSpec, NlsKbdFile)
          Display(Msg)
          Msg = GetMsg(10)
          Display(Msg)
          Display(ToSpec)
          Msg = GetMsg(11)
          Display(Msg)
          DisplayLine(NlsKbdFile)
       EndIf
    EndIf
    DisplayLine

    Command LCopy          ,
               NlsKbdFile  ,
               EtcFromSpec ,
               ToSpec      ,
                           ,
               Yes         ,
               No          ,
               No          ,
               Yes

    Command LCopy         ,
                          ,
               OsFrom     ,
               PublicOsTo ,
                          ,
               Yes        ,
               No         ,
               No         ,
               Yes

    DisplayLine
    Command LCopy     ,
               WsSpec ,
                      ,
               ToSpec ,
                      ,
               Yes    ,
               No     ,
               No     ,
               Yes
   If SaveVidLevel = TotalNoise
      EchoOff
   EndIf
EndIf
;       ****** End FromFloppy stuff *******


ChkPkgs:
DisplayLine

;Next SubPackage:    vClstrLfs OS 
Pkg = GetMsg(7)
If SubString(Pkg, Pkgs) <> NotFound
   GoTo EndIt
EndIf

;Next SubPackage:    vSrvr OS 
Pkg = GetMsg(8)
If SubString(Pkg, Pkgs) <> NotFound
   If FloppyType = Floppy5Qtr
      Diskette = GetMsg(2)
      NextFloppy(Diskette)
   Else
      If FloppyType = Floppy3Half
         Diskette = GetMsg(14)
         NextFloppy(Diskette)
      EndIf
   EndIf
   GoTo EndIt
EndIf

;Next SubPackage:    vStnd OS 
Pkg = GetMsg(16)
If SubString(Pkg, Pkgs) <> NotFound
   If FloppyType = Floppy5Qtr
      Diskette = GetMsg(3)
      NextFloppy(Diskette)
   Else
      If FloppyType = Floppy3Half
         Diskette = GetMsg(14)
         NextFloppy(Diskette)
      EndIf
   EndIf
   GoTo EndIt
EndIf

;Next SubPackage:    vDebugger 
Pkg = GetMsg(9)
If SubString(Pkg, Pkgs) <> NotFound
   If FloppyType = Floppy5Qtr
      Diskette = GetMsg(17)
      NextFloppy(Diskette)
   Else
      If FloppyType = Floppy3Half
         Diskette = GetMsg(15)
         NextFloppy(Diskette)
      EndIf
   EndIf
   GoTo EndIt
EndIf

EndIt:

End
