home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 2.4 / 1996-05_-_Disc_2.4.bin / install / ag-old.inf next >
INI File  |  1996-01-10  |  53KB  |  1,662 lines

  1. DefineVariables
  2.   Text          [ProductName]           := Allied General Demo
  3.   Text          [AbbreviatedName]       := AlliedGeneralDemo
  4.   Text          [MainExeName]           := AGDEMO.EXE
  5.   Text          [ReadmeName]            := README.TXT
  6.   Text          [ProductVersion]        := 1.0.0
  7.   Text          [HelpFileName]          :=
  8.   Text          [ProductIniFile]        := AGDEMO.INI
  9.   Text          [ProgGrpName]           := Allied General Demo
  10.   Text          [ProgGrpFileName]       := ALLIEDGE.GRP
  11.   Text          [IconName]              := AGDEMO.ICO
  12.   Text          [BitmapName]            := INSTALL.BMP
  13.   Number        [XBmp]                  := 640
  14.   Number        [YBmp]                  := 480
  15.   Directory     [DefaultDestDir]        := AG_DEMO
  16.   Text          [DefaultDestDir95]      := Program Files\Allied General Demo
  17.   Directory     [SetupDir]              := SETUP
  18.   Directory     [SourceDir]             := AG
  19.   Directory     [TargetDir]             := BlankString
  20.   Directory     [TargetDrive]           := BlankString
  21.   Directory     [UninstallDirectory]    := BlankString
  22.   Directory     [SetupDirectory]        := BlankString
  23.   Text          [FileReplaceExe]        := BlankString
  24.   Number        [Options]               := 2
  25.   Logical       [Complete]              := N
  26.   Logical       [Typical]               := N
  27.   Logical       [Minimal]               := N
  28.   Logical       [IsWin95]               := N
  29.   Logical                               [IsWinNT]                                                               := N
  30.   Logical       [PreviousInstall]       := N
  31.   Text          [PreviousInstallOption] :=
  32.   Logical       [InstallWin32s]         := N
  33.   Logical       [Root]                  := N
  34.   Text          [CurrentInstallOpt]
  35.   TextArray     [NotEnufFreeHDSpace]
  36.   Text          [SignOffText]           := Installation is complete.
  37.   Text          [Drive]                 := C
  38.   Text          [DelteingFilesText]     := Deleting files, please wait...
  39.   Text          [NoFreeSpaceText]       := megabytes of free disk space is required!  If available select another drive or free up the needed space and try again.
  40.   Text          [WhichLanguage]         :=
  41.   Text          [InstallText]           := Install
  42.   Text          [ConfigText1]           := Setup can optimize the program for your computer's speed.
  43.   Text          [ConfigText2]           := Do you want to optimize the program?
  44.   Text          [YES_text]              := OK
  45.   Text          [NO_text]               := No
  46.   Text          [EXIT_text]             := Exit
  47.   Text          [HelpText]              := Help
  48.   Text          [DRIVE_text]            := Select Drive
  49.   Text          [OPTION_text]           := Select Option
  50.   Text          [UninstallIconText]     := Uninstall
  51.   Text          [WaitText]              := Please wait...
  52.   Text          [ContinueText]          := Click 'OK' to continue. Click 'No' to Cancel.
  53.   Text          [Win32sText]            := Setup needs to install or upgrade Win32s for this program to run properly.
  54.   Text          [CheckSystemFilesText]  := Checking system files.
  55.   Text          [RestartReminderText]   := Don't forget to restart Windows.
  56.   Text          [RestartText]           := Your system needs to be restarted before beginning. Select 'OK' to restart or 'No' to Cancel.
  57.   Text          [SelectInstallDirText]  := Please choose an installation directory on a fixed drive (example: C: or D: drive).
  58.   Text          [SelectInstallDirText2] := Type in your choice below and select `Ok' to install, or `Exit' to exit the installation now.
  59.   Text                  [SelectWin95InstallDirText]             := Setup can install
  60.     Text                    [SelectWin95InstallDirText1]    := into the directory listed below, or you may enter a directory of your choice.
  61.     Text                    [SelectWin95InstallDirText3]    := Be sure to include the drive letter. Example:
  62.     Text                    [SelectWin95InstallDirText4]    := C:\My Destination Directory
  63.     Text                    [SelectWin95InstallDirText2]    := Click 'OK' to accept or 'Exit' to end installation now.
  64.   Text          [PromptForOptsText]     := There is not enough free disk space on drive.
  65.   Text          [PromptForOptsText2]    := Click 'Select Option' to choose another install option. Click 'Select Drive' to keep the current option and choose another hard drive. Click 'Exit' to exit the installation now.
  66.   Text                                  [NoWinDirText]                                  := This install does not allow installation to the Windows directory!  Please select another location.
  67.   Text                                  [NoInstallRootText]                     := This install does not allow installation to the root of your hard drive!
  68.  
  69.   Logical       [Win32Installed]        := N
  70.   Text          [Language]              := English
  71.   Text                  [FloatingFileSetSize]   :=
  72.   Number        [FileSetSize]           :=
  73.   Number        [CompleteSize]          := 35000000
  74.   Number        [TypicalSize]           := 3000000
  75.   Number        [MinimalSize]           := 0
  76.   Number        [WinGSize]              := 311000
  77.   Number        [UninstallSize]         := 250000
  78.   Number        [CopyDlgYPos]           := 0
  79.   Number        [FileCount]             := 0
  80.   Number        [Choice]                := 1010
  81.   Number        [Continue]              := 1012
  82.   Number        [Win32sContinue]        := 1020
  83.   Number        [W32sInstall]           := 1018
  84.   Number        [Install]               := 1014
  85.   Number        [Restart]               := 1016
  86.  
  87.   Directory     [Win32sDir]             := WIN32S
  88.   Text          [Win32sListFile]        := WIN32S.LST
  89.   Text          [Win32sIniFile]         := WIN32S.INI
  90.   Text          [Win32sSection]         := Win32s
  91.   Text          [Win32sVersionKey]      := Version
  92.   Text          [Win32sCurrentVersion]  := 1.30.166.0
  93.   Text          [Ole32sCurrentVersion]  := 2.3.130.166
  94.   Logical       [Win32sIniFail]         := N
  95.   Logical       [Win32sDirFail]         := N
  96.   Logical       [Win32sNeeded]          := N
  97.   Text          [Win32sPrevVersion]     := 1.25.142.0
  98.   Logical       [Win32s]                := N
  99.   Logical       [DotParsed]             := N
  100.   Logical       [BootSectionInvalid]    := N
  101.   TextArray     [Win32Array]
  102.   Number        [Win32sSize]            := 5150000
  103.   Number        [Ole32sSize]            := 1175000
  104.     Logical       [Ole32sNeeded]          := N
  105.  
  106.   Logical       [InstallWinG]           := N
  107.  
  108.   Text          [FileInUse]             := BlankString
  109.   Text          [FileVersionSource]     :=
  110.   Text          [FileVersionDest]       :=
  111. EndDefineVariables
  112.  
  113. ;;-------------------- BEGIN MAIN --------------------------------------------
  114.  
  115. SetDefaultBitmap Off
  116. SetInstallModeTo Install
  117. SetTraceMode Off
  118. SetExitConfirmationPrompt off
  119. SetReplacementInquiry Off
  120. SetPopupBorderTo double
  121. SetPopupAttrTo BlackOnLightGray
  122. SetBackgroundColor 0 0 0 0 0 0 ;; set to Black
  123. [CopyDlgYPos] := MaxY - 155
  124.  
  125. Do WhichWindows
  126.  
  127. If [IsWin95]
  128.   Do Windows95_INSTALL
  129. Else
  130.     If [IsWinNT]
  131.     Do WindowsNT_INSTALL
  132.     Else
  133.     Do WIN31_INSTALL
  134.     EndIf
  135. EndIf
  136.  
  137. If [IsWin95]
  138. Else
  139.   Do SignOff
  140. EndIf
  141. :EXIT
  142. SoLong Quietly
  143.  
  144. ;;--------------------- END MAIN ------------------------------------------
  145.  
  146. Procedure Windows95_INSTALL
  147.  
  148. ;;  Do CheckTempForIni       ;; temp ini left by AUTORUN.EXE
  149.   Do SetLanguage
  150.   SetTopLineTo [ProductName] [InstallText]
  151.   Do DisplayLogo
  152.     Do CheckSystemColors
  153.   Do GetInstallOptions
  154.     Do GetPreviousInstallOption
  155.     If [PreviousInstall]
  156.         Do      DeInstall
  157.     EndIf
  158.   Do INSTALL
  159.   Do WriteInstallInfoToIni
  160.   Do InstallWinG
  161.   Do CheckFilesInUse
  162.  
  163.   If FileExists [InstallationDirectory]\[MainExeName]  ;; Run Program
  164.     ChangeDirectoryTo [InstallationDirectory]
  165.     Run [InstallationDirectory]\[MainExeName] nowait
  166.   EndIf
  167.     :EXIT
  168.   UnloadBitmap 1
  169. EndProcedure
  170.  
  171. Procedure WIN31_INSTALL
  172.  
  173. ;;  Do WhichLanguage
  174.   Do SetLanguage
  175.   SetTopLineTo [ProductName] [InstallText]
  176.   Do DisplayLogo
  177.   Delay 1000
  178.     Do CheckSystemColors
  179.   TextBox
  180.     [WaitText]
  181.     [CheckSystemFilesText]
  182.   EndTextBox
  183.   If WIN32
  184.   Else
  185.      Do CheckWin32s
  186.     EndIf
  187.   Do GetInstallOptions
  188.     Do GetPreviousInstallOption
  189.     If [PreviousInstall]
  190.         Do      DeInstall
  191.     EndIf
  192.   Do INSTALL
  193.     Do WriteInstallInfoToIni
  194.   If [Win32sNeeded]
  195.         Do PromptInstallWin32s
  196.         Do ValidateSystemIniFile
  197.         Do EditSystemIniFile
  198.   EndIf
  199.     If [Ole32sNeeded]
  200.         Do VerInstallOle32s
  201.         If DirectoryExists [WindowsSystemDirectory]\WIN32S
  202.             Do W32sDeleteFiles
  203.         EndIf
  204.     EndIf
  205.     Do InstallWinG
  206.     If [InstallWinG]
  207.     Do RestartWindows
  208.     GoTo EXIT
  209.     EndIf
  210.  
  211.     If [Win32Installed] .OR. FileInUse
  212.     Do RestartWindows
  213.     EndIf
  214.   If [InstallWinG]
  215.         Do RestartWindows
  216.   EndIf
  217.     :EXIT
  218.   ClearScreen
  219.   UnloadBitmap 1
  220. EndProcedure
  221.  
  222. Procedure WindowsNT_INSTALL
  223.  
  224. ;; Do Runanim
  225. ;;  Do WhichLanguage
  226.   Do SetLanguage
  227.   SetTopLineTo [ProductName] [InstallText]
  228.   Do DisplayLogo
  229.     Do CheckSystemColors
  230.     Do GetInstallOptions
  231.     Do GetPreviousInstallOption
  232.     If [PreviousInstall]       ;;Fix or change this
  233.         Do      DeInstall
  234.     EndIf
  235.  
  236.   Do INSTALL
  237.     Do WriteInstallInfoToIni
  238.     Do InstallWinG
  239.     :EXIT
  240.   ClearScreen
  241.   UnloadBitmap 1
  242. EndProcedure
  243.  
  244.  
  245. ;;------------------------- END MAIN ----------------------------------------
  246.  
  247. ;;------------------------- BEGIN INSTALL PROCEDURE -------------------------
  248. Procedure INSTALL
  249.     ClearScreen
  250.     Do TrimInstallFromDir
  251.     SetCopyAttrTo 00
  252.     If      [Complete]
  253.     Logging On
  254.         CopyFiles from [InstallFromDirectory]\[SourceDir] to [InstallationDirectory] @xy(0, [CopyDlgYPos])  [FileSetSize]
  255.         AGDEMO.ICO
  256.         readme.txt
  257.         *.exe
  258.         DATA\*.* as DATA\*.*
  259.         ART\*.* as ART\*.*
  260.         SCENARIO\*.* as SCENARIO\*.*
  261.         EndCopyFiles
  262.     EndIf
  263.  
  264.     If      [Typical]
  265.     Logging On
  266.         CopyFiles from [InstallFromDirectory]\[SourceDir] to [InstallationDirectory] @xy(0, [CopyDlgYPos])  [FileSetSize]
  267.         AGDEMO.ICO
  268.         readme.txt
  269.         *.exe
  270.         DATA\*.* as DATA\*.*
  271.         SCENARIO\*.* as SCENARIO\*.*
  272.         EndCopyFiles
  273.     EndIf
  274.     CopyFiles from [InstallFromDirectory]\SETUP to [InstallationDirectory]  Quietly
  275.         UNINST.EXE
  276.         UNINST.INF
  277.     EndCopyFIles
  278.  
  279.     If [IsWin95]     ;;  Copy and Run Registry only if Windows 95.
  280.        CopyFiles from [InstallFromDirectory]\SETUP to [InstallationDirectory] Quietly
  281.         REGISTRY.EXE
  282.         AG.RGS
  283.        EndCopyFIles
  284.        Do RunRegistry
  285.     EndIf
  286.  
  287.     Do RestoreInstallFromDir
  288.     Do CreateAutoIniFile
  289.     Do CreateProgramGroup
  290.  
  291. EndProcedure
  292. ;;-------------------------- END INSTALL PROCEDURE -------------------------
  293.  
  294. ;;-------------------------APPEND REGISTRY INSTALL SCRIPT ----------------------------
  295.  
  296. Procedure AppendRegistryInstallScript
  297. If [IsWin95]
  298.     [Dir1] := [DefaultDestDir95]
  299. Else
  300.     [Dir1] := [InstallationDirectory]
  301. EndIf
  302. If [Minimal]
  303.     [Dir1] := [InstallFromDirectory]\[SourceDir]
  304. Endif
  305. AppendFile [InstallationDirectory]\AG.RGS
  306.     RegCreateKeyEx( HKEY_CLASSES_ROOT, "[AbbreviatedName]", 0, "[ProductName]", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisp )
  307.     RegSetValueEx( HANDLE, "", 0, REG_SZ, "[ProductName]", 25 );
  308.     RegCloseKey( HANDLE );
  309.     //Register 16x16,32x32 icons
  310.     RegCreateKeyEx( HKEY_CLASSES_ROOT, "[AbbreviatedName]\DefaultIcon", 0, "[ProductName]", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisp )
  311.     RegSetValueEx( HANDLE, "", 0, REG_SZ, "[Dir1]\[MainExeName]", 41 );
  312.     RegCloseKey( HANDLE );
  313.     // Register the program version under SSI
  314.     RegCreateKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\SSI\Allied General\Version 1.0.0", 0, "Allied General", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisp )
  315.     RegSetValueEx( HANDLE, "", 0, REG_SZ, "[ProductName]", 37 );
  316.     RegCloseKey( HANDLE );
  317.     // Register the program executable
  318.     RegCreateKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\[MainExeName]", 0, "[ProductName]", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisp )
  319.     RegSetValueEx( HANDLE, "", 0, REG_SZ, "[Dir1]\[MainExeName]", 37 );
  320.     RegCloseKey( HANDLE );
  321.     // Register uninstall stuff
  322.     RegCreateKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[AbbreviatedName]", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hSubKey, &dwDisp )
  323.     RegSetValueEx( HANDLE, "DisplayName", 0, REG_SZ, "[ProductName] Version [ProductVersion]", 45 );
  324.     RegSetValueEx( HANDLE, "UninstallString", 0, REG_SZ, "[Dir1]\UNINST.EXE UNINST.INF", 39 );
  325.     RegCloseKey( HANDLE );
  326.     // Special form for incrementing use counter on a shared DLL
  327.     IncUsageKey( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs", "[WindowsSystemDirectory]\wing32.dll" );
  328.     END REGISTRY
  329. EndAppendFile
  330. EndProcedure
  331.  
  332. ;;------------------------- END APPEND REGISTRY INSTALL SCRIPT ----------------------------
  333.  
  334. ;;------------------------- APPEND REGISTRY UNINSTALL SCRIPT ----------------------------
  335.  
  336. Procedure AppendRegistryUninstallScript
  337. AppendFile [InstallationDirectory]\UAG.RGS
  338.     RegDeleteKey( HKEY_CLASSES_ROOT, "[AbbreviatedName]" );
  339.     RegDeleteKey( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\[MainExeName]" );
  340.     // This removes the uninstaller components from the registry
  341.     RegDeleteKey( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[AbbreviatedName]" );
  342.     // Remove the SSI product entry
  343.     RegDeleteKeyPath( HKEY_LOCAL_MACHINE, "SOFTWARE\SSI\Allied General\Version 1.0.0" );
  344.     // Special form for decrementing use counter on a shared DLL
  345.     DecUsageKey( HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs", "[WindowsSystemDirectory]\wing32.dll" );
  346.     END REGISTRY
  347. EndAppendFile
  348. EndProcedure
  349.  
  350. ;;------------------------- END APPEND REGISTRY UNINSTALL SCRIPT ----------------------------
  351.  
  352. Procedure RunRegistry
  353.     Do AppendRegistryInstallScript
  354.     Run [InstallationDirectory]\REGISTRY.EXE [InstallationDirectory]\AG.RGS
  355.     DeleteFiles from [InstallationDirectory]
  356.         AG.RGS
  357.     EndDeleteFiles
  358.     CopyFiles from [InstallFromDirectory]\SETUP to [InstallationDirectory] Quietly
  359.         UAG.RGS
  360.     EndCopyFIles
  361.     Do AppendRegistryUninstallScript
  362. EndProcedure
  363.  
  364. Procedure DeInstall
  365.     If [Typical]
  366.         If DirectoryExists      [InstallationDirectory]\ART
  367.             DeleteFiles from [InstallationDirectory]\ART  Quietly
  368.                 *.*
  369.             EndDeleteFiles
  370.             If [IsWin95]
  371.                 LFNGetShortPathName [DefaultDestDir95]\ART  [String1]
  372.                 LFNRemoveDirectory  [String1]
  373.             Else
  374.                 DeleteDirectory  [InstallationDirectory]\ART
  375.             EndIf
  376.         EndIf
  377.     EndIf
  378. EndProcedure
  379.  
  380. Procedure CheckSystemColors
  381.   GetDeviceCaps NumColors [Number5]
  382.     If [Number5] < 20
  383.       Do 256ColorsDlgBox
  384.       If [Continue] = 1011
  385.               GoTo EXIT
  386.       EndIf
  387.    EndIf
  388. EndProcedure
  389.  
  390. Procedure 256ColorsDlgBox
  391.   DialogBox 230 70 UseHeader "Allied General" Returns [Continue] BlackOnLightGray ModalFrame
  392.     GroupBox @xy(4,2) 220 42 ""
  393.   LText @xy( 8, 8) 214 8 "Allied General requires that your computer run in 256 Color mode. "
  394.     LText @xy( 8,16) 214 8 "You may need to change your video driver to support 256 colors."
  395.     LText @xy( 8,24) 214 8 "To complete installation first and later change your video drivers,"
  396.     LText @xy( 8,32) 214 8 "click 'Continue'. To exit setup now, click 'Exit'."
  397.     DefPushButton @xy( 18, 50) 54 16 "Continue" 1012
  398.     PushButton @xy(154, 50) 54 16 "Exit" 1011
  399.   EndDialogBox
  400. EndProcedure
  401.  
  402.  
  403. ;; Win95 only
  404. Procedure CheckFilesInUse
  405.     If FileInUse
  406.     CreateFile [WindowsDirectory]\WININIT.INI
  407.         [Number9] := 1  ;;To turn on While loop
  408.  
  409.         While [Number9] > 0
  410.         ExamineTextFile [InstallationDirectory]\LOGFILE
  411.             [Number9] := LineNumberWith (FIU:,FIU:,FIU:)
  412.             [String9] := LineWith (FIU:,FIU:,FIU:)
  413.         ForgetTextFile
  414.             If [Number9] > 0
  415.                 ModifyTextFile [InstallationDirectory]\LOGFILE Quietly NoBackup
  416.                     DeleteLine      [Number9]
  417.                 EndModifyTextFile
  418.                 [FileInUse] := SubstringOf [String9] from 6 to End
  419.                 Do WriteWininitIniFile
  420.             EndIf
  421.         EndWhile
  422.     EndIf
  423. EndProcedure
  424.  
  425. ;; Win95 only
  426. Procedure WriteWininitIniFile
  427.     [Number10] := LengthOf [FileInUse]
  428.     [Number10] := [Number10] - 3
  429.     [String10] := SubstringOf [FileInUse] from Beginning to [Number10]
  430.     ClearArray [Array2]
  431.     [Array2][1] := rename
  432.     [Array2][2] := [FileInUse]
  433.     [Array2][3] := [String10]001
  434.     [Array2][4] := [WindowsDirectory]\WININIT.INI
  435.     WritePrivateProfileString Using [Array2]
  436. EndProcedure
  437.  
  438. Procedure TrimInstallFromDir
  439.     [String11] := INSTALL
  440.     [Number1] := PositionOf [String11] in [InstallFromDirectory]
  441.     [String12] := SubstringOf [InstallFromDirectory] from [Number1] to End
  442.     [Number1] := [Number1] - 1
  443.     [InstallFromDirectory] := SubstringOf [InstallFromDirectory] from Beginning to [Number1]
  444. EndProcedure
  445.  
  446. Procedure RestoreInstallFromDir
  447.     [InstallFromDirectory] := [InstallFromDirectory]\[String12]
  448. EndProcedure
  449.  
  450. Procedure WhichWindows
  451.   If WIN32
  452.      If WindowsVersion >= 3.95
  453.        [IsWin95] := Y
  454.      Else
  455.          If WindowsVersion >= 3.10
  456.              [IsWinNT] := Y
  457.          [IsWin95] := N ;; Windows NT 3.50 or greater ONLY!!!
  458.          EndIf
  459.      Endif
  460.   Else
  461.      [IsWin95] := N   ;; Win31
  462.   EndIf
  463. EndProcedure
  464.  
  465. ;;Win95 only
  466. Procedure CheckTempForIni
  467.     If FileExists [WindowsDirectory]\~UTOTEMP.INI
  468.  
  469.       [Array1][1] := Language
  470.       [Array1][2] := Which
  471.       [Array1][3] := English
  472.       [Array1][4] := [WindowsDirectory]\~UTOTEMP.INI
  473.  
  474.       GetPrivateProfileString Using [Array1]
  475.  
  476.       [Language] := [Array1][5]
  477.  
  478.       DeleteFiles from [WindowsDirectory]
  479.        ~UTOTEMP.INI
  480.       EndDeleteFiles
  481.  
  482.     Else
  483.       Do WhichLanguage  ;; If file not there prompt user for Language.
  484.     EndIf
  485.  
  486. EndProcedure
  487.  
  488.  
  489. Procedure SetLanguage
  490.  If [Language] = English
  491.  Else
  492.     Do TrimInstallFromDir
  493.     ExamineTextFile [InstallFromDirectory]\SETUP\[Language].TXT
  494.     [SignOffText]                 := Line 1
  495.     [NoFreeSpaceText]             := Line 2
  496.     [InstallText]                 := Line 3
  497.     [UninstallIconText]           := Line 4
  498.     [YES_text]                    := Line 5
  499.     [NO_text]                     := Line 6
  500.     [WaitText]                    := Line 7
  501.     [ContinueText]                := Line 8
  502.     [Win32sText]                  := Line 9
  503.     [CheckSystemFilesText]        := Line 10
  504.     [RestartText]                 := Line 11
  505.     [RestartReminderText]         := Line 12
  506.     [EXIT_text]                   := Line 13
  507.     [DRIVE_text]                  := Line 14
  508.     [OPTION_text]                 := Line 15
  509.     [SelectInstallDirText]        := Line 16
  510.     [SelectInstallDirText2]       := Line 17
  511.     [SelectWin95InstallDirText1]  := Line 18
  512.     [SelectWin95InstallDirText2]  := Line 19
  513.     [PromptForOptsText]           := Line 20
  514.     [PromptForOptsText2]          := Line 21
  515.     [ConfigText1]                 := Line 22
  516.     [ConfigText2]                 := Line 23
  517.     [NoWinDirText]                := Line 24
  518.     [NoInstallRootText]           := Line 25
  519.     [RestartButton]               := Line 26
  520.     [HelpText]                    := Line 27
  521.     [ConfigureName]               := Line 28
  522.     [HelpFileName]                := Line 29
  523.     ForgetTextFile
  524.     Do RestoreInstallFromDir
  525.  EndIf
  526. EndProcedure
  527.  
  528. Procedure DisplayLogo
  529.  [Number6] := (MaxX - [XBmp])/2
  530.  [Number7] := (MaxY - [YBmp])/2
  531.  
  532.  Do TrimInstallFromDir
  533.  If FileExists [InstallFromDirectory]\[SetupDir]\[BitmapName]
  534.    LoadBitmap 1 [InstallFromDirectory]\[SetupDir]\[BitmapName]
  535.    ShowBitmap 1 @xy([Number6],[Number7])
  536.  Else
  537.    SetBackgroundColor 0 0 64 0 0 255
  538.    SetDefaultBitmap On
  539.  EndIf
  540.  ShowWindow Maximize
  541.  Do RestoreInstallFromDir
  542. EndProcedure
  543.  
  544. Procedure PromptInstallDir
  545. ;;Set the install options, if any
  546.     If [Complete]
  547.         [CurrentInstallOpt] := Complete
  548.         If [IsWin95] .OR. [IsWinNT]
  549.             [FileSetSize] := [CompleteSize] + [UninstallSize] + [WinGSize]
  550.         Else
  551.             [FileSetSize] := [CompleteSize] + [UninstallSize] + [WinGSize] + [Win32sSize]
  552.         EndIf
  553.     EndIf
  554.     If [Typical]
  555.         [CurrentInstallOpt] := Typical
  556.         If [IsWin95] .OR. [IsWinNT]
  557.             [FileSetSize] := [TypicalSize] + [UninstallSize] + [WinGSize]
  558.         Else
  559.             [FileSetSize] := [TypicalSize] + [UninstallSize] + [WinGSize] + [Win32sSize]
  560.         EndIf
  561.     EndIf
  562.     If [Minimal]
  563.         [CurrentInstallOpt] := Minimal
  564.         If [IsWin95] .OR. [IsWinNT]
  565.             [FileSetSize] := [MinimalSize] + [UninstallSize]
  566.         Else
  567.             [FileSetSize] := [MinimalSize] + [UninstallSize] + [Win32sSize]
  568.         EndIf
  569.     EndIf
  570. ;;Initialize the Win95 Prompt for destination dir dlg
  571.     If [IsWin95]
  572.         [String13] := C
  573.         :Initialize
  574.         If FreeSpaceOnDrive [String13] > [FileSetSize]
  575.             [String10] := [String13]:\Program Files
  576.             LFNGetShortPathName [String10] [String12]
  577.             If DirectoryExists [String12]
  578.                 [String10] := [String13]:\[DefaultDestDir95]
  579.             Else
  580.                 [String10] := [String13]:\[ProductName]
  581.             EndIf
  582.         Else
  583.             If [Options] > 1
  584.                 GoTo PromptForOpts
  585.             Else
  586.                 GoTo PromptForDest
  587.             EndIf
  588.         EndIf
  589.     EndIf
  590.  
  591.     :Again
  592. ;;Run thru the Prompt Dlg logic
  593.     If [IsWin95]
  594.         :PromptWin95InstallDlg
  595.             If [Options] > 1
  596.                 Do PromptWin95InstallDlg
  597.             Else
  598.                 Do PromptWin95NoOptsInstallDlg
  599.             EndIf
  600.           TextBox
  601.             [WaitText]
  602.         EndTextBox
  603.             If [Continue] = 1022      ;; Select Drive
  604.                 GoTo PromptForDest
  605.             EndIf
  606.             If [Continue] = 1012      ;; Ok
  607.                 GoTo PromptForDestEnd
  608.             EndIf
  609.             If [Continue] = 1011    ;; Exit
  610.                 GoTo EXIT
  611.             EndIf
  612.         :PromptForOpts
  613.             Do PromptForOptsDlgBox
  614.             If [Continue] = 1012
  615.                 GoTo DoOptsAgain
  616.             EndIf
  617.             If [Continue] = 1011    ;; Exit
  618.                 GoTo EXIT
  619.             EndIf
  620.         :PromptForDest  ;;If [Continue] = none of the above, drop thru to here
  621.             DetermineInstallationDrive [FileSetSize] RequireFixed DisallowNetwork
  622.             [String13] := InstallationDrive
  623.             GoTo Initialize
  624.     Else
  625.         [String10] := C:\[DefaultDestDir]
  626.         Do PromptInstallDlg
  627.     EndIf
  628.     :PromptForDestEnd
  629.  
  630.     If [Continue] = 1011
  631.         GoTo EXIT
  632.     EndIf
  633. ;;Filter the user entry for errors
  634.     [Number10] := LengthOf [String10]
  635.     [String11] := SubstringOf [String10] from 1 to 1
  636.  
  637.     If [Number10] > 128  ;; Make sure directory not larger than 128 characters.
  638.         GoTo Again
  639.     EndIf
  640.  
  641.     If [Number10] < 4  ;; Make sure not installing to root
  642.         GoTo Again
  643.     EndIf
  644.  
  645.     If [String10] = BlankString
  646.         GoTo Again
  647.     EndIf
  648.  
  649.     If [String10] =  [WindowsDirectory]
  650.     Do NoWindowsDirectoryDlg
  651.         GoTo Again
  652.   EndIf
  653.  
  654.   If [String10] =  [WindowsSystemDirectory]
  655.     Do NoWindowsDirectoryDlg
  656.         GoTo Again
  657.   EndIf
  658.     If DriveIsPresent [String11]
  659.   Else
  660.         GoTo Again
  661.     EndIf
  662.  
  663.     If DriveIsBernoulli [String11]
  664.         GoTo Again
  665.     EndIf
  666.     If DriveIsCDROM [String11]
  667.         GoTo Again
  668.     EndIf
  669.     If DriveIsRAM [String11]
  670.         GoTo Again
  671.     EndIf
  672.     If DriveIsRemote [String11]
  673.         GoTo Again
  674.     EndIf
  675.     If DriveIsRemoveable [String11]
  676.         GoTo Again
  677.     EndIf
  678.  
  679.     [String11] := SubstringOf [String10] from 2 to 3
  680.     If [String11] <> :\
  681.         GoTo Again
  682.     EndIf
  683.  
  684.     [InstallationDirectory] := SubstringOf [String10] from Beginning to [Number10]
  685. EndProcedure
  686.  
  687.  
  688.  
  689. Procedure NoWindowsDirectoryDlg
  690.   DialogBox 182 72 UseHeader "Allied General   " Returns [Number25] BlackOnLightGray ModalFrame
  691.     Font "Helv" 10
  692.     GroupBox @xy(4,3) 174 45 ""
  693.     LText @xy(6,12) 170 25 [NoWinDirText]
  694.     DefPushButton @xy(69,52) 44 16 "OK" 1
  695.   EndDialogBox
  696. EndProcedure
  697.  
  698. Procedure PromptInstallDlg
  699.     DialogBox 182 108 UseHeader "Allied General   " Returns [Continue] BlackOnLightGray ModalFrame
  700.      Font "Helv" 10
  701.      GroupBox @xy(4,3) 174 60 ""
  702.      LText @xy( 6, 10) 170 20 [SelectInstallDirText]
  703.      LText @xy( 6,32) 170 30 [SelectInstallDirText2]
  704.      EditText @xy( 7,69) 168 12 Uses [String10] Border UpperCase
  705.      DefPushButton @xy(23,87) 40 16 [YES_text] 1012
  706.      PushButton @xy(119,87) 40 16 [EXIT_text] 1011
  707.     EndDialogBox
  708. EndProcedure
  709.  
  710. Procedure PromptWin95InstallDlg
  711.  
  712.     DialogBox 182 108 UseHeader "Allied General   " Returns [Continue] BlackOnLightGray ModalFrame
  713.      Font "Helv" 10
  714.      GroupBox @xy(4,3) 174 60 ""
  715.      LText @xy( 6, 10) 170 20 [SelectInstallDirText]
  716.      LText @xy( 6,32) 170 30 [SelectInstallDirText2]
  717.      EditText @xy( 7,69) 168 12 Uses [String10] Border
  718.      DefPushButton @xy(23,87) 40 16 [YES_text] 1012
  719.      PushButton @xy(119,87) 40 16 [EXIT_text] 1011
  720.     EndDialogBox
  721.  
  722. EndProcedure
  723.  
  724. Procedure PromptWin95NoOptsInstallDlg
  725.     [String5] := [SelectWin95InstallDirText] [ProductName] [SelectWin95InstallDirText1]
  726.     Do FloatingFileSetSize
  727.     [String6] := [FloatingFileSetSize] Megabytes of hard drive free space is required.
  728.     DialogBox 182 138 UseHeader "Chessmaster 4000" Returns [Continue] BlackOnLightGray ModalFrame
  729.         Font "Helv" 10
  730.         GroupBox @xy(4,3) 174 82 ""
  731.     LText @xy( 6, 10) 170 30 [String5]
  732.     LText @xy( 6,40) 170 10 [SelectWin95InstallDirText3]
  733.     StaticText @xy( 45,50) 91 10 [SelectWin95InstallDirText4] Border
  734.     LText @xy( 6,60) 170 10 [SelectWin95InstallDirText2]
  735.     LText @xy( 6,70) 170 10 [String6]
  736.         EditText @xy( 7,90) 168 10 Uses [String10] Border
  737.         DefPushButton @xy(8,110) 44 16 [YES_text] 1012
  738.         PushButton @xy(130,110) 44 16 [EXIT_text] 1011
  739.     EndDialogBox
  740. EndProcedure
  741.  
  742. Procedure PromptForOptsDlgBox
  743.     [String6] := [PromptForOptsText] [String13]: for the selected '[CurrentInstallOpt]' option.
  744.     DialogBox 182 108 UseHeader "Allied General   " Returns [Continue] BlackOnLightGray ModalFrame
  745.         Font "Helv" 10
  746.         GroupBox @xy(4,3) 174 67 ""
  747.     LText @xy( 6, 10) 170 20 [String6]
  748.     LText @xy( 6,30) 170 35 [PromptForOptsText2]
  749.         DefPushButton @xy(7,80) 48 16 [OPTION_text] 1012
  750.         PushButton @xy(68,80) 48 16 [DRIVE_text] 1023
  751.         PushButton @xy(129,80) 48 16 [EXIT_text] 1011
  752.     EndDialogBox
  753. EndProcedure
  754.  
  755. Procedure FloatingFileSetSize
  756.     [String11] := [FileSetSize]
  757.     [Number1] := LengthOf [String11]
  758.     [Number3] := [Number1] - 3*2
  759.     [String12] := SubstringOf [String11] from Beginning to [Number3]
  760.     [Number3] := [Number3] + 1
  761.     [Number4] := [Number3] + 1
  762.     [String13] := SubstringOf [String11] from [Number3] to [Number4]
  763.     [FloatingFileSetSize] := [String12].[String13]
  764. EndProcedure
  765.  
  766. Procedure CreateAutoIniFile
  767.   CreateFile [InstallationDirectory]\AUTOHD.INI
  768.     ClearArray [Array2]
  769.     [Array2][1] := Language
  770.     [Array2][2] := which
  771.     [Array2][3] := [Language]
  772.     [Array2][4] := [InstallationDirectory]\AUTOHD.INI
  773.     WritePrivateProfileString Using [Array2] NoBackup
  774.  
  775.   AppendFile [InstallationDirectory]\AUTOHD.INI
  776.  
  777.   [Uninstall]
  778.   path=[InstallationDirectory]
  779.   EndAppendFile
  780. EndProcedure
  781.  
  782. Procedure CreateProgramGroup
  783.     [UninstallIconText] := [ProductName] [UninstallIconText]
  784.     If [IsWinNT] .OR. [Minimal]
  785.         ProgramManagerDDE
  786.             DeleteGroup([ProgGrpName])
  787.         EndProgramManagerDDE
  788.     Else
  789.         ProgramManagerDDE
  790.             ShowGroup([ProgGrpName],1)
  791.             DeleteGroup([ProgGrpName])
  792.         EndProgramManagerDDE
  793.     EndIf
  794.     Do TrimInstallFromDir
  795.  
  796.     If [Minimal]
  797.         [UninstallDirectory]    := [InstallationDirectory]
  798.         [InstallationDirectory] := [InstallFromDirectory][SourceDir]
  799.     Else
  800.         [UninstallDirectory]    := [InstallationDirectory]
  801.     EndIf
  802.  
  803.   If [IsWin95]
  804.     ProgramManagerDDE
  805.             CreateGroup([ProgGrpName])
  806.             AddItem([InstallationDirectory]\[MainExeName],[ProductName],,,,,[DefaultDestDir95])
  807.             AddItem([InstallationDirectory]\[ReadmeName],[ReadmeName],,,,,[DefaultDestDir95])
  808.             AddItem([UninstallDirectory]\UNINST.EXE,[UninstallIconText],,,,,[DefaultDestDir95])
  809.  EndProgramManagerDDE
  810.   Else
  811.     ProgramManagerDDE
  812.             CreateGroup([ProgGrpName])
  813.             AddItem([InstallationDirectory]\[MainExeName],[ProductName],[InstallationDirectory]\[IconName])
  814.             AddItem([UninstallDirectory]\UNINST.EXE,[UninstallIconText])
  815.             AddItem([InstallationDirectory]\readme.txt,[ReadmeName])
  816.     EndProgramManagerDDE
  817.   EndIf
  818.     Do RestoreInstallFromDir
  819.     ;; Restore installation dir to dest dir on HD in minimal case
  820.     If [Minimal]
  821.         [InstallationDirectory] := [UninstallDirectory]
  822.     EndIf
  823. EndProcedure
  824.  
  825. Procedure WhichLanguage
  826.   ShowWindow Minimize
  827.   DialogBox 95 120 UseHeader "Allied General   " Returns [Choice] BlackOnLightGray ModalFrame
  828.     DefPushButton @xy( 28, 7) 40 16 "English" 1010
  829.     PushButton @xy(28, 29) 40 16 "Franτais" 1011
  830.     PushButton @xy(28, 51) 40 16 "Deutsch" 1012
  831.     PushButton @xy(28, 73) 40 16 "Espa±ol" 1013
  832.     PushButton @xy(28, 97) 40 16 "Italiano" 1014
  833.  EndDialogBox
  834.  
  835.  If [Choice] = 1010
  836.    [Language] := English
  837.  EndIf
  838.  If [Choice] = 1011
  839.    [Language] := French
  840.  EndIf
  841.  If [Choice] = 1012
  842.    [Language] := German
  843.  EndIf
  844.  If [Choice] = 1013
  845.    [Language] := Spanish
  846.  EndIf
  847.  If [Choice] = 1014
  848.    [Language] := Italian
  849.  EndIf
  850.  
  851. EndProcedure
  852.  
  853. Procedure InstallWin32s
  854.         [FileSetSize] := [Win32sSize] - [Ole32sSize]
  855.         [String10] := [WindowsSystemDirectory]
  856.         [Drive] := SubstringOf [String10] from 1 to 1
  857.         Do CheckFreeSpace
  858.         If [Minimal]
  859.             Logging On
  860.         EndIf
  861.         If DirectoryExists [WindowsSystemDirectory]\[Win32sDir]
  862.             Do W32sDeleteFiles
  863.         EndIf
  864.         CreateDirectoryIfNecessary [WindowsSystemDirectory]\[Win32sDir]
  865.         CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] @xy(0, [CopyDlgYPos]) [FileSetSize]
  866.             winhlp32.cnt
  867.             windows.hlp
  868.             winhlp32.hlp
  869.             winhlp32.exe
  870.             ole2.reg
  871.             olecli.dll
  872.             stdole.tlb
  873.             w32sys.dll
  874.             win32s16.dll
  875.             winmm16.dll
  876.             sysdir\*.*  as win32s\*.*
  877.         EndCopyFiles
  878.         Do VerInstallOle32s
  879.         If FileExists [WindowsSystemDirectory][Win32sDir]\mpr.dll
  880.            DeleteFiles from  [WindowsSystemDirectory]\[Win32sDir]
  881.                     mpr.dll
  882.            EndDeleteFiles
  883.         EndIf
  884.         [String15] := /s [WindowsSystemDirectory]\OLE2.REG
  885. ;;              Run Regedit  [String15] NoPrompt
  886.         [Win32Installed] := Y
  887. EndProcedure
  888.  
  889. Procedure CheckWin32s
  890.  
  891.     If FileExists [WindowsSystemDirectory]\[Win32sIniFile]
  892.         ClearArray [Win32Array]
  893.         [Win32Array][1] := Win32s
  894.         [Win32Array][2] := Version
  895.         [Win32Array][3] := 1.25.140.0
  896.         [Win32Array][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  897.  
  898.         GetPrivateProfileString Using [Win32Array]
  899.  
  900. ;; Parse the WIN32S.INI version # string - must be four fields of four numerical characters each,
  901. ;; with three dot (".") separators distinguishing the fields
  902.         [Number1] := 1
  903.         [Number10] := 0
  904.         [Number11] := 0
  905.         [String1] := [Win32Array][5]
  906.         [Number2] := LengthOf [String1]
  907.         While [Number1] <= [Number2]
  908.             [String2] := SubStringOf [String1] from [Number1] to [Number1]
  909.             If [String2] Contains .
  910.                 If [Number1] = 1
  911.                     [Win32sIniFail] := Y
  912.                 EndIf
  913.                 [Number10] := 0
  914.                 If [DotParsed]
  915.                     [Win32sIniFail] := Y
  916.                 EndIf
  917.                 ;; Keep count of dot field separators, if > 3, fail
  918.                 [Number11] := [Number11] + 1
  919.                 If [Number11] > 3
  920.                     [Win32sIniFail] := Y
  921.                 EndIf
  922.                 [DotParsed] := Y
  923.                 GoTo NoNumCheck
  924.             EndIf
  925.             :NumCheck
  926.             If ([String2] < 0) .OR. ([String2] > 9)
  927.                 [Win32sIniFail] := Y
  928.             Else
  929.                 [Number10] := [Number10] + 1
  930.                 If [Number10] > 4
  931.                     [Win32sIniFail] := Y
  932.                 EndIf
  933.                 [DotParsed] := N
  934.             EndIf
  935.  
  936.             :NoNumCheck
  937.             If [Win32sIniFail]
  938.                 GoTo BadWin32s
  939.             EndIf
  940.             [Number1] := [Number1] + 1
  941.         EndWhile
  942.     Else
  943.         [Win32sIniFail] := Y
  944.         GoTo BadWin32s
  945.     EndIf
  946.     ;; Case where we can determine the version
  947.     If DirectoryExists [WindowsSystemDirectory]\[Win32sDir]
  948.         [Win32sPrevVersion] := [Win32Array][5]
  949.         If [Win32sPrevVersion] < [Win32sCurrentVersion]
  950.                 [Win32sNeeded] := Y
  951.         EndIf
  952.         If [Win32sPrevVersion] = [Win32sCurrentVersion]
  953.                 Do VerInstall
  954.         EndIf
  955.  
  956.     Else
  957.  
  958.     :BadWin32s
  959.     ;; Case where we can't determine the version!
  960.  
  961.             [Win32sNeeded] := Y
  962.     EndIf
  963. EndProcedure
  964.  
  965. Procedure PromptInstallWin32s
  966.  ClearScreen
  967.  DialogBox 208 90 UseHeader "Allied General   " Returns [Number20] BlackOnLightGray ModalFrame
  968.     Font "Helv" 10
  969.     GroupBox @xy(4,3) 200 52 ""
  970.     LText @xy(10,12) 192 20 [Win32sText]
  971.     CText @xy(10,36) 192 15 [ContinueText]
  972.     DefPushButton @xy( 34, 65) 40 16 [YES_text] 1012
  973.     PushButton @xy(129, 65) 40 16 [NO_text] 1011
  974.  EndDialogBox
  975.  
  976.  Do InitWin32sIniFile
  977.  
  978.   If [Number20] = 1012
  979.       Do InstallWin32s
  980.       If FileInUse
  981. ;;      Popup Files in use!
  982.       Else
  983.     Do EditWin32sIniFile
  984.       EndIf
  985.   EndIf
  986. EndProcedure
  987.  
  988.  
  989. Procedure VerInstall
  990. ;;      Do TrimInstallFromDir
  991.     [FileSetSize] := 0
  992.     [FileCount] := 0
  993.     While [FileCount] < 64
  994.         ClearArray [Win32Array]
  995.         [Win32Array][1] := WindowsSystemWin32s
  996.         [Win32Array][2] := [FileCount]
  997.         [Win32Array][3] := "WIN32S.EXE"
  998.         [Win32Array][4] := [InstallFromDirectory][Win32sListFile]
  999.         GetPrivateProfileString Using [Win32Array]
  1000.  
  1001.         [FileCount] := [FileCount] + 1
  1002.         ;; [String1] = filename.ext
  1003.         ;; [String2] = filesize
  1004.         [Number1] := PositionOf "," in [Win32Array][5]
  1005.         [Number2] := LengthOf [Win32Array][5]
  1006.         [Number1] := [Number1] + 1
  1007.         [String2] := [Win32Array][5]
  1008.  
  1009.         [String2] := SubstringOf [String2] from [Number1] to [Number2]
  1010.         [Number1] := [Number1] - 2
  1011.         [String1] := [Win32Array][5]
  1012.         [String1] := SubstringOf [String1] from 1 to [Number1]
  1013.  
  1014.     If FileExists [WindowsSystemDirectory]\[Win32sDir]\[String1]
  1015.             [String5] := [InstallFromDirectory][Win32sDir]\sysdir\[String1]
  1016.             [String6] := [WindowsSystemDirectory]\[Win32sDir]\[String1]
  1017.         Else
  1018.             If [Win32sPrevVersion] = [Win32sCurrentVersion]
  1019.                 CopyFiles from [InstallFromDirectory][Win32sDir]\sysdir to [WindowsSystemDirectory]\[Win32sDir] @xy(0, [CopyDlgYPos])
  1020.                  [String1]
  1021.                 EndCopyFiles
  1022.             Else
  1023.                 GoTo InstallWin32s
  1024.             EndIf
  1025.         EndIf
  1026.     EndWhile
  1027.  
  1028.     [FileSetSize] := 0
  1029.     [FileCount] := 0
  1030.     While [FileCount] < 10
  1031.         ClearArray [Win32Array]
  1032.         [Win32Array][1] := WindowsSystem
  1033.         [Win32Array][2] := [FileCount]
  1034.         [Win32Array][3] := "WIN32SYS.DLL"
  1035.         [Win32Array][4] := [InstallFromDirectory][Win32sListFile]
  1036.         GetPrivateProfileString Using [Win32Array]
  1037.         [FileCount] := [FileCount] + 1
  1038.         ;; [String1] = filename.ext
  1039.         ;; [String2] = filesize
  1040.         [Number1] := PositionOf "," in [Win32Array][5]
  1041.         [Number2] := LengthOf [Win32Array][5]
  1042.         [Number1] := [Number1] + 1
  1043.         [String2] := [Win32Array][5]
  1044.         [String2] := SubstringOf [String2] from [Number1] to [Number2]
  1045.         [Number1] := [Number1] - 2
  1046.         [String1] := [Win32Array][5]
  1047.         [String1] := SubstringOf [String1] from 1 to [Number1]
  1048.         If FileExists [WindowsSystemDirectory]\[String1]
  1049.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\[String1]
  1050.             [String4] := FileVersionOf [WindowsSystemDirectory]\[String1]
  1051.         Else
  1052.             If [Win32sPrevVersion] = [Win32sCurrentVersion]
  1053.                 CopyFiles from [InstallFromDirectory][Win32sDir]  to [WindowsSystemDirectory] @xy(0, [CopyDlgYPos])
  1054.                     [String1]
  1055.                 EndCopyFiles
  1056.             Else
  1057.                 GoTo InstallWin32s
  1058.             EndIf
  1059.         EndIf
  1060.     EndWhile
  1061.     [Ole32sNeeded] := Y
  1062. EndProcedure
  1063.  
  1064. Procedure W32sDeleteFiles
  1065.     ClearScreen
  1066.     If [Minimal]
  1067.     Else
  1068.         Logging On
  1069.     EndIf
  1070.   TextBox
  1071.         [WaitText]
  1072.     EndTextBox
  1073.     [FileSetSize] := 0
  1074.     [FileCount] := 0
  1075.     While [FileCount] < 45
  1076.         ClearArray [Win32Array]
  1077.         [Win32Array][1] := Win32sSystemObsoleteFiles
  1078.         [Win32Array][2] := [FileCount]
  1079.         [Win32Array][3] := "KERNEL32.DLL"
  1080.         [Win32Array][4] := [InstallFromDirectory][Win32sListFile]
  1081.         GetPrivateProfileString Using [Win32Array]
  1082.         [FileCount] := [FileCount] + 1
  1083.         ;; [String1] = filename.ext
  1084.         ;; [String2] = filesize
  1085.         [Number1] := PositionOf "," in [Win32Array][5]
  1086.         [Number2] := LengthOf [Win32Array][5]
  1087.         [Number1] := [Number1] + 1
  1088.         [String2] := [Win32Array][5]
  1089.         [String2] := SubstringOf [String2] from [Number1] to [Number2]
  1090.         [Number1] := [Number1] - 2
  1091.         [String1] := [Win32Array][5]
  1092.         [String1] := SubstringOf [String1] from 1 to [Number1]
  1093.         If FileExists [WindowsSystemDirectory]\WIN32S\[String1]
  1094.             DeleteFiles from [WindowsSystemDirectory]\[Win32sDir] Quietly
  1095.                 [String1]
  1096.             EndDeleteFiles
  1097.         EndIf
  1098.     EndWhile
  1099. EndProcedure
  1100.  
  1101. Procedure InstallWinG
  1102.     If [IsWinNT]
  1103.         [String2] := [WindowsSystemDirectory]
  1104.         [WindowsSystemDirectory] := [WindowsDirectory]\SYSTEM32
  1105.     EndIf
  1106.     If FileExists [WindowsSystemDirectory]\WING32.DLL
  1107.          Do TrimInstallFromDir
  1108.        [String20] := FileVersionOf [InstallFromDirectory]WING\WING32.DLL
  1109.        [String21] := FileVersionOf [WindowsSystemDirectory]\WING32.DLL
  1110.          Do RestoreInstallFromDir
  1111.        If [String21] < [String20]
  1112.           [InstallWinG] := Y
  1113.        EndIf
  1114.     Else
  1115.        [InstallWinG] := Y
  1116.     EndIf
  1117.     If [IsWin95] = N
  1118.         If FileExists [WindowsSystemDirectory]\DVA.386
  1119.         Else
  1120.          [InstallWinG] := Y
  1121.         EndIf
  1122.     EndIf
  1123.  
  1124.     If [InstallWinG]
  1125.  
  1126.        SetCopyAttrTo 00
  1127.        If WIN32
  1128.            CopyFiles from [InstallFromDirectory]WING to [WindowsSystemDirectory] @xy(0, [CopyDlgYPos])
  1129.                 WING32.DLL
  1130.            EndCopyFIles
  1131.        Else
  1132.            CopyFiles from [InstallFromDirectory]WING to [WindowsSystemDirectory] @xy(0, [CopyDlgYPos])
  1133.                     *.dll
  1134.                     *.drv
  1135.                     *.wnd
  1136.                     dva.386
  1137.            EndCopyFiles
  1138.            ModifyTextFile [WindowsDirectory]\SYSTEM.INI Quietly NoInquiry NoBackup
  1139.           InSection     [386Enh]
  1140.           AddOrChangeLineWith (device=,,DVA.386) as "device=DVA.386" at Beginning IgnoreRemarks
  1141.            EndModifyTextFile
  1142.        EndIF
  1143.      EndIf
  1144.      If [IsWinNT]
  1145.         [WindowsSystemDirectory] := [String2]
  1146.     EndIf
  1147. EndProcedure
  1148.  
  1149.  
  1150. Procedure NoInstallToRootDlg
  1151.   DialogBox 182 72 UseHeader "Allied General   " Returns [Number25] BlackOnLightGray ModalFrame
  1152.     Font "Helv" 10
  1153.     GroupBox @xy(4,3) 174 45 ""
  1154.     LText @xy(6,12) 170 25 [NoInstallRootText]
  1155.     DefPushButton @xy(69,52) 44 16 "OK" 1
  1156.   EndDialogBox
  1157. EndProcedure
  1158.  
  1159. Procedure GetInstallOptions
  1160.     Do TrimInstallFromDir
  1161.     [SetupDirectory] := [InstallFromDirectory]\[SetupDir]
  1162.     Do RestoreInstallFromDir
  1163.  
  1164.     :DoOptsAgain
  1165.     [YesOrNo6] := N
  1166.     If [Options] > 1
  1167.         Do InstallOptions
  1168.     EndIf
  1169.     :DoDirAgain
  1170.     Do PromptInstallDir
  1171.     If [Continue] = 1011
  1172.         GoTo Bail
  1173.     EndIf
  1174.     Do GetTargetDirAndDrive
  1175.     [Dir1] := [InstallationDirectory]
  1176.     Do NoInstallToRoot
  1177.     If [Root]
  1178.         [Root] := N
  1179.         GoTo DoDirAgain
  1180.     EndIf
  1181.     [Drive] := InstallationDrive
  1182.     If [Complete]
  1183.     Do CheckFreeSpace
  1184.         If [YesOrNo6]
  1185.             If [Options] > 1
  1186.                 [Complete] := N
  1187.             EndIf
  1188.             GoTo    DoOptsAgain
  1189.         EndIf
  1190.         [FileSetSize] := [CompleteSize]
  1191.     EndIf
  1192.     If [Typical]
  1193.     Do CheckFreeSpace
  1194.         If [YesOrNo6]
  1195.             [Typical] := N
  1196.             GoTo    DoOptsAgain
  1197.         EndIf
  1198.         [FileSetSize] := [TypicalSize]
  1199.     EndIf
  1200.     If [Minimal]
  1201.     Do CheckFreeSpace
  1202.         If [YesOrNo6]
  1203.             [Minimal] := N
  1204.             GoTo    DoOptsAgain
  1205.         EndIf
  1206.         [FileSetSize] := [MinimalSize]
  1207.     EndIf
  1208.     If [IsWin95]
  1209.         Do ParseLFNDirectory
  1210.         [InstallationDirectory] := [String1]
  1211.         [DefaultDestDir95] := [String5]
  1212.     EndIf
  1213. EndProcedure
  1214.  
  1215. ;; Save this proc for possible later use - Instalit chokes on single
  1216. ;; ' ' (spacebar) characters in arithmatic ASCII operations, even though
  1217. ;; ' ' is a perfectly legal ASCII character
  1218.  
  1219. Procedure ParseLFNDirectory
  1220. ;; [String1] = the SFN returned by LFNCreateDirectory
  1221. ;; [String2] = the LFN full path (working parse buffer)
  1222. ;; [String3] = the parsed single character, compared to '\'
  1223. ;; [String4] = the '\' character, compared to [String3]
  1224. ;; [String5] = a single LFN directory, parsed from [String2]
  1225. ;; [String10] = the LFN full path (constant); converted to SFN form
  1226.  
  1227.     [String2] := [String10]
  1228.     [String10] := BlankString
  1229.     [Number1] := 1
  1230.     [Number2] := LengthOf [String2]
  1231.     [String4] := \
  1232.     [YesOrNo5] := N
  1233.  
  1234.     Do ParseForIllegals
  1235.  
  1236.     [String3] := SubstringOf [String2] from [Number1] to [Number1]
  1237.     :Continue
  1238.         While "[String3]" <> "[String4]"
  1239.             [Number1] := [Number1] + 1
  1240.             If [Number1] > [Number2]
  1241.                 [YesOrNo5] := Y
  1242.                 GoTo Finished
  1243.             EndIf
  1244.             [String3] := SubstringOf [String2] from [Number1] to [Number1]
  1245.         EndWhile
  1246.         :Finished
  1247.         [String3] := BlankString
  1248.         [Number1] := [Number1] - 1
  1249.         [String5] := SubstringOf [String2] from Beginning to [Number1]
  1250.         [Number1] := [Number1] + 1
  1251.         If [Number1] = 3   ;; If this the root, skip LFNCreateDirectory
  1252.             GoTo Continue
  1253.         EndIf
  1254.         LFNGetShortPathName [String5] [String1]
  1255.         If [String1] = BlankString
  1256.             LFNCreateDirectory [String5] [String1]
  1257.         EndIf
  1258.         If [YesOrNo5]
  1259.             GoTo ExitParseLFN
  1260.         EndIf
  1261.     GoTo Continue
  1262.     :ExitParseLFN
  1263.     [String10] := [String1]
  1264. EndProcedure
  1265.  
  1266. ;; use this within ParseLFNDirectory, before creating any directories
  1267. Procedure ParseForIllegals
  1268.     [String6] := ?"/<>*|:
  1269.     [Number3] := 1
  1270.     [Number4] := LengthOf [String6]
  1271.     [String7] := SubstringOf [String6] from [Number3] to [Number3]
  1272.         :Scan
  1273.         If [Number3] <= [Number4]
  1274.             If [String2] Contains [String7]
  1275.                 [Number5] := PositionOf [String7] in [String2]
  1276.                 If [Number5] = 2 ;; If a drive letter colon
  1277.                     GoTo Ok
  1278.                 Else
  1279.                     GoTo DoDirAgain ;;In PromptInstallDir proc
  1280.                 EndIf
  1281.             Else
  1282.                 :Ok
  1283.                 [Number3] := [Number3] + 1
  1284.                 [String7] := SubstringOf [String6] from [Number3] to [Number3]
  1285.                 GoTo Scan
  1286.             EndIf
  1287.         EndIf
  1288. EndProcedure
  1289.  
  1290. Procedure GetTargetDirAndDrive
  1291.   [String1] := [InstallationDirectory]
  1292.   [TargetDir] := SubstringOf [String1] from 3 to End
  1293.   [TargetDrive] := SubstringOf [String1] from 1 to 2
  1294. EndProcedure
  1295.  
  1296. Procedure InstallOptions
  1297.  GetMenuChoice BlackOnLightGray (2*MaxX)/3 MaxY/2 Highlight 1 UseHeader "Allied General" BorDlg SysMenu
  1298.         Recommended
  1299.       ; The Recommended install requires a minimum of 35 MBytes
  1300.       ; of hard disk space. This choice will significantly increase
  1301.       ; both program execution and graphics display speed. An
  1302.             ; additional 4.2 MBytes may be required if Win32s software
  1303.             ; needs to be installed on your system.
  1304.             ; Press the Esc key to exit installation at any time.
  1305.     Minimal
  1306.       ; The Minimal installation requires 6.0 MBytes of hard disk space.
  1307.       ; space.  Choose this option if free space on your hard drive is
  1308.       ; limited. Program performance will vary with your CD drive speed.
  1309.             ; An additional 4.2 MBytes may be required if Win32s software
  1310.             ; needs to be installed on your system.
  1311.             ; Press the Esc key to exit installation at any time.
  1312.     EndGetMenuChoice
  1313.  
  1314.   InCase Choice is
  1315.     =1: [Complete] := Y
  1316.                 [Typical]  := N
  1317. ;;              [Minimal]  := N
  1318.     =2: [Typical]  := Y
  1319.                 [Complete] := N
  1320. ;;                              [Minimal]  := Y
  1321. ;;    =3: [Minimal]  := Y
  1322. ;;                              [Complete] := N
  1323. ;;                              [Typical]  := N
  1324.   EndInCase
  1325. EndProcedure
  1326.  
  1327. Procedure NotEnufFreeHDSpace
  1328.     [String10] := [FileSetSize] [NoFreeSpaceText]
  1329.   DialogBox 182 72 UseHeader "Allied General   " Returns [Number25] BlackOnLightGray ModalFrame
  1330.     Font "Helv" 10
  1331.     GroupBox @xy(4,3) 174 45 ""
  1332.     LText @xy(6,10) 170 35 [String10]
  1333.     DefPushButton @xy(69,52) 44 16 "OK" 1
  1334.   EndDialogBox
  1335. EndProcedure
  1336.  
  1337. Procedure CheckFreeSpace
  1338.   If FreeSpaceOnDrive [Drive] < [FileSetSize]
  1339.     Do NotEnufFreeHDSpace
  1340.         [YesOrNo6] := Y
  1341.   EndIf
  1342. EndProcedure
  1343.  
  1344. Procedure WriteInstallInfoToIni
  1345.     Do TrimInstallFromDir
  1346.     ClearArray      [Array2]
  1347.     [Array2][1] := Data
  1348.     [Array2][2] := Drive
  1349.         [Array2][4] := [InstallationDirectory]\[ProductIniFile]
  1350.         [Array2][3] := [InstallFromDrive]
  1351.     WritePrivateProfileString Using [Array2] NoBackup
  1352.     Do RestoreInstallFromDir
  1353.     ClearArray      [Array2]
  1354.     [Array2][1] := Install
  1355.     [Array2][2] := Options
  1356.     If [Complete]
  1357.         [Array2][3] := Complete
  1358.     EndIf
  1359.     If [Typical]
  1360.         [Array2][3] := Typical
  1361.     EndIf
  1362.     If [Minimal]
  1363.         [Array2][3] := Minimal
  1364.     EndIf
  1365.     [Array2][4] := [InstallationDirectory]\[ProductIniFile]
  1366.     WritePrivateProfileString Using [Array2] NoBackup
  1367. EndProcedure
  1368.  
  1369. Procedure       GetPreviousInstallOption
  1370.     If FileExists [WindowsDirectory]\[ProductIniFile]
  1371.         [String1] :=  [WindowsDirectory]\[ProductIniFile]
  1372.         [PreviousInstall] := Y
  1373.     EndIf
  1374.     If FileExists [InstallationDirectory]\[ProductIniFile]
  1375.         [String1] :=  [WindowsDirectory]\[ProductIniFile]
  1376.         [PreviousInstall] := Y
  1377.     EndIf
  1378.     If [PreviousInstall]
  1379.         ClearArray [Array2]
  1380.         [Array2][1] := Install
  1381.         [Array2][2] := Options
  1382.         [Array2][3] := Minimal
  1383.         [Array2][4] := [String1]
  1384.         GetPrivateProfileString Using [Array2]
  1385.         [PreviousInstallOption] := [Array2][5]
  1386.     EndIf
  1387. EndProcedure
  1388.  
  1389. Procedure NoInstallToRoot
  1390.     [String7] := [Dir1]
  1391.     [String8] := SubstringOf [String7] from 1 to 2
  1392.     If ([String7] = [String8]\)
  1393.         Do NoInstallToRootDlg
  1394.         [Root] := Y
  1395.     EndIf
  1396. EndProcedure
  1397.  
  1398. Procedure EditWin32sIniFile
  1399.   ClearArray [Array2]
  1400.   [Array2][1] := Win32s
  1401.   [Array2][2] := Setup
  1402.   [Array2][3] := 1
  1403.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1404.   WritePrivateProfileString Using [Array2] NoBackup
  1405.  
  1406.   ClearArray [Array2]
  1407.   [Array2][1] := Win32s
  1408.   [Array2][2] := Version
  1409.   [Array2][3] := [Win32sCurrentVersion]
  1410.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1411.   WritePrivateProfileString Using [Array2] NoBackup
  1412.  
  1413.   ClearArray [Array2]
  1414.   [Array2][1] := Nls
  1415.   [Array2][2] := AnsiCP
  1416.   [Array2][3] := 1252
  1417.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1418.   WritePrivateProfileString Using [Array2] NoBackup
  1419.  
  1420.   ClearArray [Array2]
  1421.   [Array2][1] := OLE
  1422.   [Array2][2] := Setup
  1423.   [Array2][3] := 1
  1424.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1425.   WritePrivateProfileString Using [Array2] NoBackup
  1426.  
  1427.   ClearArray [Array2]
  1428.   [Array2][1] := OLE
  1429.   [Array2][2] := Version
  1430.   [Array2][3] := [Ole32sCurrentVersion]
  1431.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1432.   WritePrivateProfileString Using [Array2] NoBackup
  1433. EndProcedure
  1434.  
  1435. Procedure InitWin32sIniFile
  1436.   ClearArray [Array2]
  1437.   [Array2][1] := Win32s
  1438.   [Array2][2] := Setup
  1439.   [Array2][3] := 0
  1440.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1441.   WritePrivateProfileString Using [Array2] NoBackup
  1442.  
  1443.   ClearArray [Array2]
  1444.   [Array2][1] := OLE
  1445.   [Array2][2] := Setup
  1446.   [Array2][3] := 0
  1447.   [Array2][4] := [WindowsSystemDirectory]\[Win32sIniFile]
  1448.   WritePrivateProfileString Using [Array2] NoBackup
  1449. EndProcedure
  1450.  
  1451. Procedure EditSystemIniFile
  1452.     If [BootSectionInvalid]
  1453.         ClearArray [Array2]
  1454.         [Array2][1] := boot
  1455.         [Array2][2] := drivers
  1456.         [Array2][3] := ""
  1457.         [Array2][4] := [WindowsDirectory]\SYSTEM.INI
  1458.         GetPrivateProfileString Using [Array2] NoBackup
  1459.         [String1] := [Array2][5]
  1460.         [String2] := " WINMM16.DLL"
  1461.         ClearArray [Array2]
  1462.         [Array2][1] := boot
  1463.         [Array2][2] := drivers
  1464.         [Array2][3] := [String1][String2]
  1465.         [Array2][4] := [WindowsDirectory]\SYSTEM.INI
  1466.         WritePrivateProfileString Using [Array2] NoBackup
  1467.     EndIf
  1468.     [String1] := Device=[WindowsSystemDirectory]\WIN32S\W32S.386
  1469.     ModifyTextFile [WindowsDirectory]\SYSTEM.INI Quietly NoInquiry NoBackup
  1470.         InSection       [386Enh]
  1471.         AddOrChangeLineWith (device=,,[WindowsSystemDirectory]\WIN32S\W32S.386) as "device=[WindowsSystemDirectory]\WIN32S\W32S.386" at Beginning IgnoreRemarks
  1472. ;;              InsertAtLine    End  [String1]
  1473.     EndModifyTextFile
  1474. EndProcedure
  1475.  
  1476. Procedure       ValidateSystemIniFile
  1477.     ClearArray [Array2]
  1478.   [Array2][1] := boot
  1479.   [Array2][2] := drivers
  1480.   [Array2][3] := ""
  1481.   [Array2][4] := [WindowsDirectory]\SYSTEM.INI
  1482.   GetPrivateProfileString Using [Array2] NoBackup
  1483.     [String1] := [Array2][5]
  1484.     [String2] := "WINMM16.DLL"
  1485.     [Number1] :=  1
  1486.     [Number2] :=  LengthOf [String2]
  1487.     [Number3] :=  LengthOf [String1]
  1488.     [String3] := SubstringOf [String1] from [Number1] to [Number2]
  1489.     While [String2] <> [String3]
  1490.         [Number1] :=  [Number1] + 1
  1491.         [Number2] :=  [Number2] + 1
  1492.         If [Number2] > [Number3]
  1493.             [BootSectionInvalid] := Y
  1494.             GoTo Validate386EnhSection
  1495.         EndIf
  1496.         [String3] := SubstringOf [String1] from [Number1] to [Number2]
  1497.     EndWhile
  1498.     :Validate386EnhSection
  1499. EndProcedure
  1500.  
  1501. Procedure SignOff
  1502.   DeleteFiles from [WindowsDirectory] Quietly
  1503.     *.01
  1504.   EndDeleteFiles
  1505.   Dialog BlackOnLightGray UseHeader "Allied General   "
  1506.     [SignOffText]
  1507.   EndDialog
  1508. EndProcedure
  1509.  
  1510. Procedure RestartWindows
  1511.     Do RestartDlgBox
  1512.     If [Restart] = 1016
  1513.         If FileInUse
  1514.             SetCopyAttrTo 00
  1515.             CopyFiles from [SetupDirectory] to [WindowsSystemDirectory] Quietly
  1516.                 FREPLACE.EXE
  1517.             EndCopyFiles
  1518.             [FileReplaceExe] := [WindowsSystemDirectory]\FREPLACE.EXE [InstallationDirectory]\LOGFILE
  1519.             Reboot WindowsAndExec [FileReplaceExe]
  1520.             If [Win32Installed]
  1521.                 Do EditWin32sIniFile
  1522.             EndIf
  1523.         Else
  1524.             Reboot Windows
  1525.         EndIf
  1526.     Else
  1527.         Do RestartReminderDlg
  1528.     EndIf
  1529. EndProcedure
  1530.  
  1531. Procedure RestartDlgBox
  1532.   DialogBox 200 65 UseHeader "Allied General   " Returns [Restart] BlackOnLightGray ModalFrame
  1533.     GroupBox @xy(5,3) 190 34 ""
  1534.     LText @xy(8,12) 183 24 [RestartText]
  1535.     DefPushButton @xy( 34, 42) 40 16 [YES_text] 1016
  1536.     PushButton @xy(129, 42) 40 16 [NO_text] 1015
  1537.   EndDialogBox
  1538.   ClearScreen
  1539. EndProcedure
  1540.  
  1541. Procedure RestartReminderDlg
  1542.   Dialog  4000 BlackOnLightGray
  1543.     [RestartReminderText]
  1544.   EndDialog
  1545. EndProcedure
  1546.  
  1547. Procedure VerInstallOle32s
  1548.         Logging On
  1549.         If FileExists [WindowsSystemDirectory]\COMPOBJ.DLL
  1550.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\COMPOBJ.DLL
  1551.             [String4] := FileVersionOf [WindowsSystemDirectory]\COMPOBJ.DLL
  1552.             If [String3] > [String4]
  1553.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1554.                     COMPOBJ.DLL
  1555.                 EndCopyFiles
  1556.             EndIf
  1557.         Else
  1558.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1559.                     COMPOBJ.DLL
  1560.                 EndCopyFiles
  1561.         EndIf
  1562.         If FileExists [WindowsSystemDirectory]\OLE2.DLL
  1563.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\OLE2.DLL
  1564.             [String4] := FileVersionOf [WindowsSystemDirectory]\OLE2.DLL
  1565.             If [String3] > [String4]
  1566.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1567.                     OLE2.DLL
  1568.                 EndCopyFiles
  1569.             EndIf
  1570.         Else
  1571.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1572.                     OLE2.DLL
  1573.                 EndCopyFiles
  1574.         EndIf
  1575.         If FileExists [WindowsSystemDirectory]\OLE2PROX.DLL
  1576.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\OLE2PROX.DLL
  1577.             [String4] := FileVersionOf [WindowsSystemDirectory]\OLE2PROX.DLL
  1578.             If [String3] > [String4]
  1579.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1580.                     OLE2PROX.DLL
  1581.                 EndCopyFiles
  1582.             EndIf
  1583.         Else
  1584.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1585.                     OLE2PROX.DLL
  1586.                 EndCopyFiles
  1587.         EndIf
  1588.         If FileExists [WindowsSystemDirectory]\OLE2CONV.DLL
  1589.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\OLE2CONV.DLL
  1590.             [String4] := FileVersionOf [WindowsSystemDirectory]\OLE2CONV.DLL
  1591.             If [String3] > [String4]
  1592.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1593.                     OLE2CONV.DLL
  1594.                 EndCopyFiles
  1595.             EndIf
  1596.         Else
  1597.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1598.                     OLE2CONV.DLL
  1599.                 EndCopyFiles
  1600.         EndIf
  1601.         If FileExists [WindowsSystemDirectory]\OLE2NLS.DLL
  1602.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\OLE2NLS.DLL
  1603.             [String4] := FileVersionOf [WindowsSystemDirectory]\OLE2NLS.DLL
  1604.             If [String3] > [String4]
  1605.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1606.                     OLE2NLS.DLL
  1607.                 EndCopyFiles
  1608.             EndIf
  1609.         Else
  1610.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1611.                     OLE2NLS.DLL
  1612.                 EndCopyFiles
  1613.         EndIf
  1614.         If FileExists [WindowsSystemDirectory]\OLE2DISP.DLL
  1615.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\OLE2DISP.DLL
  1616.             [String4] := FileVersionOf [WindowsSystemDirectory]\OLE2DISP.DLL
  1617.             If [String3] > [String4]
  1618.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1619.                     OLE2DISP.DLL
  1620.                 EndCopyFiles
  1621.             EndIf
  1622.         Else
  1623.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1624.                     OLE2DISP.DLL
  1625.                 EndCopyFiles
  1626.         EndIf
  1627.         If FileExists [WindowsSystemDirectory]\TYPELIB.DLL
  1628.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\TYPELIB.DLL
  1629.             [String4] := FileVersionOf [WindowsSystemDirectory]\TYPELIB.DLL
  1630.             If [String3] > [String4]
  1631.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1632.                     TYPELIB.DLL
  1633.                 EndCopyFiles
  1634.             EndIf
  1635.         Else
  1636.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1637.                     TYPELIB.DLL
  1638.                 EndCopyFiles
  1639.         EndIf
  1640.         If FileExists [WindowsSystemDirectory]\STORAGE.DLL
  1641.             [String3] := FileVersionOf [InstallFromDirectory][Win32sDir]\STORAGE.DLL
  1642.             [String4] := FileVersionOf [WindowsSystemDirectory]\STORAGE.DLL
  1643.             If [String3] > [String4]
  1644.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1645.                     STORAGE.DLL
  1646.                 EndCopyFiles
  1647.             EndIf
  1648.         Else
  1649.                 CopyFiles from [InstallFromDirectory][Win32sDir] to [WindowsSystemDirectory] Quietly
  1650.                     STORAGE.DLL
  1651.                 EndCopyFiles
  1652.         EndIf
  1653. EndProcedure
  1654.  
  1655. Procedure DDENonFatalErrorTrap
  1656. ;; Trap the dde error for ReplaceItem.
  1657. ;; See Simple.Stf for more information on how to
  1658. ;; use ProgramManager's DDENonFatalErrorTrap.
  1659. EndProcedure
  1660.  
  1661. EndScript
  1662.