home *** CD-ROM | disk | FTP | other *** search
/ Larousse Encyclopedie de L'Espace et de L'Univers / LirisInteractive-LarousseEncyclopedieEspaceUnivers-French-Win31.iso / dksetup / dkgen.inc < prev    next >
Text File  |  1997-03-10  |  34KB  |  885 lines

  1. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. '
  3. '   DKGEN.INC
  4. '
  5. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. ' See the change history in DKSETUP.MST for more recent changes.
  7. '
  8. '25/06/96 Added the extra ini settinigs into the InstallQTW function.
  9. '27/02/96 Added the InstallQTW function.
  10. '25/01/96 Change the EndCommonInstall and HandleRestart SUB's to Functions to
  11. '         utilise return values. So the user does NOT get the 'You must restart
  12. '         windows' warning AND THEN the 'Successful install' dialog box.
  13. '25/01/96 Change path checking to look for Max of 8 chars first.
  14. '08/08/95 Test for Norton Anti Virus
  15. '03/08/95 const for uninstall and min register added
  16. '07/07/95 Correct so unregisters use of ctl3d
  17. '01/06/95 No choice about adding icons to progman
  18. '?/05/95  If bundle with sampler need to test for cirrus driver - put into mst file
  19. '12/03/95 Alternative function added, readme icon has shortened name
  20.  
  21. '$INCLUDE 'setupapi.inc'
  22. '$INCLUDE 'msdetect.inc'
  23. '$INCLUDE 'dklang.inc'
  24.  
  25. '   Defines unlikely to change
  26. CONST APPLICATION_MENU_FILE     = "custmenu.exe"
  27. CONST INI_FILE_SOURCE = "AppPath" ' OR  "WinPath"
  28. CONST EDITOR_EXE        = "write.exe "
  29. CONST SAMPLER_PATH      = "SAMPLER"
  30. CONST SAMPLER_EXE_FILE  = "sampler.exe"
  31. CONST SAMPLER_INI_FILE  = "sampler.ini"
  32. CONST SAMPLER_BINARIES_SECTION_NAME = "SAMPBIN"
  33. CONST SAMPLER_README_FILE = "SREADME.WRI"
  34.  
  35. CONST SOURCE_BINARIES_SUBDIR = "DKCODE"
  36. CONST SOURCE_SETUP_SUBDIR = "DKSETUP"
  37. CONST SETUP_INF_FILENAME = "SETUP.INF"
  38. CONST CUIDLL_FILENAME = "mscuistf.dll"
  39. CONST SETUP_INI_BINARIES_SECTION_NAME = "BIN"
  40. CONST SETUP_INI_SH_BINARIES_SECTION_NAME = "BIN Shared"
  41. CONST SETUP_INI_WING_BINARIES_NAME = "WinG Runtime"
  42. CONST SETUP_INI_WING32_BINARIES_NAME = "WinG32"
  43. CONST SETUP_INI_ACM_SECTION_NAME = "ACM Drivers"
  44. CONST SETUP_INI_FONTS_SECTION_NAME = "Fonts"
  45.  
  46. 'unin, min register
  47. CONST UNINSTALL_EXE_FILE = "UNINSTAL.exe"
  48. CONST DKREG_INI_DIR = "\MMAPP"
  49. CONST DKREG_INI_PATH = "\MMAPP\MMAPP.ini"
  50. CONST WIN_INI_ENTRY = "path"
  51.  
  52. CONST PRODUCT_INI_DIR_SECTION_NAME = "Directory"
  53. CONST PRODUCT_INI_DIR_ENTRY_NAME = "Data"
  54.  
  55. CONST MINIMUM_DISK_SPACE = 2048 ' For Minimum install
  56.  
  57. ' Procs
  58. CONST PROC_HELP = "FHelpDlgProc"
  59.  
  60. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (szEXE$, szParams$) AS INTEGER
  61. DECLARE FUNCTION GetActiveWindow    lib "User" () as integer
  62. DECLARE FUNCTION SetWindowPos       lib "User" (hwnd as integer, hwnd as integer, i as integer, i as integer, i as integer, i as integer, w as integer) as integer
  63.  
  64. DECLARE FUNCTION Ctl3dRegister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  65. DECLARE FUNCTION Ctl3dUnregister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  66. DECLARE FUNCTION Ctl3dAutoSubClass LIB "CTL3D.DLL" (hInst%) AS INTEGER
  67.  
  68. DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
  69. DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
  70. DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
  71. DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
  72. DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
  73. DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
  74.  
  75. DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER
  76. DECLARE FUNCTION FIs256Colour LIB "mscuistf.dll" AS INTEGER
  77. DECLARE FUNCTION Welcome() AS INTEGER
  78. DECLARE FUNCTION TestSystem() AS INTEGER
  79. DECLARE FUNCTION GetDiskSpaceNeeded(drive%) AS LONG
  80. DECLARE SUB Initialise(prodName$, defInstallPath$, msgCaption$)
  81. DECLARE SUB DeInitialise()
  82. DECLARE SUB AskQuit()
  83. DECLARE SUB BadPath()
  84. DECLARE SUB NetworkDrive()
  85. DECLARE SUB UpdateIndeoAVIDrivers()
  86. DECLARE SUB UpdateWinGDrivers()
  87. 'DECLARE SUB UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  88. 'DECLARE SUB UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  89. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  90. DECLARE FUNCTION GetRealWindowsSysDir AS STRING
  91. DECLARE SUB UpdateWinG32 (szOrig$)
  92. DECLARE SUB InitCommonInstall()
  93. DECLARE FUNCTION LicenseAgreement() AS INTEGER
  94. DECLARE FUNCTION Win32sRequiredDLG() AS INTEGER
  95. DECLARE FUNCTION UpdateADPCMDrivers() AS INTEGER
  96. DECLARE FUNCTION EndCommonInstall( AppReadmeFile$, InRoot%, szEditorExe$ ) AS INTEGER
  97. DECLARE FUNCTION HandleRestart() AS INTEGER
  98. DECLARE FUNCTION InstallQTW() As Integer
  99.  
  100. '  SetWindowPos() flags
  101. const SWP_NOSIZE         = &H0001
  102. const SWP_NOMOVE         = &H0002
  103. const SWP_NOACTIVATE     = &H0010
  104. const SWP_SHOWWINDOW     = &H0040
  105. const SWP_HIDEWINDOW     = &H0080
  106. const HWND_TOP       = (0)
  107. const HWND_BOTTOM    = (1)
  108. const HWND_TOPMOST   = (-1)
  109. const HWND_NOTOPMOST = (-2)
  110.  
  111.  
  112. 'Dialog Box ID's
  113. CONST DLG_ABORT                       =100
  114. CONST DLG_ADDSYSTEMSOFT               =101
  115. CONST DLG_ADPCMHELP                   =102
  116. CONST DLG_AWFULMACHINE                =103
  117. CONST DLG_BADEXIT                     =110
  118. CONST DLG_BADVGA                      =111
  119. CONST DLG_BADPATH                     =112
  120. CONST DLG_BILLBOARD                   =113
  121. CONST DLG_CUSTOM                      =120
  122. CONST DLG_CUSTOMHELP                  =121
  123. CONST DLG_DESTPATH                    =130
  124. CONST DLG_DEVELOPER                     =133
  125. CONST DLG_DONEVIDEO                   =131
  126. CONST DLG_DONENOVIDEO                 =132
  127. CONST DLG_EXITFAILNOTENH              =140
  128. CONST DLG_EXITFAILNOTINTEL            =141
  129. CONST DLG_EXITFAILNOTWIN31            =142
  130. CONST DLG_EXITFAILRUNAPP              =143
  131. CONST DLG_FREECELLINST                =150
  132. CONST DLG_INSTALLQTW                  =180
  133. CONST DLG_LICENSE                     =210
  134. CONST DLG_MAILMAN                     =220
  135. CONST DLG_NOSPACE                     =230
  136. CONST DLG_NEEDS31                     =231
  137. CONST DLG_NOMOUSE                     =232
  138. CONST DLG_NOT256                      =233
  139. CONST DLG_NOSYSSOFT                   =234
  140. CONST DLG_NODISKSPACE                 =235
  141. CONST DLG_NEEDSWIN32S                 =236
  142. CONST DLG_NETWORKDRIVE                =237
  143. CONST DLG_PATHHELP                    =240
  144. CONST DLG_POORMACHINE                 =241
  145. CONST DLG_PROGMANGROUP                =242
  146. CONST DLG_PROGMANGRP                  =243
  147. CONST DLG_QUIT                        =250
  148. CONST DLG_SPEED                       =270
  149. CONST DLG_SUCCESS                     =271
  150. CONST DLG_URKADPCM                    =290
  151. CONST DLG_WELCOME                     =310
  152. CONST DLG_WELHELP                     =311
  153. CONST DLG_WRONGADPCM                  =312
  154. CONST DLG_WHIZZHELP                   =313
  155. 'Bitmap ID
  156. CONST IDB_BITMAP                      =1000
  157.  
  158. ' Error messages
  159. CONST ERR_OK = 100
  160. CONST ERR_EXITFAIL = 101
  161. CONST ERR_WINVERFAIL = 102
  162. CONST ERR_NODISKSPACE = 103
  163.  
  164. ' Navigation messages
  165. CONST NAV_FORWARD = 0
  166. CONST NAV_BACK = 1
  167. CONST NAV_EXIT = 2
  168. CONST NAV_RUN = 3
  169.  
  170.  
  171. GLOBAL szDirectCommand As String
  172. GLOBAL szWinPath As String
  173. GLOBAL szWinSysPath As String
  174. GLOBAL szWinDrive As String
  175. GLOBAL szSrcSetupPath As String
  176. GLOBAL szSrcBinPath As String
  177. GLOBAL szDestPath As String
  178. GLOBAL szOldDestPath As String
  179. GLOBAL szPengePath As String
  180. GLOBAL szINFPath As String
  181. GLOBAL szAppINIPath As String
  182. GLOBAL szMsgCaption As String
  183. GLOBAL szButton As String
  184. GLOBAL szMinimalInstall As String
  185. GLOBAL szAddPMItem As String
  186. GLOBAL szExpressCustomChoice As String
  187. GLOBAL szMMappPath As String
  188. GLOBAL szInstExePath As String
  189. GLOBAL szInstExeDate As String
  190. GLOBAL szCdExePath As String
  191. GLOBAL szCdExeDate As String
  192. GLOBAL szCopyright As String
  193. GLOBAL szFullSampPath As String
  194. GLOBAL szSampINIPath As String
  195. GLOBAL szSampData As String
  196. GLOBAL szSampVersion As String
  197. GLOBAL szMsacmPriority1 As String
  198. GLOBAL szMsacmPriority2 As String
  199. GLOBAL szMsacmPriority3 As String
  200. GLOBAL bInstalledWin32s As Integer
  201. GLOBAL APPLICATION_INI_FILE As String
  202. GLOBAL APPLICATION_EXE_FILE As String
  203. GLOBAL APPLICATION_PENGE_FILE As String
  204. GLOBAL szDKRegIni As String ' MMAPP.INI
  205.  
  206. GLOBAL fPreviousMode As Integer
  207. GLOBAL fWillNotFit As Integer
  208. GLOBAL fSystemUpdated As Integer
  209. GLOBAL hDlg As Integer
  210. GLOBAL dButton As Integer
  211. GLOBAL dWinDrive As Integer
  212. GLOBAL dDestDrive As Integer
  213. GLOBAL dCursor As Integer
  214. GLOBAL hwndSetup As Integer
  215. GLOBAL OS_Windows95 As Integer
  216. GLOBAL bscrunged As Integer
  217.  
  218. ' This file needs the above globals etc for it's functions
  219. '$INCLUDE 'product.inc' 'Defines which change for every product
  220.  
  221. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  222. Sub InitCommonInstall() STATIC
  223.     AddToBillboardList CUIDLL_FILENAME, DLG_MAILMAN, "MailmanDlgProc", 2500
  224.     SetCopyGaugePosition -1, 150
  225. End Sub
  226.  
  227.  
  228. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  229. Function EndCommonInstall( AppReadmeFile$, InRoot%, szEditorExe$ ) STATIC AS INTEGER
  230.  
  231.     if RestartListEmpty = 0 or fSystemUpdated = 1 or bInstalledWin32s = 1 then
  232.         hDlg = DLG_DONEVIDEO
  233.     else
  234.         hDlg = DLG_DONENOVIDEO
  235.     end if
  236.  
  237. QuitLoop:
  238.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfoDlgProc", 0, "")
  239.     select case szButton
  240.     case "REACTIVATE"
  241.         goto QuitLoop
  242.     case "CONTINUE"     'Read me
  243.         if inRoot% = 1 then
  244.             szReadMe$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appReadmeFile$)
  245.         else
  246.             szReadMe$ = MakePath(szSrcBinPath, appReadmeFile$)
  247.         end if
  248.         if szEditorExe$ = "write.exe " then
  249.             run szEditorExe$ + szReadMe$, nowait
  250.         else
  251.             run szEditorExe$ + szReadMe$
  252.         end if
  253.         goto QuitLoop
  254.     case "BACK"     'Restart Windows
  255.         if HandleRestart = 0 then
  256.             dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  257.             EndCommonInstall = NAV_EXIT
  258.         else
  259.             EndCommonInstall = NAV_FORWARD
  260.         end if
  261.     case "EXIT" , "CANCEL"         'Return to Windows
  262.         if hDlg = DLG_DONEVIDEO then
  263.             dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  264.             EndCommonInstall = NAV_EXIT
  265.         else
  266.             EndCommonInstall = NAV_FORWARD
  267.         end if
  268.     end select
  269.  
  270.     UIPop 1
  271. End Function
  272.  
  273.  
  274. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  275. Sub Initialise(prodName$, defInstallPath$, msgCaption$) STATIC
  276.     ret% = Ctl3dRegister(HinstFrame())
  277.     ret% = Ctl3dAutoSubClass(HinstFrame())
  278.  
  279.     szMsgCaption$ = msgCaption$
  280.  
  281.     cursor% = ShowWaitCursor()
  282.  
  283.     ClearCopyList
  284.     szWinSysPath = ucase$(GetWindowsSysDir ())
  285.     szWinPath = ucase$(GetWindowsDir ())
  286.     dWinDrive = asc(mid$((szWinPath), 1,1)) - asc("A")+1
  287.     szWinDrive = mid$(szWinPath, 1,1)
  288.  
  289.     szSrcSetupPath = ucase$(GetSymbolValue ("STF_SRCDIR"))
  290.     szSrcBinPath = mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1) + SOURCE_BINARIES_SUBDIR
  291.     szDestPath = szWinDrive + ":" + defInstallPath$
  292.  
  293. '+++
  294. '$IFDEF WITH_FULL_SAMPLER
  295.     szFullSampPath = szWinDrive + ":" + "\LAROUSSE\" + SAMPLER_PATH
  296. '$ENDIF
  297. '---
  298.  
  299.     SetTitle szMsgCaption$
  300.     SetBitmap CUIDLL_FILENAME, IDB_BITMAP
  301.     szCopyright = STR_COPYRIGHT + "     Setup " + STR_VERSION
  302.     SetAbout prodName$, szCopyright
  303.  
  304.     fPreviousMode = SetBeepingMode (1)
  305.     fPreviousMode = SetDecompMode (1)
  306.     fPreviousMode = SetSilentMode (0)
  307.  
  308.     szINFPath = ucase$(GetSymbolValue("STF_SRCINFPATH"))
  309.     if szINFPath = "" then
  310.         szINFPath = ucase$(GetSymbolValue("STF_CWDDIR")) + SETUP_INF_FILENAME
  311.     end if
  312.     ReadInfFile szINFPath
  313.  
  314.     szExpressCustomChoice = "EXPRESS"
  315.     szMinimalInstall = "OFF"
  316. '    szAddPMItem = "ON"
  317.  
  318.     fSystemUpdated = 0
  319.     bInstalledWin32s = 0
  320.  
  321.     ' Set up Application file names
  322.     APPLICATION_INI_FILE = APP_SHORTNAME + ".INI"
  323.     APPLICATION_EXE_FILE = APP_SHORTNAME + ".EXE"
  324.     APPLICATION_PENGE_FILE = APP_SHORTNAME + ".PNG"
  325.  
  326.     RestoreCursor(cursor%)
  327. End Sub
  328.  
  329.  
  330. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  331. Sub DeInitialise() STATIC
  332.     ret% = Ctl3dUnregister(HinstFrame())
  333. End Sub
  334.  
  335.  
  336. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  337. Sub AskQuit() STATIC
  338. begin:
  339.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_QUIT, "FQuitDlgProc", 0, "")
  340.     select case szButton
  341.     case "REACTIVATE"
  342.         goto begin
  343.     case "EXIT" , "CANCEL"
  344.         error STFQUIT
  345.     case "CONTINUE"
  346.         UIPop 1
  347.     end select
  348. End Sub
  349.  
  350.  
  351. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  352. Sub BadPath() STATIC
  353. begin:
  354.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_BADPATH, "FInfo0DlgProc", 0, "")
  355.     select case szButton
  356.     case "REACTIVATE"
  357.         goto begin
  358.     end select
  359.     UIPop 1
  360. End Sub
  361.  
  362.  
  363.  
  364. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  365. Sub NetworkDrive() STATIC
  366. begin:
  367.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_NETWORKDRIVE, "FInfo0DlgProc", 0, "")
  368.     select case szButton
  369.     case "REACTIVATE"
  370.         goto begin
  371.     end select
  372.     UIPop 1
  373. End Sub
  374.  
  375. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  376. Function LicenseAgreement() STATIC As Integer
  377. begin:
  378.     szButton = UIStartDlg( CUIDLL_FILENAME, DLG_LICENSE, "FInfoDlgProc", 0, "" )
  379.     select case szButton
  380.     case "CONTINUE"
  381.         UIPop 1
  382.         LicenseAgreement = NAV_FORWARD
  383.     case "EXIT" , "CANCEL"
  384.         LicenseAgreement = NAV_EXIT
  385.     end select
  386. End Function
  387.  
  388. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  389. Function Welcome() STATIC As Integer
  390. begin:
  391.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_WELCOME, "FInfoDlgProc", DLG_WELHELP, PROC_HELP)
  392.     select case szButton
  393.     case "REACTIVATE"
  394.         goto begin
  395.     case "CONTINUE"
  396.         UIPop 1
  397.         Welcome = NAV_FORWARD
  398.     case "EXIT" , "CANCEL"
  399.         AskQuit
  400.         goto begin
  401.     end select
  402. End Function
  403.  
  404. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  405. Function TestSystem() STATIC As Integer
  406.  
  407. TestNortonAntiVirus:
  408.     szWinString$ = GetIniKeyString( "win.ini", "windows", "load")
  409.     ret% = instr( szWinString,"NAV\navtsrw.exe" )
  410.     if ret% <> 0  then
  411.         dButton = DoMsgBox(STR_NAV, szMsgCaption$, MB_OK)
  412.     endif
  413.  
  414. TestWinVer:
  415.     if GetWindowsMajorVersion() < 3 or (GetWindowsMajorVersion() = 3 and GetWindowsMinorVersion() < 10) then
  416.         TestWinVerDlgLoop:
  417.             szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NEED31, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  418.             select case szButton
  419.             case "EXIT" , "CANCEL"
  420.                 goto TestWinVerDlgLoop
  421.             end select
  422.     end if
  423.  
  424.     ' Check for Win 95
  425.     OS_Windows95 = 0
  426.     if ((GetWindowsMajorVersion * 100 + GetWindowsMinorVersion) > 350) THEN
  427.         OS_Windows95 = 1
  428.     end if
  429.  
  430. TestVGA:
  431.     if GetScreenWidth () < 640 or GetScreenHeight () < 480 then
  432.         TestVGADlgLoop:
  433.             szButton = UIStartDlg (CUIDLL_FILENAME, DLG_BADVGA, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  434.             select case szButton
  435.             case "REACTIVATE"
  436.                 goto TestVGADlgLoop
  437.             case "BACK"
  438.                 UIPop 1
  439.                 TestSystem = NAV_BACK
  440.                 goto back
  441.             case "CONTINUE"
  442.                 TestSystem = NAV_FORWARD
  443.                 UIPop 1
  444.                 goto TestMouse
  445.             case "EXIT" , "CANCEL"
  446.                 AskQuit
  447.                 goto TestVGADlgLoop
  448.             end select
  449.         end if
  450.  
  451. TestMouse:
  452.     if HasMouseInstalled() = false then
  453.     TestMouseDlgLoop:
  454.         szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NOMOUSE, "FInfoDlgProc", DLG_AWFULMACHINE, PROC_HELP)
  455.         select case szButton
  456.         case "REACTIVATE"
  457.             goto TestMouseDlgLoop
  458.         case "BACK"
  459.             UIPop 1
  460.             TestSystem = NAV_BACK
  461.         case "CONTINUE"
  462.             TestSystem = NAV_FORWARD
  463.             UIPop 1
  464.             goto TestColour
  465.         case "EXIT" , "CANCEL"
  466.             AskQuit
  467.             goto TestMouseDlgLoop
  468.         end select
  469.     end if
  470.  
  471. TestColour:
  472.     if FIs256Colour() = false then
  473.     TestColourDlgLoop:
  474.         szButton = UIStartDlg (CUIDLL_FILENAME, DLG_NOT256, "FInfoDlgProc", DLG_POORMACHINE, PROC_HELP)
  475.         select case szButton
  476.         case "REACTIVATE"
  477.             goto TestColourDlgLoop
  478.         case "BACK"
  479.             UIPop 1
  480.             TestSystem = NAV_BACK
  481.             goto back
  482.         case "CONTINUE"
  483.             UIPop 1
  484.             TestSystem = NAV_FORWARD
  485.         case "EXIT" , "CANCEL"
  486.             AskQuit
  487.             goto TestColourDlgLoop
  488.         end select
  489.     end if
  490.  
  491. back:
  492. End Function
  493.  
  494.  
  495. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  496. '**
  497. '** Purpose:
  498. '**     Appends a file name to the end of a directory path,
  499. '**     inserting a backslash character as needed.
  500. '** Arguments:
  501. '**     szDir$  - full directory path (with optional ending "\")
  502. '**     szFile$ - filename to append to directory
  503. '** Returns:
  504. '**     Resulting fully qualified path name.
  505. '*************************************************************************
  506. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  507.     IF szDir$ = "" THEN
  508.         MakePath = szFile$
  509.     ELSEIF szFile$ = "" THEN
  510.         MakePath = szDir$
  511.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  512.         MakePath = szDir$ + szFile$
  513.     ELSE
  514.         MakePath = szDir$ + "\" + szFile$
  515.     END IF
  516. END FUNCTION
  517.  
  518.  
  519.  
  520. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  521. Function HandleRestart() STATIC AS INTEGER
  522.     ' Check there are system files to install AND check if Windows v3.1 or greater
  523.     if RestartListEmpty = 0 and GetWindowsMajorVersion >= 3 and GetWindowsMajorVersion >= 1 then
  524.         dButton = DoMsgBox(STR_EXIT, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  525.         tryagain:
  526.         if ExitExecRestart = 1 then
  527.             ' Exit failed
  528.             dButton = DoMsgBox(STR_EXITFAIL, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONSTOP)
  529.             goto tryagain
  530.         end if
  531.     end if
  532.  
  533.     HandleRestart = 1
  534.  
  535.     if RestartListEmpty = 1 then ' Empty, but we have to reboot
  536.         dummy% = ExitWindowsExec(MakePath(szDestPath, "_msrstrt.exe"), "")
  537.         if dummy% = 0 then
  538.             HandleRestart = 0
  539.         end if
  540.     end if
  541.  
  542. End Function
  543.  
  544. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  545. 'Sub UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  546. 'Dim szReadmeTitle As String
  547. 'Dim szInf As String
  548. '
  549. '    if onCDROM% = 1 then    'sampler
  550. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  551. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  552. '        szReadmeTitle = prodName$ + " " + readmeStr$
  553. '
  554. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  555. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  556. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  557. '    else
  558. '        if szAddPMItem = "ON" then
  559. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  560. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  561. '            szReadmeTitle = prodName$ + " " + readmeStr$
  562. '            if szMinimalInstall = "ON" then
  563. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  564. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  565. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  566. '            else
  567. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  568. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  569. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  570. '            end if
  571. '        end if
  572. '    end if
  573. '
  574. 'End Sub
  575.  
  576.  
  577. ''''''''''''''''''''''''''''''''''''''''''''
  578.  
  579. '' Alternative function for french stowaway
  580. '' Readme icon has shortened name
  581. 'Sub UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  582. 'Dim szReadmeTitle As String
  583. 'Dim szInf As String
  584. '
  585. '    if onCDROM% = 1 then    'sampler
  586. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  587. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  588. '        szReadmeTitle = readmeName$ + " " + readmeStr$
  589. '
  590. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  591. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  592. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  593. '   else
  594. '        if szAddPMItem = "ON" then
  595. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  596. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  597. '            szReadmeTitle = readmeName$ + " " + readmeStr$
  598. '            if szMinimalInstall = "ON" then
  599. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  600. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  601. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  602. '            else
  603. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  604. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  605. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  606. '            end if
  607. '        end if
  608. '    end if
  609. '
  610. 'End Sub
  611.  
  612.  
  613.  
  614. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  615. Function GetDiskSpaceNeeded( drive% ) STATIC As Long
  616. Dim dDummy As Long
  617.  
  618.     cursor% = ShowWaitCursor()
  619.  
  620.     SetSymbolValue "ExtraSpace", ""
  621.     SetSymbolValue "Needed", ""
  622.     SetSymbolValue "Cost", ""
  623.  
  624.     'Drives A - Z
  625.     for i% = 1 to 26
  626.         AddListItem "ExtraSpace", ""
  627.     next i%
  628.  
  629.     ReplaceListItem "ExtraSpace", dWinDrive, str$(MINIMUM_DISK_SPACE)    '2K for the INI file
  630.  
  631.     dDummy = GetCopyListCost("ExtraSpace","Needed","Cost")
  632.  
  633.     GetDiskSpaceNeeded = val(GetListItem ("Needed", drive))
  634.  
  635.     RemoveSymbol "Needed"
  636.     RemoveSymbol "Cost"
  637.     RemoveSymbol "ExtraSpace"
  638.  
  639.     RestoreCursor(cursor%)
  640. End Function
  641.  
  642.  
  643.  
  644. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  645. Sub UpdateIndeoAVIDrivers() STATIC
  646. Dim szWMDriver As String
  647. Dim szACMDriver As String
  648.  
  649.  
  650.     ' Dont update VFW on Win 95. It is already there.
  651.     IF OS_Windows95 = 0 then
  652.  
  653.         szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  654.  
  655.         if not(szWMDriver = "msacm.drv") then
  656.             fSystemUpdated = 1
  657.         end if
  658.  
  659.  
  660.         if VflatdPresent() = 0 then
  661.             CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  662.             fSystemUpdated = 1
  663.         end if
  664.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  665.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  666.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  667.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  668.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  669.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  670.         CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  671.         CreateIniKeyValue szWinPath + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  672.         CreateIniKeyValue szWinPath + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  673.         CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  674.  
  675.     END IF
  676.  
  677. End Sub
  678.  
  679. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  680. Sub UpdateWinGDrivers() STATIC
  681. Dim szDest As String
  682. Dim szDest1 As String
  683. Dim szDest2 As String
  684.  
  685.     ' only use DVA on Windows 3.x
  686.     if OnWin3x() = 1 then
  687.         AddSectionFilesToCopyList "dva", szSrcBinPath, szWinSysPath
  688.         if VflatdPresent() = 0 then
  689.             ' Taken out the path in the following device=dva.386 system.ini entry
  690.             CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  691.             fSystemUpdated = 1
  692.         end if
  693.     end if
  694.  
  695.     szDest = GetRealWindowsSysDir
  696.     szDest1 = MakePath(szDest,"wing32.dll")
  697.     szDest2 = MakePath(szDest,"wing32.xxx")
  698.     RenameFilePlease szDest1, szDest2
  699.  
  700.     UpdateWinG32 GetRealWindowsSysDir()
  701. End Sub
  702.  
  703. '''''''''''''''''''''''''''''''''''''''''''''''''
  704.  
  705. FUNCTION GetRealWindowsSysDir STATIC AS STRING
  706.     szBuf$ = string$(260, 32)
  707.     cbBuf% = GetRealSystemDir(szBuf$, 260)
  708.     IF cbBuf% = 0 THEN
  709.         ERROR STFERR
  710.     ELSE
  711.         IF cbBuf% > 259 THEN
  712.             res% = DoMsgBox("Buffer Overflow", "MS-Setup Error", MB_ICONHAND+MB_OK)
  713.             ERROR STFERR
  714.         END IF
  715.         szBuf$ = RTRIM$(szBuf$)
  716.         IF MID$(szBuf$, 1, 1) = "\" THEN
  717.             szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  718.         ELSEIF MID$(szBuf$, 2, 1) <> ":" THEN
  719.             szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  720.         END IF
  721.         IF MID$(szBuf$, LEN(szBuf$), 1) <> "\" THEN
  722.             szBuf$ = szBuf$ + "\"
  723.         END IF
  724.         GetRealWindowsSysDir = szBuf$
  725.     END IF
  726.  
  727.     szBuf$ = ""
  728. END FUNCTION
  729.  
  730. '''''''''''''''''''''''''''''''''''''''''''''''''
  731.  
  732. SUB UpdateWinG32 (szOrig$) STATIC
  733.     '
  734.     ' Here we check the version ourselves of wing32.dll, since
  735.     ' we can't get version checking for Win32 apps from Win16
  736.     '
  737.     FileNew$ = MakePath(szOrig$, "wing32.dll")
  738.     FileOrig$ = MakePath(szOrig$, "wing32.xxx")
  739.     IF IsWin32FileNewer( FileOrig$, FileNew$ ) THEN
  740.     RemoveFile FileOrig$, cmoForce
  741.     ELSE
  742.         RemoveFile FileNew$, cmoForce       ' get rid of new file
  743.     RenameFilePlease FileOrig$,FileNew$ ' put back old file
  744.     END IF
  745. END SUB
  746.  
  747. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  748. Function UpdateADPCMDrivers() STATIC As Integer
  749. Dim szWMDriver As String
  750. Dim szACMDriver As String
  751. Dim fUpdate As Integer
  752.  
  753.     '   Dont update ADPCM on Win 95. It is already there.
  754.     If OS_Windows95 = 0 then
  755.  
  756.     ' Check WaveMapper driver
  757.     szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  758.     szACMDriver = GetIniKeyString (MakePath(szWinPath, "system.ini"), "MSACM", "Install")
  759.  
  760.     if not(szWMDriver = "msacm.drv") then
  761.     ' Isn't installed so...
  762.  
  763.         ' If NO ADPCM drivers are installed so...
  764.         if (szWMDriver = "") then
  765.             ' Display a dialog saying "there are no ADPCM drivers on your system..."
  766.             fUpdate = 1
  767.         else
  768.             ' There is a different adpcm driver in there so warn about compatibility
  769.         loop1:
  770.             szButton = UIStartDlg(CUIDLL_FILENAME, DLG_URKADPCM, "FInfoDlgProc", DLG_ADPCMHELP, PROC_HELP)
  771.             select case szButton
  772.             case "REACTIVATE"
  773.                 goto loop1
  774.             case "EXIT" , "CANCEL"
  775.                 AskQuit
  776.                 goto loop1
  777.             case "CONTINUE"     ' YES
  778.                 UpdateADPCMDrivers = NAV_FORWARD
  779.                 UIPop 1
  780.                 fUpdate = 1
  781. '            case "CANCEL"       ' NO
  782. '                UIPop 1
  783. '                fUpdate = 0
  784.             case "BACK"
  785.                 UIPop 1
  786.                 UpdateADPCMDrivers = NAV_BACK
  787.                 goto back
  788.             end select
  789.         end if
  790.  
  791.  
  792.         if fUpdate = 1 then
  793.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  794.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  795.             CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  796.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  797.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  798.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  799.  
  800.             szMsacmPriority1 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY1")
  801.             szMsacmPriority2 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY2")
  802.             szMsacmPriority3 = GetIniKeyString(szWinPath + "MSACM.INI","PRIORITY","PRIORITY3")
  803.  
  804.             if mid$( szMsacmPriority1, 1, 1 ) = "0" then
  805.                 szMsacmPriority1 = "1" + mid$( szMsacmPriority1, 2, len(szMsacmPriority1)-1 )
  806.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY1", szMsacmPriority1, cmoOverwrite
  807.             endif
  808.  
  809.             if mid$( szMsacmPriority2, 1, 1 ) = "0" then
  810.                 szMsacmPriority2 = "1" + mid$( szMsacmPriority2, 2, len(szMsacmPriority2)-1 )
  811.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY2", szMsacmPriority2, cmoOverwrite
  812.             endif
  813.  
  814.             if mid$( szMsacmPriority3, 1, 1 ) = "0" then
  815.                 szMsacmPriority3 = "1" + mid$( szMsacmPriority3, 2, len(szMsacmPriority3)-1 )
  816.                 CreateIniKeyValue szWinPath + "msacm.ini", "PRIORITY", "PRIORITY3", szMsacmPriority3, cmoOverwrite
  817.             endif
  818.  
  819.             fSystemUpdated = 1
  820.         else
  821.         noSysSoftware:
  822.             ' No install warning
  823.             szButton = UIStartDlg(CUIDLL_FILENAME, DLG_NOSYSSOFT, "FInfoDlgProc", 0, "")
  824.             select case szButton
  825.             case "REACTIVATE"
  826.                 goto noSysSoftware
  827.             case "EXIT" , "CANCEL"
  828.                 AskQuit
  829.                 goto noSysSoftware
  830.             case "CONTINUE"
  831.                 UIPop 1
  832.             case "BACK"
  833.                 UIPop 1
  834.                 goto loop1
  835.             end select
  836.         end if
  837.  
  838.     end if
  839. back:
  840.     END IF
  841. End Function
  842.  
  843. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  844. Function InstallQTW() STATIC As Integer
  845.  
  846. begin:
  847.     szButton = UIStartDlg( CUIDLL_FILENAME, DLG_INSTALLQTW, "FInfoDlgProc", 0, "" )
  848.     select case szButton
  849.     case "REACTIVATE"
  850.         goto begin
  851.     case "CONTINUE" ' Yes Install QTW
  852.         '
  853.         'Put in the New Dialogue here... (If you do not know what yoy are doing then can you please do as we say!!!)
  854.         dButton = DoMsgBox(STR_QTWMSG1+STR_QTWMSG2+STR_QTWMSG3, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  855.         '
  856.         IF OS_Windows95 = 1 then
  857.             ' Install the 32 bit version on Windows 95
  858. '***************************************************************************************************************************************
  859.             'Enter the code to disable the lip sync thing... 32 bit...
  860.             CreateIniKeyValue szWinPath + "Qtw.ini", "Sound 32", "DisableAutoRateAdjust", "1", cmoOverwrite
  861. '***************************************************************************************************************************************
  862.             Run ( MakePath( szSrcBinPath, "qt32inst.exe" ) )
  863.         Else
  864.             ' Else Install the 16 bit version
  865. '***************************************************************************************************************************************
  866.             'Enter the code to disable the lip sync thing... 16 bit...
  867.             CreateIniKeyValue szWinPath + "Qtw.ini", "Sound", "DisableAutoRateAdjust", "1", cmoOverwrite
  868. '***************************************************************************************************************************************
  869.             Run ( MakePath( szSrcBinPath, "qt16inst.exe" ) )
  870.         END IF
  871.  
  872.         UIPop 1
  873.         InstallQTW = NAV_FORWARD
  874.  
  875.     case "BACK"     ' No Don't Install QTW
  876.         UIPop 1
  877.         InstallQTW = NAV_BACK
  878.     case "EXIT" , "CANCEL"
  879.         AskQuit
  880.         goto begin
  881.     end select
  882.  
  883. End Function
  884.  
  885. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''