home *** CD-ROM | disk | FTP | other *** search
/ Enciclopedia de la Ciencia / DKMMSCIE.ISO / dksetup / dkgen.inc < prev    next >
Text File  |  1995-09-19  |  25KB  |  702 lines

  1. '07/07/95 Correct so unregisters use of ctl3d
  2. '01/06/95 No choice about adding icons to progman
  3. '?/05/95  If bundle with sampler need to test for cirrus driver - put into mst file
  4. '12/03/95 Alternative function added, readme icon has shortened name
  5.  
  6. '$INCLUDE 'setupapi.inc'
  7. '$INCLUDE 'msdetect.inc'
  8. '$INCLUDE 'dklang.inc'
  9.  
  10. CONST SOURCE_BINARIES_SUBDIR = "DKCODE"
  11. CONST SOURCE_SETUP_SUBDIR = "DKSETUP"
  12. CONST SETUP_INF_FILENAME = "SETUP.INF"
  13. CONST CUIDLL_FILENAME = "mscuistf.dll"
  14. CONST SETUP_INI_BINARIES_SECTION_NAME = "BIN"
  15. CONST SETUP_INI_WING_BINARIES_NAME = "WinG Runtime"
  16. CONST SETUP_INI_WING32_BINARIES_NAME = "WinG32"
  17. CONST SETUP_INI_ACM_SECTION_NAME = "ACM Drivers"
  18. CONST SETUP_INI_FONTS_SECTION_NAME = "Fonts"
  19.  
  20. CONST PRODUCT_INI_DIR_SECTION_NAME = "Directory"
  21. CONST PRODUCT_INI_DIR_ENTRY_NAME = "Data"
  22.  
  23. CONST MINIMUM_DISK_SPACE = 2048 ' For Minimum install
  24.  
  25. ' Procs
  26. CONST PROC_HELP = "FHelpDlgProc"
  27.  
  28. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (szEXE$, szParams$) AS INTEGER
  29.  
  30. DECLARE FUNCTION Ctl3dRegister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  31. DECLARE FUNCTION Ctl3dUnregister LIB "CTL3D.DLL" (hInst%) AS INTEGER
  32. DECLARE FUNCTION Ctl3dAutoSubClass LIB "CTL3D.DLL" (hInst%) AS INTEGER
  33.  
  34. DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
  35. DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
  36. DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
  37. DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
  38. DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
  39. DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
  40.  
  41. DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER
  42. DECLARE FUNCTION FIs256Colour LIB "mscuistf.dll" AS INTEGER
  43. DECLARE FUNCTION Welcome() AS INTEGER
  44. DECLARE FUNCTION TestSystem() AS INTEGER
  45. DECLARE FUNCTION GetDiskSpaceNeeded(drive%) AS LONG
  46. DECLARE SUB Initialise(prodName$, defInstallPath$, msgCaption$)
  47. DECLARE SUB DeInitialise()
  48. DECLARE SUB AskQuit()
  49. DECLARE SUB BadPath()
  50. DECLARE SUB NetworkDrive()
  51. DECLARE SUB UpdateIndeoAVIDrivers()
  52. DECLARE SUB UpdateWinGDrivers()
  53. DECLARE SUB UpdateADPCMDrivers()
  54. 'DECLARE SUB UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  55. 'DECLARE SUB UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%)
  56. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  57. DECLARE FUNCTION GetRealWindowsSysDir AS STRING
  58. DECLARE SUB UpdateWinG32 (szOrig$)
  59. DECLARE SUB HandleRestart()
  60. DECLARE SUB InitCommonInstall()
  61. DECLARE SUB EndCommonInstall(appReadmeFile$, inRoot%, szEditorExe$)
  62.  
  63. ' Error messages
  64. CONST ERR_OK = 100
  65. CONST ERR_EXITFAIL = 101
  66. CONST ERR_WINVERFAIL = 102
  67. CONST ERR_NODISKSPACE = 103
  68.  
  69. ' Navigation messages
  70. CONST NAV_FORWARD = 0
  71. CONST NAV_BACK = 1
  72.  
  73.  
  74. ' Bitmap ID
  75. CONST LOGO = 1
  76.  
  77. 'QUIT ASKQUIT
  78. 'ABORT EXITFAILURE
  79. 'BADEXIT EXITQUIT
  80. 'SUCCES EXITSUCCESS
  81. 'WELHELP APPHELP
  82. 'DONEVIDEO DONENEWSYSSOFT
  83. 'DONENOVIDEO DONENOSYSSOFT
  84. 'ADDSYSTEMSOFTWARE NEWSYSTEMSOFTWARE
  85. 'WRONGADPCM NEWADPCM
  86. 'NOSYSSOFTWARE WARNNOSYSSOFT
  87.  
  88. ' Dialog ID's
  89. CONST IDD_WELCOME       = 100
  90. CONST IDD_CUSTOMHELP    = 106
  91. CONST IDD_SPEED         = 111
  92. CONST IDD_ASKQUIT       = 200
  93. CONST IDD_DESTPATH      = 300
  94. CONST IDD_EXITFAILURE   = 400
  95. CONST IDD_EXITQUIT      = 600
  96. CONST IDD_EXITSUCCESS   = 700
  97. CONST IDD_APPHELP       = 900
  98. CONST IDD_DONENEWSYSSOFT    = 1100
  99. CONST IDD_DONENOSYSSOFT     = 1800
  100. CONST IDD_NEWSYSTEMSOFTWARE = 2300
  101. CONST IDD_NEWADPCM      = 2600
  102. CONST IDD_WARNNOSYSSOFT = 3100
  103. CONST IDD_MAILMAN       = 1500
  104. CONST IDD_CUSTOM        = 6200
  105. CONST IDD_BADPATH       = 6400
  106. CONST IDD_NEED31        = 6401
  107. CONST IDD_NOMOUSE       = 6402
  108. CONST IDD_BADVGA        = 6403
  109. CONST IDD_NOT256        = 6404
  110. CONST IDD_POORMACHINE   = 6405
  111. CONST IDD_AWFULMACHINE  = 6406
  112. CONST IDD_PATHHELP      = 6407
  113. CONST IDD_WHIZZHELP     = 6408
  114. CONST IDD_URKADPCM      = 6409
  115. CONST IDD_ADPCMHELP     = 6410
  116. CONST IDD_NODISKSPACE   = 6411
  117. CONST IDD_NETWORKDRIVE  = 6412
  118.  
  119.  
  120. GLOBAL szWinPath As String
  121. GLOBAL szWinSysPath As String
  122. GLOBAL szWinDrive As String
  123. GLOBAL szSrcSetupPath As String
  124. GLOBAL szSrcBinPath As String
  125. GLOBAL szDestPath As String
  126. GLOBAL szOldDestPath As String
  127. GLOBAL szPengePath As String
  128. GLOBAL szINFPath As String
  129. GLOBAL szAppINIPath As String
  130. GLOBAL szMsgCaption As String
  131. GLOBAL szButton As String
  132. GLOBAL szMinimalInstall As String
  133. GLOBAL szAddPMItem As String
  134. GLOBAL szExpressCustomChoice As String
  135.  
  136. GLOBAL fPreviousMode As Integer
  137. GLOBAL fWillNotFit As Integer
  138. GLOBAL fSystemUpdated As Integer
  139. GLOBAL hDlg As Integer
  140. GLOBAL dButton As Integer
  141. GLOBAL dWinDrive As Integer
  142. GLOBAL dDestDrive As Integer
  143. GLOBAL dCursor As Integer
  144.  
  145.  
  146.  
  147. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  148. Sub InitCommonInstall() STATIC
  149.     AddToBillboardList CUIDLL_FILENAME, IDD_MAILMAN, "MailmanDlgProc", 2500
  150.     SetCopyGaugePosition -1, 150
  151. End Sub
  152.  
  153.  
  154. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  155. Sub EndCommonInstall(appReadmeFile$, inRoot%, szEditorExe$) STATIC
  156.     if RestartListEmpty = 0 or fSystemUpdated = 1 then
  157.         hDlg = IDD_DONENEWSYSSOFT
  158.     else
  159.         hDlg = IDD_DONENOSYSSOFT
  160.     end if
  161.  
  162. QuitLoop:
  163.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfoDlgProc", 0, "")
  164.     select case szButton
  165.     case "REACTIVATE"
  166.         goto QuitLoop
  167.     case "CONTINUE"     'Read me
  168.         if inRoot% = 1 then
  169.             szReadMe$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appReadmeFile$)
  170.         else
  171.             szReadMe$ = MakePath(szSrcBinPath, appReadmeFile$)
  172.         end if
  173.         run szEditorExe$ + szReadMe$
  174.         goto QuitLoop
  175.     case "BACK"     'Restart Windows
  176.         HandleRestart
  177.     case "EXIT"         'Return to Windows
  178.         if hDlg = IDD_DONENEWSYSSOFT then
  179.             dButton = DoMsgBox( STR_SYSMESSAGE, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  180.         end if
  181.     end select
  182.  
  183.     UIPop 1
  184. End Sub
  185.  
  186.  
  187.  
  188. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  189. Sub Initialise(prodName$, defInstallPath$, msgCaption$) STATIC
  190.     ret% = Ctl3dRegister(HinstFrame())
  191.     ret% = Ctl3dAutoSubClass(HinstFrame())
  192.  
  193.     szMsgCaption$ = msgCaption$
  194.  
  195.     cursor% = ShowWaitCursor()
  196.  
  197.     ClearCopyList
  198.     szWinSysPath = ucase$(GetWindowsSysDir ())
  199.     szWinPath = ucase$(GetWindowsDir ())
  200.     dWinDrive = asc(mid$((szWinPath), 1,1)) - asc("A")+1
  201.     szWinDrive = mid$(szWinPath, 1,1)
  202.  
  203.     szSrcSetupPath = ucase$(GetSymbolValue ("STF_SRCDIR"))
  204.     szSrcBinPath = mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1) + SOURCE_BINARIES_SUBDIR
  205.     szDestPath = szWinDrive + ":" + defInstallPath$
  206.  
  207.     SetTitle szMsgCaption$
  208.     SetBitmap CUIDLL_FILENAME, 1
  209.     SetAbout prodName$, STR_COPYRIGHT
  210.  
  211.     fPreviousMode = SetBeepingMode (1)
  212.     fPreviousMode = SetDecompMode (1)
  213.     fPreviousMode = SetSilentMode (0)
  214.  
  215.     szINFPath = ucase$(GetSymbolValue("STF_SRCINFPATH"))
  216.     if szINFPath = "" then
  217.         szINFPath = ucase$(GetSymbolValue("STF_CWDDIR")) + SETUP_INF_FILENAME
  218.     end if
  219.     ReadInfFile szINFPath
  220.  
  221.     szExpressCustomChoice = "EXPRESS"
  222.     szMinimalInstall = "OFF"
  223. '    szAddPMItem = "ON"
  224.  
  225.     fSystemUpdated = 0
  226.  
  227.     RestoreCursor(cursor%)
  228. End Sub
  229.  
  230.  
  231.  
  232. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  233. Sub DeInitialise() STATIC
  234.     ret% = Ctl3dUnregister(HinstFrame())
  235. End Sub
  236.  
  237.  
  238. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  239. Sub AskQuit() STATIC
  240. begin:
  241.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_ASKQUIT, "FQuitDlgProc", 0, "")
  242.     select case szButton
  243.     case "REACTIVATE"
  244.         goto begin
  245.     case "EXIT"
  246.         error STFQUIT
  247.     case "CONTINUE"
  248.         UIPop 1
  249.     end select
  250. End Sub
  251.  
  252.  
  253. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  254. Sub BadPath() STATIC
  255. begin:
  256.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_BADPATH, "FInfo0DlgProc", 0, "")
  257.     select case szButton
  258.     case "REACTIVATE"
  259.         goto begin
  260.     end select
  261.     UIPop 1
  262. End Sub
  263.  
  264.  
  265.  
  266. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  267. Sub NetworkDrive() STATIC
  268. begin:
  269.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_NETWORKDRIVE, "FInfo0DlgProc", 0, "")
  270.     select case szButton
  271.     case "REACTIVATE"
  272.         goto begin
  273.     end select
  274.     UIPop 1
  275. End Sub
  276.  
  277.  
  278.  
  279. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  280. Function Welcome() STATIC As Integer
  281. begin:
  282.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_WELCOME, "FInfoDlgProc", IDD_APPHELP, PROC_HELP)
  283.     select case szButton
  284.     case "REACTIVATE"
  285.         goto begin
  286.     case "CONTINUE"
  287.         UIPop 1
  288.         Welcome = NAV_FORWARD
  289.     case "EXIT"
  290.         AskQuit
  291.         goto begin
  292.     end select
  293. End Function
  294.  
  295.  
  296.  
  297. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  298. Function TestSystem() STATIC As Integer
  299. TestWinVer:
  300.     if GetWindowsMajorVersion() < 3 or (GetWindowsMajorVersion() = 3 and GetWindowsMinorVersion() < 10) then
  301.         TestWinVerDlgLoop:
  302.             szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NEED31, "FInfoDlgProc", IDD_AWFULMACHINE, PROC_HELP)
  303.             select case szButton
  304.             case "REACTIVATE"
  305.                 goto TestWinVerDlgLoop
  306.             case "BACK"
  307.                 UIPop 1
  308.                 TestSystem = NAV_BACK
  309.                 goto back
  310.             case "CONTINUE"
  311.                 UIPop 1
  312.                 goto TestVGA
  313.             case "EXIT"
  314.                 AskQuit
  315.                 goto TestWinVerDlgLoop
  316.             end select
  317.     end if
  318.  
  319. TestVGA:
  320.     if GetScreenWidth () < 640 or GetScreenHeight () < 480 then
  321.         TestVGADlgLoop:
  322.             szButton = UIStartDlg (CUIDLL_FILENAME, IDD_BADVGA, "FInfoDlgProc", IDD_AWFULMACHINE, PROC_HELP)
  323.             select case szButton
  324.             case "REACTIVATE"
  325.                 goto TestVGADlgLoop
  326.             case "BACK"
  327.                 UIPop 1
  328.                 TestSystem = NAV_BACK
  329.                 goto back
  330.             case "CONTINUE"
  331.                 UIPop 1
  332.                 goto TestMouse
  333.             case "EXIT"
  334.                 AskQuit
  335.                 goto TestVGADlgLoop
  336.             end select
  337.         end if
  338.  
  339. TestMouse:
  340.     if HasMouseInstalled() = false then
  341.     TestMouseDlgLoop:
  342.         szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NOMOUSE, "FInfoDlgProc", IDD_AWFULMACHINE, PROC_HELP)
  343.         select case szButton
  344.         case "REACTIVATE"
  345.             goto TestMouseDlgLoop
  346.         case "BACK"
  347.             UIPop 1
  348.             TestSystem = NAV_BACK
  349.         case "CONTINUE"
  350.             UIPop 1
  351.             goto TestColour
  352.         case "EXIT"
  353.             AskQuit
  354.             goto TestMouseDlgLoop
  355.         end select
  356.     end if
  357.  
  358. TestColour:
  359.     if FIs256Colour() = false then
  360.     TestColourDlgLoop:
  361.         szButton = UIStartDlg (CUIDLL_FILENAME, IDD_NOT256, "FInfoDlgProc", IDD_POORMACHINE, PROC_HELP)
  362.         select case szButton
  363.         case "REACTIVATE"
  364.             goto TestColourDlgLoop
  365.         case "BACK"
  366.             UIPop 1
  367.             TestSystem = NAV_BACK
  368.             goto back
  369.         case "CONTINUE"
  370.             UIPop 1
  371.             TestSystem = NAV_FORWARD
  372.         case "EXIT"
  373.             AskQuit
  374.             goto TestColourDlgLoop
  375.         end select
  376.     end if
  377.  
  378. back:
  379. End Function
  380.  
  381.  
  382. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  383. '**
  384. '** Purpose:
  385. '**     Appends a file name to the end of a directory path,
  386. '**     inserting a backslash character as needed.
  387. '** Arguments:
  388. '**     szDir$  - full directory path (with optional ending "\")
  389. '**     szFile$ - filename to append to directory
  390. '** Returns:
  391. '**     Resulting fully qualified path name.
  392. '*************************************************************************
  393. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  394.     IF szDir$ = "" THEN
  395.         MakePath = szFile$
  396.     ELSEIF szFile$ = "" THEN
  397.         MakePath = szDir$
  398.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  399.         MakePath = szDir$ + szFile$
  400.     ELSE
  401.         MakePath = szDir$ + "\" + szFile$
  402.     END IF
  403. END FUNCTION
  404.  
  405.  
  406.  
  407. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  408. Sub HandleRestart() STATIC
  409.     ' Check there are system files to install AND check if Windows v3.1 or greater
  410.     if RestartListEmpty = 0 and GetWindowsMajorVersion >= 3 and GetWindowsMajorVersion >= 1 then
  411.         dButton = DoMsgBox(STR_EXIT, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  412.         tryagain:
  413.         if ExitExecRestart = 1 then
  414.             ' Exit failed
  415.             dButton = DoMsgBox(STR_EXITFAIL, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONSTOP)
  416.             goto tryagain
  417.         end if
  418.     end if
  419.  
  420.     if RestartListEmpty = 1 then ' Empty, but we have to reboot
  421.         dummy% = ExitWindowsExec(MakePath(szDestPath, "_msrstrt.exe"), "")
  422.     end if
  423. End Sub
  424.  
  425.  
  426.  
  427. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  428. 'Sub UpdateProgramManager(prodName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  429. 'Dim szReadmeTitle As String
  430. 'Dim szInf As String
  431. '
  432. '    if onCDROM% = 1 then    'sampler
  433. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  434. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  435. '        szReadmeTitle = prodName$ + " " + readmeStr$
  436. '
  437. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  438. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  439. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  440. '    else
  441. '        if szAddPMItem = "ON" then
  442. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  443. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  444. '            szReadmeTitle = prodName$ + " " + readmeStr$
  445. '            if szMinimalInstall = "ON" then
  446. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  447. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  448. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  449. '            else
  450. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  451. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  452. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  453. '            end if
  454. '        end if
  455. '    end if
  456. '
  457. 'End Sub
  458.  
  459.  
  460. ''''''''''''''''''''''''''''''''''''''''''''
  461.  
  462. '' Alternative function for french stowaway
  463. '' Readme icon has shortened name
  464. 'Sub UpdateProgramManagerAlt(prodName$, readmeName$, appExeFile$, appPengeFile$, readmeFile$, readmeStr$, onCDROM%) STATIC
  465. 'Dim szReadmeTitle As String
  466. 'Dim szInf As String
  467. '
  468. '    if onCDROM% = 1 then    'sampler
  469. '        CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  470. '        ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  471. '        szReadmeTitle = readmeName$ + " " + readmeStr$
  472. '
  473. '        szInf = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), appExeFile$)
  474. '        CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, MakePath(szDestPath, "sampler.ico"), cmoOverwrite
  475. ''        CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), readmeFile$), "", cmoOverwrite
  476. '   else
  477. '        if szAddPMItem = "ON" then
  478. '            CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  479. '            ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  480. '            szReadmeTitle = readmeName$ + " " + readmeStr$
  481. '            if szMinimalInstall = "ON" then
  482. '                szInf = MakePath(szSrcBinPath, appExeFile$) + " " + MakePath(szSrcBinPath, appPengeFile$)
  483. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  484. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szSrcBinPath, readmeFile$), "", cmoOverwrite
  485. '            else
  486. '                szInf = MakePath(szDestPath, appExeFile$) + " " + MakePath(szDestPath, appPengeFile$)
  487. '                CreateProgmanItem STR_COMPANYNAME, prodName$, szInf, szInf, cmoOverwrite
  488. '                CreateProgmanItem STR_COMPANYNAME, szReadmeTitle, "notepad.exe " + MakePath(szDestPath, readmeFile$), "", cmoOverwrite
  489. '            end if
  490. '        end if
  491. '    end if
  492. '
  493. 'End Sub
  494.  
  495.  
  496.  
  497. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  498. Function GetDiskSpaceNeeded( drive% ) STATIC As Long
  499. Dim dDummy As Long
  500.  
  501.     cursor% = ShowWaitCursor()
  502.  
  503.     SetSymbolValue "ExtraSpace", ""
  504.     SetSymbolValue "Needed", ""
  505.     SetSymbolValue "Cost", ""
  506.  
  507.     'Drives A - Z
  508.     for i% = 1 to 26
  509.         AddListItem "ExtraSpace", ""
  510.     next i%
  511.  
  512.     ReplaceListItem "ExtraSpace", dWinDrive, str$(MINIMUM_DISK_SPACE)    '2K for the INI file
  513.  
  514.     dDummy = GetCopyListCost("ExtraSpace","Needed","Cost")
  515.  
  516.     GetDiskSpaceNeeded = val(GetListItem ("Needed", drive))
  517.  
  518.     RemoveSymbol "Needed"
  519.     RemoveSymbol "Cost"
  520.     RemoveSymbol "ExtraSpace"
  521.  
  522.     RestoreCursor(cursor%)
  523. End Function
  524.  
  525.  
  526.  
  527. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  528. Sub UpdateIndeoAVIDrivers() STATIC
  529. Dim szWMDriver As String
  530. Dim szACMDriver As String
  531.  
  532.     szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  533.  
  534.     if not(szWMDriver = "msacm.drv") then
  535.         fSystemUpdated = 1
  536.     end if
  537.  
  538.  
  539.     if VflatdPresent() = 0 then
  540.         CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  541.         fSystemUpdated = 1
  542.     end if
  543.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  544.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  545.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  546.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  547.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  548.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  549.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  550.     CreateIniKeyValue szWinPath + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  551.     CreateIniKeyValue szWinPath + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  552.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  553.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  554.     CreateIniKeyValue szWinPath + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  555.     CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  556.     CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  557.     CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  558.     CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  559. End Sub
  560.  
  561.  
  562.  
  563. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  564. Sub UpdateWinGDrivers() STATIC
  565. Dim szDest As String
  566. Dim szDest1 As String
  567. Dim szDest2 As String
  568.  
  569.     ' only use DVA on Windows 3.x
  570.     if OnWin3x() = 1 then
  571.         AddSectionFilesToCopyList "dva", szSrcBinPath, szWinSysPath
  572.         if VflatdPresent() = 0 then
  573.             CreateSysIniKeyValue szWinPath + "system.ini", "386Enh", "device", szWinSysPath+"dva.386", cmoOverwrite
  574.             fSystemUpdated = 1
  575.         end if
  576.     end if
  577.  
  578.     szDest = GetRealWindowsSysDir
  579.     szDest1 = MakePath(szDest,"wing32.dll")
  580.     szDest2 = MakePath(szDest,"wing32.xxx")
  581.     RenameFilePlease szDest1, szDest2
  582.  
  583.     UpdateWinG32 GetRealWindowsSysDir()
  584. End Sub
  585.  
  586. '''''''''''''''''''''''''''''''''''''''''''''''''
  587.  
  588. FUNCTION GetRealWindowsSysDir STATIC AS STRING
  589.     szBuf$ = string$(260, 32)
  590.     cbBuf% = GetRealSystemDir(szBuf$, 260)
  591.     IF cbBuf% = 0 THEN
  592.         ERROR STFERR
  593.     ELSE
  594.         IF cbBuf% > 259 THEN
  595.             res% = DoMsgBox("Buffer Overflow", "MS-Setup Error", MB_ICONHAND+MB_OK)
  596.             ERROR STFERR
  597.         END IF
  598.         szBuf$ = RTRIM$(szBuf$)
  599.         IF MID$(szBuf$, 1, 1) = "\" THEN
  600.             szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  601.         ELSEIF MID$(szBuf$, 2, 1) <> ":" THEN
  602.             szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  603.         END IF
  604.         IF MID$(szBuf$, LEN(szBuf$), 1) <> "\" THEN
  605.             szBuf$ = szBuf$ + "\"
  606.         END IF
  607.         GetRealWindowsSysDir = szBuf$
  608.     END IF
  609.  
  610.     szBuf$ = ""
  611. END FUNCTION
  612.  
  613. '''''''''''''''''''''''''''''''''''''''''''''''''
  614.  
  615. SUB UpdateWinG32 (szOrig$) STATIC
  616.     '
  617.     ' Here we check the version ourselves of wing32.dll, since
  618.     ' we can't get version checking for Win32 apps from Win16
  619.     '
  620.     FileNew$ = MakePath(szOrig$, "wing32.dll")
  621.     FileOrig$ = MakePath(szOrig$, "wing32.xxx")
  622.     IF IsWin32FileNewer( FileOrig$, FileNew$ ) THEN
  623.     RemoveFile FileOrig$, cmoForce
  624.     ELSE
  625.         RemoveFile FileNew$, cmoForce       ' get rid of new file
  626.     RenameFilePlease FileOrig$,FileNew$ ' put back old file
  627.     END IF
  628. END SUB
  629.  
  630.  
  631.  
  632. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  633. Sub UpdateADPCMDrivers() STATIC
  634. Dim szWMDriver As String
  635. Dim szACMDriver As String
  636. Dim fUpdate As Integer
  637.  
  638.     ' Check WaveMapper driver
  639.     szWMDriver = GetIniKeyString(MakePath(szWinPath,"system.ini"), "drivers", "WaveMapper")
  640.     szACMDriver = GetIniKeyString (MakePath(szWinPath, "system.ini"), "MSACM", "Install")
  641.  
  642.     if not(szWMDriver = "msacm.drv") then
  643.     ' Isn't installed so...
  644.  
  645.         ' If NO ADPCM drivers are installed so...
  646.         if (szWMDriver = "") then
  647.             ' Display a dialog saying "there are no ADPCM drivers on your system..."
  648.             fUpdate = 1
  649.         else
  650.             ' There is a different adpcm driver in there so warn about compatibility
  651.         loop1:
  652.             szButton = UIStartDlg(CUIDLL_FILENAME, IDD_URKADPCM, "FInfoDlgProc", IDD_ADPCMHELP, PROC_HELP)
  653.             select case szButton
  654.             case "REACTIVATE"
  655.                 goto loop1
  656.             case "EXIT"
  657.                 AskQuit
  658.                 goto loop1
  659.             case "CONTINUE"     ' YES
  660.                 UIPop 1
  661.                 fUpdate = 1
  662.             case "CANCEL"       ' NO
  663.                 UIPop 1
  664.                 fUpdate = 0
  665.             case "BACK"
  666.                 UIPop 1
  667.                 ' return back flag
  668.             end select
  669.         end if
  670.  
  671.  
  672.         if fUpdate = 1 then
  673.             CreateIniKeyValue szWinPath + "system.ini", "drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  674.             CreateIniKeyValue szWinPath + "system.ini", "MSACM", "Install", "msadpcm.acm", cmoOverwrite
  675.             CreateIniKeyValue szWinPath + "control.ini", "drivers.desc", "msacm.drv","MS Audio Compression Manager", cmoOverwrite
  676.             CreateIniKeyValue szWinPath + "control.ini", "Userinstallable.drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  677.             CreateIniKeyValue szWinPath + "control.ini", "related.desc", "WaveMapper", "", cmoOverwrite
  678.             fSystemUpdated = 1
  679.         else
  680.         noSysSoftware:
  681.             ' No install warning
  682.             szButton = UIStartDlg(CUIDLL_FILENAME, IDD_WARNNOSYSSOFT, "FInfoDlgProc", 0, "")
  683.             select case szButton
  684.             case "REACTIVATE"
  685.                 goto noSysSoftware
  686.             case "EXIT"
  687.                 AskQuit
  688.                 goto noSysSoftware
  689.             case "CONTINUE"
  690.                 UIPop 1
  691.             case "BACK"
  692.                 UIPop 1
  693.                 goto loop1
  694.             end select
  695.         end if
  696.  
  697.     end if
  698.  
  699. End Sub
  700.  
  701.  
  702. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''