SaveVidLevel = VideoLevel
EchoOff


; vClusterLfsOs>Install.jcl
; Install the VirtualMode Cluster LFS Operating System subpackage

; Except for yesno strings  'First disk message' the following is the only 
; nationalizable string in this file.
ErrorMsg     = 'Cannot access vClusterLfsOs>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       = 'vClstrLfs.img'
ServerSpec   = ConcatStrings(DeviceFrom, DirectoryTo)
OsFromServer = ConcatStrings(ServerSpec, OsName)
FloppySpec   = ConcatStrings(DeviceFrom, '<CTOS>')
OsFrom       = ConcatStrings(FloppySpec, OsName)
ToSpec       = ConcatStrings(VolumeTo, DirectoryTo)
PublicOsTo   = ConcatStrings(ToSpec, OsName)
WsSpec       = ConcatStrings(DeviceFrom, '<ClstrLfs>*')
PrivateOsTo  = ConcatStrings(ToSpec, 'SysImage.sys')
EtcFromSpec  = ConcatStrings(DeviceFrom, '<OsInstall>')
PageService  = 'ps_v.sys'
ConfigFile   = 'Config.sys'
NlsKbdFile   = 'NlsKbd.sys'
OtherFiles   = ConcatStrings(EtcFromSpec, 'AllClstrCopy.fls')

If Public
   OsTo = PublicOsTo
Else
   OsTo = PrivateOsTo
Endif

If InstallType = FromFloppy
   NextFloppy(FirstDisk)
EndIf

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

If InstallType = FromServer
   If SaveVidLevel = TotalNoise
      EchoSome
   EndIf
   DisplayLine
   Command LCopy           ,
             PageService   ,
             ServerSpec    ,
             ToSpec        ,
                           ,
             Yes           ,
             No            ,
             No            ,
             Yes
   DisplayLine
   Command LCopy           ,
                           ,
              OsFromServer ,
              PrivateOsTo  ,
                           ,
              Yes          ,
              No           ,
              No           ,
              Yes
   DisplayLine
   Command LCopy         ,
              ConfigFile ,
              ServerSpec ,
              ToSpec     ,
                         ,
              No         ,
              No         ,
              No         ,
              Yes
   Msg = GetMsg(7)
   ConfigSpec = ConcatStrings(ToSpec, Msg)
   DisplayLine
   Command LCopy         ,
              ConfigFile ,
              ServerSpec ,
              ConfigSpec ,
                         ,
              Yes        ,
              No         ,
              No         ,
              Yes

   FileName = ConcatStrings(ToSpec, NlsKbdFile)
   Ver = FileVersion(FileName)
   If Ver <> '0'
      Msg = GetMsg(6)
      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(5)
         Display(Msg)
         Display(ToSpec)
         Msg = GetMsg(6)
         Display(Msg)
         DisplayLine(NlsKbdFile)
      EndIf
   EndIf
   DisplayLine
   Command LCopy         ,
              NlsKbdFile ,
              ServerSpec ,
              ToSpec     ,
                         ,
              Yes        ,
              No         ,
              No         ,
              Yes

   If SaveVidLevel = TotalNoise
      EchoOff
   EndIf

   GoTo ChkPkgs
Endif


; ********  INSTALL FROM FLOPPY....******************


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(7)
    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(6)
       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(5)
          Display(Msg)
          Display(ToSpec)
          Msg = GetMsg(6)
          Display(Msg)
          DisplayLine(NlsKbdFile)
       EndIf
    EndIf

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

    If FloppyType = Floppy5Qtr
       Diskette = GetMsg(9)
       NextFloppy(Diskette)
    EndIf

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


RestartLabel

ChkPkgs:
DisplayLine

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

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

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

EndIt:

End
