SaveVidLevel = VideoLevel
EchoOff

; B27ClusterLfsOs>Install.jcl
; Install the B27 RealMode Cluster LFS Operating System subpackage

; Except for yesno strings, these two messages are the only nationalizable
; strings in this file.
ErrorMsg     = 'Cannot access B27ClusterLfsOs>InstallMsg.bin'
FirstDisk    = 'Real Mode OS Diskette 3 of 4 (B25R343)'

FromFloppy   = 0
FromServer   = 2
TotalNoise   = 0
TotalSilence = 2
NotFound     = 65535
ClearScreen  = 'PF'

If SaveVidLevel = TotalNoise
   Display(ClearScreen)
EndIf

OsName       = 'bAwsClstrLfs.run'
FontName     = 'bAwsSys.font'
ServerSpec   = ConcatStrings(DeviceFrom, DirectoryTo)
OsFromServer = ConcatStrings(ServerSpec, OsName)
FontFromSrvr = ConcatStrings(ServerSpec, FontName)
FloppySpec   = ConcatStrings(DeviceFrom, '<CTOS>')
OsFrom       = ConcatStrings(FloppySpec, OsName)
FontFrom     = ConcatStrings(FloppySpec, FontName)
ToSpec       = ConcatStrings(VolumeTo, DirectoryTo)
PublicOsTo   = ConcatStrings(ToSpec, OsName)
PublicFontTo = ConcatStrings(ToSpec, FontName)
PublicWsTo1  = ConcatStrings(ToSpec, 'Ws125>SysImage.sys')
PublicWsTo2  = ConcatStrings(ToSpec, 'Ws126>SysImage.sys')
PrivateOsTo  = ConcatStrings(ToSpec, 'SysImage.sys')
PrivatFontTo = ConcatStrings(ToSpec, FontName)
EtcFromSpec  = ConcatStrings(DeviceFrom, '<OsInstall>')
ConfigFile   = 'Config.sys'
NlsKbdFile   = 'NlsKbd.sys'

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           ,
                           ,
              OsFromServer ,
              PrivateOsTo  ,
                           ,
              Yes          ,
              No           ,
              No           ,
              Yes
   Command LCopy           ,
                           ,
              FontFromSrvr ,
              PrivatFontTo ,
                           ,
              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 ,
                         ,
              No         ,
              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

If SaveVidLevel = TotalNoise
   EchoSome
EndIf
DisplayLine
Command LCopy          ,
           ConfigFile  ,
           EtcFromSpec ,
           ToSpec      ,
                       ,
           No          ,
           No          ,
           No          ,
           Yes
Msg = GetMsg(7)
ConfigSpec = ConcatStrings(ToSpec, Msg)
DisplayLine
Command LCopy          ,
           ConfigFile  ,
           EtcFromSpec ,
           ConfigSpec  ,
                       ,
           No          ,
           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
If SaveVidLevel = TotalNoise
   EchoOff
EndIf

If Public
   OsTo = PublicOsTo
   FontTo = PublicFontTo
Else
   OsTo = PrivateOsTo
   FontTo = PrivatFontTo
Endif

If SaveVidLevel = TotalNoise
   EchoSome
EndIf
DisplayLine
Command LCopy     ,
                  ,
           OsFrom ,
           OsTo   ,
                  ,
           Yes    ,
           No     ,
           No     ,
           Yes

Command LCopy     ,
                  ,
           FontFrom ,
           FontTo   ,
                  ,
           Yes    ,
           No     ,
           No     ,
           Yes

If SaveVidLevel = TotalNoise
   EchoOff
EndIf

If Public
   If SaveVidLevel = TotalNoise
      EchoSome
   EndIf
   DisplayLine
   Command LCopy                        ,
                                        ,
              OsFrom                    ,
              (PublicWsTo1,PublicWsTo2) ,
                                        ,
              Yes                       ,
              No                        ,
              No                        ,
              Yes
   If SaveVidLevel = TotalNoise
      EchoOff
   EndIf
EndIf

ChkPkgs:
DisplayLine

;B24 Debugger
Pkg = GetMsg(2)
If SubString(Pkg, Pkgs) <> NotFound
   Diskette = GetMsg(1)
   NextFloppy(Diskette)
   GoTo EndIt
EndIf

;B26 Debugger
Pkg = GetMsg(3)
If SubString(Pkg, Pkgs) <> NotFound
   Diskette = GetMsg(1)
   NextFloppy(Diskette)
   GoTo EndIt
EndIf

;B27 Debugger
Pkg = GetMsg(4)
If SubString(Pkg, Pkgs) <> NotFound
   Diskette = GetMsg(1)
   NextFloppy(Diskette)
   GoTo EndIt
EndIf

EndIt:

End
