/*
 * INSTALL.DAT part 1 of 2, U.S. English with Express Lite (Popsicle)
 *
 * Project: IBM 5250 Express Installation Program
 * Version: 2.03, 12/11/97
 *
 */

/**************************************************************************
*  Project Information                                                    *
***************************************************************************/
@DefineProject
  @Name = "IBM 5250 Express Installation Program"
        @Version = "2.03"
        @Immediate = @True

  @Subdir = "\\"
  @OutDrive = C
@EndProject

/**************************************************************************
*  Variables                                                              *
***************************************************************************/

@DefineVars
  @QString @TempStr = ""
  @QString @TempStr1 = ""
  @QString @TempStr2 = ""
  @Integer @TempLen = 0
  @QString @TempPath = ""
  @Integer @PnpMskMode = 0

//@Integer @NewDate = 827619200              // 3/23/96 date
  @Drive   @DriveOfFile = C                  // vars for know dyn pathfind
  @Dir     @PathOfFile = "\\"
  @Integer @Func1 = 0                        // vars for know dyn pleasewait
  @Integer @Func2 = 0
  @QString @TempString = ""
  @Integer @TempInt1 = 0
  @Integer @TempInt2 = 0
  @Integer @TempInt3 = 0
  @QString @DosSUpDir = ""
  @Dir     @StrtDir = "\\"
  @QString @StartPath = ""
  @QString @StrSUpDrive = ""                  // used to see if started from a:

  @Drive @SaveStartDrive                       // for W95 losing CWD?
  @Dir @SaveStartDir = ""

  @Drive   @Chkdrive = C

  @Integer @LangDatSize = 90150
  @Integer @MsgDatSize = 13200
  @Integer @EnhdenbSize = 13350                // icicle update file sizes
  @Integer @DpunloadSize = 1000
  @Integer @Dp5250Size = 49155
  @Integer @Prt5250Size = 50180
  @Integer @E5250ahSize = 26500                // CA DOS PCI driver
  @Integer @VdnswqSize = 37280                 // CA W95 mapper
  @Integer @PdlwatwvSize = 69720               // CA W95 driver
  @Integer @CwbwatsnSize = 39200               // CA W95 driver mod3
  @Integer @TwxexpSize = 30720                 // CA eds reg tool
  @Integer @CwbvlogSize = 70150                // CA W95 debug tool
  @Integer @CwbvdlogSize = 29110               // CA W95 debug tool
  @Integer @IbmtwxsnSize = 53250               // CA WNT driver mod3
  @Integer @IbmtwxSize = 20610               // CA WNT driver mod3
  @Integer @SettwxSize = 239620                // CA WNT gui tool
  @Integer @SettwxtxtSize = 4050               // CA WNT gui tool help
  @Integer @VdtwinxSize = 41000                // CA W3.1x driver
  @Integer @NswqSize = 4000                    // CA W3.1x
  @Integer @Vdnswq386Size = 9400               // CA W3.1x
  @Integer @LdmcaahsSize = 770                 // CA/DOS/PC Card
  @Integer @SfdenabSize = 14780
  @Integer @Enb5250Size = 22280
  @Integer @McabasahSize = 19320
  @Integer @McabasnsSize = 19320
  @Integer @McaextahSize = 19290
  @Integer @McaextnsSize = 19290
  @Integer @McapcsSize = 20
  @Integer @PdlwatwvPcmSize = 70800            // PComm W95 driver
  @Integer @Vtdlcd386Size = 39550              // PComm W 3.1x driver
  @Integer @LangidSize = 7680
  @Integer @PcstdlcBotSize = 230
  @Integer @5250LiteSize = 48520               // Popsicle files
  @Integer @USEProSize = 900
  @Integer @5250LiteDocSize = 7200
  @Integer @LitePifSize = 550
  @Integer @HwcfgPifSize = 550
  @Integer @TrainIcoSize = 770
  @Integer @PnpreadSize = 23900                // 2.03 Johnny debug tools
  @Integer @PcidebugSize = 98000

  @Integer @English = 1                         // drt 6/09/97 added for NLS
  @Integer @French = 2                          // from language.dat file
  @Integer @German = 3                          // for localereplacemsg's
  @Integer @Spanish = 4
  @Integer @Italian = 5
  @Integer @Japan = 6
  @Integer @OEM = 0
  @Integer @ANSI = 1
  @Integer @JIS = 2
  @Integer @BIDI = 3

  @Dir     @TempInstDir = ""                   // drt to be used to create
  @QString @DirTmp  = "tmp"                    // a new directory
  @QString @DirVar1 = "0"                      // init to 0's
  @QString @DirVar2 = "0"
  @QString @DirVar3 = "0"

  @Integer @Inst = 500                         // for getoption boxes
  @Integer @UserExit = 501                     // for getoption boxes
  @Integer @Cont = 502                         // for getoption boxes
  @Integer @Keep = 600                         // for getoption boxes
  @Integer @UserDelete = 601                   // for getoption boxes

  @Integer @Dos = @False                        // which OS want to install
  @Integer @Os2 = @False                        // support for
  @Integer @Win31 = @False
  @Integer @Win95 = @False
  @Integer @Winnt351 = @False
  @Integer @Winnt40 = @False

  @Integer @Isa = @False                        // which adapter selected
  @Integer @Pcmcia = @False
  @Integer @Pci = @False
  @Integer @IsaNonPnP = @False

  @Integer @CASelble = @False                  // which sels valid for OS
  @Integer @PComSelble = @False                // & adapter selected
  @Integer @IceUpSelble = @False
  @Integer @PopSelble = @False

  @Integer @CASelectd = @False                  // which option selected to
  @Integer @PComSelectd = @False                // install
  @Integer @IceUpSelectd = @False
  @Integer @PopSelectd = @False
  @Integer @ASpptSelectd = @False
  @QString @AdapterSelectd = ""
  @QString @SpptSelectd = ""

  @Integer @CAInstd = @False                    // what was successfully
  @Integer @PCommInstd = @False                 // installed
  @Integer @IceUpInstd = @False
  @Integer @PopInstd = @False
  @Integer @ASpptInstd = @False

  @Integer @StartHwcfg = @False                 // for cfgs that need to start it

  @Drive @SelDrive = @BootDrive                 // used in ChangeHardDisk
  @Dir @SelDir = "\\"                           // used in ChangeSubDir

  @QString @Stanza = ""                         // used to search winini
  @QString @PathFromIni = ""                    // path from winini
  @Drive   @IniDrv = C
  @Dir     @IniDir = "\\"

  @QString @TempLine = ""                       // in ProcABat to add
  @Integer @ModAbat = @False                    // enb5250.exe for PC Card, 3.1

  @Integer @CADosPciFirstTime = @True           // vars for CA DOS PCI
  @Integer @E5250ahFound = @False
  @Integer @E5250ahDateOk = @False
  @QString @OldE5250ah = ""

  @Integer @CADosPcmciaFirstTime = @True         // vars for CA DOS PC Card
  @Integer @PrereqFound = @False
  @Integer @StartpcsinAbat = @False
  @Integer @StartPos = 0
  @Integer @Enb5250First = @False
  @Integer @Enb5250Found = @False
  @Drive   @StartpcsDrv = C
  @Dir     @StartpcsDir = "\\"
  @Drive   @Enb5250Drv = C
  @Dir     @Enb5250Dir = "\\"
  @Drive   @Ahmr0Drv = C
  @Dir     @Ahmr0Dir = "\\"
  @Integer @Ahmr0Found = @False
  @Integer @EditStartpcs = @False
  @Integer @CADosK = @False
  @QString @OldStartpcs = ""

  @QString @CAwin = "CAWIN"                   // vars for CA 3.1x
  @Integer @CAFound = @False
  @Integer @CADateOK = @False
  @QString @OldVdtwinx = ""
  @QString @OldNswq = ""
  @QString @OldVdnswq = ""
  @QString @OldVdnswq2 = ""

  @Integer @WinRegStatus = 0                    // vars for CA W95
  @QString @LineRead = ""
  @Integer @EOF = 0
  @Integer @LinesCopied = 0
  @Integer @BlankLineFound = @False
  @Integer @SystemIniModified = @False
  @Integer @AutoexecBatModified = @False
  @Integer @DeleteAutoexecBat = @False
  @Integer @ConfigSysModified = @False
  @Integer @DeleteConfigSys = @False
  @Integer @ExecuteAddNewHardware = @False
  @QString @SChar1 = "I"
  @QString @SChar2 = "0"
  @QString @SChar3 = "1"
  @QString @OldSystemIni = ""
  @QString @OldAutoexecBat = ""
  @QString @OldConfigSys = ""
  @Integer @LineNumber = 0
  @QString @LineNumber1 = ""
  @QString @LineNumber2 = ""
  @QString @LineNumber3 = ""
  @QString @LineNumber4 = ""
  @Integer @KeyHandle = 0
  @Integer @SubkeyIndex = 0
  @QString @Subkey = ""
  @Integer @SubkeyIndex2 = 0
  @QString @Subkey2 = ""
  @Integer @SubkeyHandle = 0
  @Integer @ValueIndex = 0
  @QString @InfVersion = ""
  @Integer @IBM5250Count = 0
  @QString @TempString1 = ""
  @QString @TempString2 = ""
  @QString @TempString3 = ""
  @QString @TempString4 = ""
  @Integer @KeepExistingFlag = @False
  @QString @IsISAFlag        = ""
  @QString @TmpNote1    =  ""
  @QString @TmpNote2    =  ""
  @QString @OldHardwareID = "*IBM5250.isa"        // dh's vars
  @Integer @RtnCode = 0

  @Integer @CAM0 = @False                         // drt added vars for
  @Integer @CAM1 = @False                         // ca win95 vers 2.02
  @Integer @AtleastCAM2 = @False                  // need to distinguish
  @Integer @CAM3 = @False                         // ca vers.
  @Integer @StartCAInst = @False
  @Integer @CAInstTools = @False
  @QString @CAInstPath = ""
  @QString @OldCwbwatsn = ""
  @QString @OldCwbwatsn2 = ""
  @QString @CAKey = "SOFTWARE\\IBM\\Client Access\\CurrentVersion"
  @QString @CARegEDSKey = "SOFTWARE\\IBM\\Twinax"
  @QString @CARegEDSName = "ExpressDataStream"
  @QString @CARegEDSVal = ""
  @Integer @CARegEDSSize = 4
  @Integer @CARegEDSDisp = 0
  @Integer @CAHandle = 0
  @QString @CAVersion = ""
  @QString @CARelease = ""
  @QString @CAModif = ""
  @Integer @CwbwatsnExists = @False

  @QString @OldIbmtwx = ""                         // drt CA, WIN NT vars
  @QString @OldIbmtwxsn = ""                       // vers 2.02
  @QString @OldIbmtwx2 = ""                        // CA, WIN NT for
  @QString @OldIbmtwxsn2 = ""                      // switching m2/m3 drivers

//@QString @PCommKey = "SOFTWARE\\IBM\\Personal Communications\\CurrentVersion\\VersionNumber"
  @QString @PCommKey = "SOFTWARE\\IBM\\Personal Communications\\CurrentVersion"
  @Integer @PCommHandle = 0                     // vars for Pcomm W95
  @Integer @PComm41x = @False                   // if find vers 4.1 or 4.11
  @Integer @PComm42x = @False                   // if find vers 4.2
  @Integer @PCommPreReq = @True                 // if don't find 4.1x or 4.2
  @Integer @PCommFound = @True                  // if have reg problems
  @Integer @PCommDateOK = @True                 // ck date of installed .vxd
  @QString @VersionNumber = ""
  @QString @ValueName = ""
  @QString @OldPdlwatwv = ""

  @QString @Pcswin = "PCSWIN"                   // vars for PComm 3.1x
  @QString @OldVtdlcd = ""
  @Integer @PCommEng = @False
  @Integer @PCommBrazilian = @False
  @Integer @PCommChinaS = @False
  @Integer @PCommChinaT = @False
  @Integer @PCommFrench = @False
  @Integer @PCommGerman = @False
  @Integer @PCommItalian = @False
  @Integer @PCommJapanese = @False
  @Integer @PCommKorean = @False
  @Integer @PCommSpanish = @False
  @Integer @PCommSwedish = @False

  @Integer @Ret = 0                             // vars after calling
  @Integer @FoundPcstdlcStanza = @False         // @ProcPcstdlc
  @Integer @ModPcstdlc = @False                 // PComm and CA 3.1x
  @QString @OldPcstdlc = ""

  @Integer @dp5250DateOK = @False               // vars for Icicle update
  @Integer @dp5250Found = @False
  @QString @Dp5250Date = ""
  @Integer @IceFirstTime = @True                // whether to getpath or not

  @QString @ItemPath = ""                           // vars for Popsicle
  @QString @Item = ""
  @QString @ItemName = "IBM 5250 Express"
  @QString @IconPath = ""


  @QString @Msg4 = ""
  @QString @Msg5 = ""
  @QString @Msg6 = ""
  @QString @Msg7 = ""
  @QString @Msg7a = ""
  @QString @Msg7b = ""
  @QString @Msg8 = ""
  @QString @Msg9 = ""
  @QString @Msg11a = ""
  @QString @Msg11b = ""
  @QString @Msg11c = ""
  @QString @Msg12a = ""
  @QString @Msg12b = ""
  @QString @Msg13a = ""
  @QString @Msg13b = ""
  @QString @Msg14a = ""
  @QString @Msg14b = ""
  @QString @Msg15 = ""
  @QString @Msg16 = ""
  @QString @Msg16b = ""
  @QString @Msg22 = ""
  @QString @Msg23 = ""
  @QString @Msg24 = ""
  @QString @Msg25 = ""
  @QString @Msg25a = ""
  @QString @Msg25b = ""
  @QString @Msg25c = ""
  @QString @Msg27 = ""
  @QString @Msg28 = ""
  @QString @Msg30 = ""
  @QString @Msg30a = ""
  @QString @Msg30b = ""
  @QString @Msg31a = ""
  @QString @Msg31b = ""
  @QString @Msg31c = ""
  @QString @Msg31d = ""
  @QString @Msg31e = ""
  @QString @Msg32 = ""
  @QString @Msg33 = ""
  @QString @Msg34 = ""
  @QString @Msg36 = ""
  @QString @Msg37 = ""
  @QString @Msg37a = ""
  @QString @Msg37b = ""
  @QString @Msg37c = ""
  @QString @Msg37d = ""
  @QString @Msg38 = ""
  @QString @Msg39 = ""
  @QString @Msg39b = ""
  @QString @Msg39c = ""
  @QString @Msg39d = ""
  @QString @Msg40 = ""
  @QString @Msg35 = ""
  @QString @Msg41 = ""
  @QString @Msg41a = ""
  @QString @Msg41b = ""
  @QString @Msg41c = ""
  @QString @Msg41d = ""
  @QString @Msg42a = ""
  @QString @Msg42b = ""
  @QString @Msg42c = ""
  @QString @Msg42d = ""
  @QString @Msg42e = ""
  @QString @Msg42f = ""
  @QString @Msg42g = ""
  @QString @Msg42h = ""
  @QString @Msg43 = ""
  @QString @Msg44 = ""
  @QString @Msg44a = ""
  @QString @Msg44b = ""
  @QString @Msg44c = ""
  @QString @Msg44d = ""
  @QString @Msg44e = ""
  @QString @Msg45 = ""
  @QString @Msg46 = ""
  @QString @Msg47a = ""
  @QString @Msg47b = ""
  @QString @Msg47c = ""
  @QString @Msg47d = ""
  @QString @Msg47e = ""
  @QString @Msg47f = ""
  @QString @Msg47g = ""
  @QString @Msg48 = ""
  @QString @Msg49 = ""
  @QString @Msg50 = ""
  @QString @Msg51 = ""
  @QString @Msg52 = ""
  @QString @Msg53a = ""
  @QString @Msg53b = ""
  @QString @Msg53c = ""
  @QString @Msg53d = ""
  @QString @Msg53e = ""
  @QString @Msg54 = ""
  @QString @Msg55 = ""
  @QString @Msg56 = ""
  @QString @Msg57 = ""
  @QString @Msg58 = ""
  @QString @Msg58b = ""
  @QString @Msg59 = ""
  @QString @Msg59b = ""
  @QString @Msg59c = ""
  @QString @Msg59d = ""
  @QString @Msg59e = ""
  @QString @Msg60 = ""
  @QString @Msg60a = ""
  @QString @Msg60b = ""
  @QString @Msg61 = ""
  @QString @Msg62a = ""
  @QString @Msg62b = ""
  @QString @Msg62c = ""
  @QString @Msg63 = ""
  @QString @Msg63b = ""
  @QString @Msg63c = ""
  @QString @Msg63d = ""
  @QString @Msg64 = ""
  @QString @Msg64b= ""
  @QString @Msg65 = ""
  @QString @Msg65b = ""
  @QString @Msg66a = ""
  @QString @Msg66b = ""
  @QString @Msg67 = ""
  @QString @Msg68 = ""
  @QString @Msg69 = ""
  @QString @Msg70 = ""
  @QString @Msg71 = ""
  @QString @Msg72 = ""
  @QString @Msg73 = ""
  @QString @Msg74 = ""
  @QString @Msg75 = ""
  @QString @Msg76 = ""
  @QString @Msg77 = ""
  @QString @Msg77a = ""
  @QString @Msg77b = ""
  @QString @Msg78 = ""
  @QString @Msg79 = ""

@EndVars

@LocaleActiveLanguage = @English                       // include eng msgs
@IncludeScript("LANGUAGE.DAT")
@LocaleReinitialize()
@FlushOptions()
@IncludeScript("MESSAGE.DAT")
@LocaleReinitialize()
@FlushOptions()

// check ibm5250.log and if over 50K ask user if wants to append or start new
@RtnCode = (@FileSize("@BootDrive:\\ibm5250.log"))
@If (@RtnCode == -1)                                   // if log file not there
     @Write("@BootDrive:\\ibm5250.log", "wt", "")      // start new log file
     @Write("@BootDrive:\\ibm5250.log",,
            "@DateToStr(@SystemDate)  Start @Name @Version\n")
     @Write("@BootDrive:\\ibm5250.log",,
            "@DateToStr(@SystemDate)  Log file did not exist, start new\n")
@ElseIf (@RtnCode > 50000)                             // if log file > 50K
     @GetOption
       @Cls
@Msg77
       @If(@Platform > 2)                       // is it in Windows?
         @DlgCtrlSize(0,13,10,16,45)
       @Else                                    // should be in dos or os/2
         @LocalWindow(13,30)
       @EndIf

       @Option 500 = "@Msg77a"                        // default Append
       @Option 501 = "@Msg77b"                        // Start new
     @EndOption

     @If(@OptionIsSet(500))
         @Write("@BootDrive:\\ibm5250.log",,
           "@DateToStr(@SystemDate)  Start @Name @Version\n")
         @Write("@BootDrive:\\ibm5250.log",,
           "@DateToStr(@SystemDate)  User chose to continue appending to ibm5250.log\n")
     @ElseIf(@OptionIsSet(501))
         @Write("@BootDrive:\\ibm5250.log", "wt", "")      // start new log file
         @Write("@BootDrive:\\ibm5250.log",,
           "@DateToStr(@SystemDate)  Start @Name @Version\n")
         @Write("@BootDrive:\\ibm5250.log",,
           "@DateToStr(@SystemDate)  User chose to start new ibm5250.log\n")
     @EndIf
@Else                                                  // log file exists
     @Write("@BootDrive:\\ibm5250.log",,
       "@DateToStr(@SystemDate)  Appending to current log file\n")
     @Write("@BootDrive:\\ibm5250.log",,               // and not over 50K
       "@DateToStr(@SystemDate)  Start @Name @Version\n")
@EndIf


@Display
  @Cls
@Msg31a @Version!
@Msg31e
  @Pause
@EndDisplay

@Display
  @Cls
@Msg78
  @Pause
@EndDisplay
@Chain("Disk 2", "INSTALL2.DAT")

/* end-of-file */
