home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 2.9 / 1996-10_Disc_2.9.iso / uground / setup.ms_ / setup.ms
Text File  |  1996-05-04  |  18KB  |  577 lines

  1. '**************************************************************************
  2. '*                       PC-Gamer Setup
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST TITLE_NAME$ = "PC Gamer"
  11. CONST TITLE_SETUPDLG$ = "PC Gamer Setup"
  12. CONST GROUP_NAME$ = "PC Gamer CD"
  13. CONST TITLE_ENGINE$ = "PCGAMER.EXE"
  14. CONST MSG_BEGVPROFILE$ = "We need to analyze your video system to ensure maximum performance. "
  15. CONST MSG_BEGVPROFILE1$ = "This procedure may take several minutes. "
  16. CONST MSG_STARTVPROFILE$ = "Select OK to start the analysis."
  17.  
  18.  
  19. ''Dialog ID's
  20. CONST WELCOME       = 100
  21. CONST ASKQUIT       = 200
  22. CONST DESTPATH      = 300
  23. CONST EXITFAILURE   = 400
  24. CONST EXITQUIT      = 600
  25. CONST EXITSUCCESS   = 700
  26. CONST BADPATH       = 6400
  27. CONST RESTART       = 1300
  28. CONST RESTARTII     = 2700
  29. CONST TOOBIG        = 6300
  30.  
  31. ''Bitmap ID
  32. CONST LOGO = 1
  33.  
  34. GLOBAL DESTDRIVE$
  35. GLOBAL DEST$        ''Default destination directory.
  36. GLOBAL OPTCUR$      ''Option selection from option dialog.
  37. GLOBAL CUIDLL$
  38. GLOBAL APPCMD$
  39. 'GLOBAL APPCMD1$
  40. GLOBAL UNIPATH$
  41.  
  42. ''Symbols for communicating with MSCUISTF.DLL dialog procs
  43. GLOBAL SPACEEXTRA$
  44. GLOBAL SPACECOST$
  45. GLOBAL SPACENEEDED$
  46. GLOBAL AMOUNTNEEDED$
  47.  
  48.  
  49. DECLARE SUB DestDriveTooSmall
  50. DECLARE SUB UpdateINI_and_Reg
  51. DECLARE SUB UpdateProgramMngr
  52. DECLARE SUB BuildInstallList
  53. DECLARE SUB NotifyBadPath
  54. DECLARE SUB MaximizeSetupWnd
  55. DECLARE SUB ShowWelcome
  56. DECLARE SUB Ask_Quit
  57. DECLARE SUB GetDestDir
  58. DECLARE SUB Install
  59. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  60. DECLARE FUNCTION CheckDiskSpace () as Integer
  61.  
  62. DECLARE FUNCTION ShowWindow       LIB "User" (hWnd%, iShow%) AS INTEGER
  63. DECLARE FUNCTION SetWindowLong    LIB "User" (hWnd%, offset%, style& ) AS LONG
  64. DECLARE FUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
  65. DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
  66. DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
  67. DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
  68. DECLARE FUNCTION SetFocus LIB "User" (hWnd%) AS INTEGER
  69.  
  70.     ' Constants for Windows API functions
  71. CONST WS_VISIBLE      = &H10000000
  72. CONST WS_BORDER           = &H00800000
  73. CONST WS_CLIPCHILDREN = &H02000000
  74. CONST GWL_STYLE       = -16
  75. CONST SW_SHOWMAXIMIZED= 3       
  76.  
  77. ''System Location variables
  78. GLOBAL WinDir$
  79. GLOBAL WinSysDir$
  80. GLOBAL WinSys32Dir$
  81. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  82. GLOBAL MinorVer%
  83. GLOBAL OnNT$                     
  84.  
  85. GLOBAL TitleINI$
  86. GLOBAL SysINI$
  87. GLOBAL CtlINI$
  88. GLOBAL WinINI$
  89.  
  90. INIT:
  91.     '--------------------------------------------------------
  92.     ' the following line causes the setup background window
  93.     ' to be maximized
  94.     '--------------------------------------------------------
  95.  
  96.      MaximizeSetupWnd
  97.  
  98.     SPACEEXTRA$  = "SpaceExtra"  
  99.     SPACECOST$   = "SpaceCost"
  100.     SPACENEEDED$ = "SpaceNeeded"
  101.     AMOUNTNEEDED$ = "DiskSpaceNeeded"
  102.     CHECKSYSSYM$ = "SysFac"
  103.                  
  104.     FOR i%=1 TO 26 STEP 1
  105.         AddListItem SPACEEXTRA$, "0"
  106.         AddListItem SPACECOST$, "0"
  107.         AddListItem SPACENEEDED$, "0"
  108.     NEXT i%             
  109.  
  110.     
  111.     bInstallDVA% = 0
  112.  
  113.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  114.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  115.  
  116.     SetBitmap CUIDLL$, LOGO
  117.  
  118.  
  119.     WinDir$ = GetWindowsDir()
  120.     WinSysDir$ = GetWindowsSysDir()
  121. '    WinSys32Dir$ = WinDir$ + "system32"
  122. '    WINDRIVE$ = Mid$(WinDir$, 1, 1) 
  123.     
  124.     ' BUGBUG Is this next line correct?  Is that where the _mssetup.exe will
  125.     ' be located?
  126.     SetRestartDir WinDir$
  127.     
  128.     TitleINI$ = WinDir$ + "pcgamer.ini"
  129.     SysINI$ = WinDir$ + "system.ini"
  130.     CtlINI$ = WinDir$ + "control.ini"
  131.     WinINI$ = WinDir$ + "win.ini"
  132.  
  133.  
  134.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  135.     IF szInf$ = "" THEN
  136.     szInf$ = GetSymbolValue("STF_CWDDIR") + "setup.INF"
  137.     END IF
  138.     ReadInfFile szInf$
  139.  
  140.     OPTCUR$ = "1"
  141.     DEST$ = "C:\UGROUND"
  142.     DESTDRIVE$ = "C"
  143.  
  144.     ShowWelcome
  145.  
  146. GETDEST:
  147.     DESTDRIVE$ = DESTDRIVE$ + ":"
  148.     GetDestDir
  149.  
  150.     BuildInstallList
  151.  
  152.     IF CheckDiskSpace() = 0 THEN 
  153.         GOTO GETDEST
  154.     ENDIF
  155.  
  156.     Install
  157.  
  158.  
  159.     '--------------------------------------------------------
  160.     ' Profile display for video components
  161.     '--------------------------------------------------------
  162.          
  163.     j% = DoMsgBox(MSG_BEGVPROFILE$+ MSG_BEGVPROFILE1$ + NL$ + NL$ +MSG_STARTVPROFILE$, TITLE_SETUPDLG$, MB_OK)
  164.     ' profile the display (needed by Video for Windows)
  165.     Run ("profdisp.exe")   
  166.     ' perform the WinG video profiling exercise
  167.     Run ("profwing.exe")      
  168.  
  169.  
  170. '' Restart Windows: if it has to update ACM from DOS, it restarts Windows 
  171. '' automatically else, it gives the user the choice
  172.     RESTRT% = RestartListEmpty ()
  173.     Exe$ = DEST$ + "\_msrstrt.exe"
  174.     Batch$ = DEST$ + "\_mssetup.bat"
  175.     empty$ = ""
  176.  
  177. RESTART:
  178.     IF RESTRT% = 0 THEN
  179.         sz$ = UIStartDlg(cuidll$, RESTART, "FInfo0DlgProc", 0, "")
  180.         IF sz$ = "REACTIVATE" THEN
  181.             GOTO RESTART
  182.         ENDIF
  183.         I% = RestartWindows
  184. ''       I% = ExitExecRestart ()
  185.        
  186.         RemoveFile Exe$, cmoForce
  187.         RemoveFile Batch$, cmoForce
  188.         END
  189.     ELSE
  190.         sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  191.         IF sz$ = "CONTINUE" THEN
  192.             I% = ExitWindowsExec (Exe$, empty$)
  193.             IF I% = 0 THEN
  194.                 GOTO RESTART
  195.             ELSE
  196.                 END
  197.             ENDIF
  198.         ELSEIF sz$ = "EXIT" THEN
  199.             UIPopAll
  200.             END
  201.         ELSEIF sz$ = "REACTIVATE" THEN
  202.             GOTO RESTART
  203.         ELSE
  204.             UIPop 1
  205.             END
  206.         END IF
  207.     END IF
  208.  
  209.  
  210. QUIT:
  211.     ON ERROR GOTO ERRQUIT
  212.  
  213.     IF ERR = 0 THEN
  214.     dlg% = EXITSUCCESS
  215.     ELSEIF ERR = STFQUIT THEN
  216.     dlg% = EXITQUIT
  217.     ELSE
  218.     dlg% = EXITFAILURE
  219.     END IF
  220. QUITL1:
  221.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  222.     IF sz$ = "REACTIVATE" THEN
  223.     GOTO QUITL1
  224.     END IF
  225.     UIPop 1
  226.  
  227.     END
  228.  
  229. ERRQUIT:
  230.     i% = DoMsgBox("Setup sources were corrupted, unable to contine", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  231.     END
  232.  
  233.  
  234.  
  235.  
  236. '*************************************************************************
  237. '** Build the list of files which must be installed and determine how
  238. '**    they must be installed
  239. '*************************************************************************
  240.  
  241. SUB BuildInstallList STATIC
  242.     
  243.     SrcDir$ = GetSymbolValue("STF_SRCDIR") + "uground"
  244.  
  245.     ClearCopyList
  246.     
  247.     AddSectionFilesToCopyList "Uground", SrcDir$, DEST$
  248.     AddSectionFilesToCopyList "Audio", SrcDir$, DEST$ + "\AUDIO"
  249.     AddSectionFilesToCopyList "MediaView", SrcDir$, DEST$ + "\MV"
  250.     AddSectionFilesToCopyList "Sentinal", SrcDir$, DEST$ + "\TEMP"
  251.  
  252.  
  253.         '------------------------------------------------------------
  254.         ' handle DVA.386
  255.         '------------------------------------------------------------
  256.     IF OnWin3x() = 1 THEN
  257.     AddSectionFilesToCopyList "dva", SrcDir$, WinSysDir$
  258.     END IF
  259.  
  260.         '------------------------------------------------------------
  261.         ' handle Video for Windows
  262.         '------------------------------------------------------------
  263.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  264.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  265.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  266.         
  267.     '------------------------------------------------------------
  268.     ' Add WinG files to the list
  269.     '------------------------------------------------------------
  270.     AddSectionFilesToCopyList "WinG", SrcDir$, WinSysDir$
  271.  
  272.         
  273. END SUB
  274.  
  275.  
  276.  
  277. SUB Install STATIC
  278.     Dim hWnd%, hWndOther%
  279.     
  280.     ' get our source dir & create the dest dir (if it doesn't exist)    
  281.     ''not needed SrcDir$ = GetSymbolValue("STF_SRCDIR")
  282.     CreateDir DEST$, cmoNone
  283.     CreateDir DEST$ + "\AUDIO", cmoNone
  284.     CreateDir DEST$ + "\MV", cmoNone
  285.     CreateDir DEST$ + "\TEMP", cmoNone
  286.  
  287.     'DumpCopyList "copylist.log"
  288.     
  289.     ' have the files we need copied to the users disk
  290.     CopyFilesInCopyList
  291.  
  292.     
  293.     ' add our icon to the appropriate program group (creating it if necessary) 
  294.     UpdateProgramMngr
  295.     
  296.     ' update the INI files and the registry with VFW stuff
  297.     UpdateINI_and_Reg
  298.      
  299.     hWnd% = HwndFrame()
  300.     hWndOther% = SetFocus(hWnd%)
  301.  
  302.     ' Assuming DOS is in path, set file attribute to hidden
  303.     CMDLINE$ = "ATTRIB +h " + DEST$ + "\TEMP\_GUARD"
  304.     RUN CMDLINE$
  305.  
  306. END SUB
  307.  
  308.  
  309. '**
  310. '** Purpose:
  311. '**     Appends a file name to the end of a directory path,
  312. '**     inserting a backslash character as needed.
  313. '** Arguments:
  314. '**     szDir$  - full directory path (with optional ending "\")
  315. '**     szFile$ - filename to append to directory
  316. '** Returns:
  317. '**     Resulting fully qualified path name.
  318. '*************************************************************************
  319. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  320.     IF szDir$ = "" THEN
  321.     MakePath = szFile$
  322.     ELSEIF szFile$ = "" THEN
  323.     MakePath = szDir$
  324.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  325.     MakePath = szDir$ + szFile$
  326.     ELSE
  327.     MakePath = szDir$ + "\" + szFile$
  328.     END IF
  329. END FUNCTION
  330.  
  331. '*************************************************************************
  332. '** Subroutine which will maximize the Setup Programs frame window    
  333. '*************************************************************************
  334.     
  335. SUB MaximizeSetupWnd STATIC
  336.      
  337.     Dim hWnd%, PrevVisibility%
  338.     Dim OldStyle&
  339.      
  340.     hWnd% = HwndFrame()
  341.     OldStyle& = SetWindowLong ( hWnd%, GWL_STYLE, WS_VISIBLE+WS_BORDER + WS_CLIPCHILDREN )
  342.     PrevVisibility% = ShowWindow ( hWnd%, SW_SHOWMAXIMIZED )
  343.  
  344. END SUB
  345.  
  346.  
  347. '*************************************************************************
  348. '** Tell the user what they are running & give them a chance to get out
  349. '*************************************************************************
  350. SUB ShowWelcome STATIC
  351.  
  352. WELCOME:
  353.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", 0, "")
  354.     IF sz$ = "CONTINUE" THEN
  355.     UIPop 1
  356.      ELSE
  357.     Ask_Quit
  358.     GOTO WELCOME
  359.     END IF
  360.  
  361. END SUB    
  362.  
  363.  
  364. '*************************************************************************
  365. '** Ask the user to confirm that they want to abort setup    
  366. '*************************************************************************
  367. SUB Ask_Quit STATIC
  368.  
  369. ASKQUIT:
  370.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  371.  
  372.     IF sz$ = "EXIT" THEN
  373.     UIPopAll
  374. ''        ERROR STFQUIT
  375.     END
  376.      ELSEIF sz$ = "REACTIVATE" THEN
  377.     GOTO ASKQUIT
  378.      ELSE
  379.     UIPop 1
  380.     END IF
  381.  
  382. END SUB
  383.  
  384.  
  385. '*************************************************************************
  386. '** subroutine to display message if path specified by use is not usable 
  387. '*************************************************************************
  388. SUB NotifyBadPath STATIC
  389.  
  390. BADPATH:
  391.  
  392.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  393.     IF sz$ = "REACTIVATE" THEN
  394.     GOTO BADPATH
  395.     END IF
  396.     UIPop 1
  397.  
  398. END SUB
  399.  
  400.  
  401. '*************************************************************************
  402. '** Get the destination directory from the user
  403. '*************************************************************************
  404. SUB GetDestDir STATIC
  405.     
  406. GETPATH:
  407.     SetSymbolValue "EditTextIn", DESTDRIVE$
  408.     SetSymbolValue "EditFocus", "END"
  409. GETPATHL1:    
  410.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0, "")
  411.     DESTDRIVE$ = GetSymbolValue("EditTextOut")
  412.  
  413.     DESTDRIVE$ = MID$(DESTDRIVE$, 1, 2)
  414.     IF MID$(DESTDRIVE$, 2, 1) <> ":" THEN
  415.         DESTDRIVE$ = MID$(DESTDRIVE$, 1, 1) + ":"
  416.     ENDIF
  417.  
  418.     IF sz$ = "CONTINUE" THEN
  419.     DEST = DESTDRIVE + "\UGROUND"
  420.     IF IsDirWritable(DEST$) = 0 THEN
  421.         NotifyBadPath
  422.         GOTO GETPATHL1
  423.     END IF
  424.     UIPop 1
  425.     ELSEIF sz$ = "REACTIVATE" THEN
  426.     GOTO GETPATHL1
  427.     ELSEIF sz$ = "BACK" THEN
  428.     UIPop 1
  429.     GOTO GETPATH
  430.     ELSE
  431.     Ask_Quit
  432.     GOTO GETPATH
  433.     END IF
  434. END SUB
  435.  
  436.  
  437. '*************************************************************************
  438. '** subroutine to add our app to Program Manager
  439. '*************************************************************************
  440. SUB UpdateProgramMngr STATIC
  441.  
  442.     ' Create a program manager group with the same name as our title 
  443.     
  444.     CreateProgmanGroup GROUP_NAME$, "", cmoNone
  445.  
  446.     ' Have the new group displayed as a normal window within Program manager 
  447.     
  448.     ShowProgmanGroup  GROUP_NAME$, 1, cmoNone
  449.     
  450.     ' Add our entry to the new groups - entry will have title name
  451.     '   note: if entry of this name is already in group, will replace with 
  452.     '         new one 
  453.     
  454.     ' Include the universe file in command line
  455.     UNIPATH = MakePath(DEST$, "PCGMR01.UNV")
  456.     APPCMD$ =  MakePath(DEST$,TITLE_ENGINE$) + " " + UNIPATH$
  457.     CreateProgmanItem GROUP_NAME$, TITLE_NAME$, APPCMD$, "", cmoOverwrite
  458.  
  459. END SUB 
  460.  
  461.  
  462. '*************************************************************************
  463. '** Subroutine to update the Windows and SYSTEM.INI files and the 
  464. '**      system Registry (with video for windows stuff
  465. '*************************************************************************
  466. SUB UpdateINI_and_Reg STATIC
  467.    
  468.     IF OnWin3x() = 1 THEN
  469.      IF VflatdPresent() = 0 THEN
  470.        CreateSysIniKeyValue SysINI$, "386Enh", "device", "dva.386", cmoOverwrite
  471.        bInstallDVA% = 1
  472.      END IF  
  473.     END IF
  474.     
  475.     'Set the CDDrive entry equal to installation drive
  476.     CD$ = GetSymbolValue("STF_SRCDIR")
  477.     CD$ = MID$(CD$, 1, LEN(CD$) - 1)
  478.  
  479.     ' Create a pcgamer.ini file in the windows directory
  480.     CreateIniKeyValue TitleINI$, "Menu", "Ambience", "1", cmoPrepend
  481.     CreateIniKeyValue TitleINI$, "Menu", "Effects", "1", cmoPrepend
  482.     CreateIniKeyValue TitleINI$, "Files", "CDDrive", CD$, cmoOverwrite
  483.     CreateIniKeyValue TitleINI$, "Files", "CurDir", DEST$, cmoOverwrite
  484.     CreateIniKeyValue TitleINI$, "Files", "UnvFile", UNIPATH$, cmoOverwrite
  485.     CreateIniKeyValue TitleINI$, "Files", "Run", APPCMD$, cmoOverwrite
  486.     CreateIniKeyValue TitleINI$, "General", "Version", "100", cmoOverwrite
  487.     CreateIniKeyValue TitleINI$, "General", "RunBefore", "0", cmoOverwrite
  488.  
  489.  
  490.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  491.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  492.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  493.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  494.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  495.  
  496.     I% = DoesIniKeyExist (SysINI, "Drivers", "VIDC.RT21")
  497.     IF I% = 0  THEN
  498.        CreateIniKeyValue SysINI$, "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  499.     END IF
  500.  
  501.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  502.     CreateIniKeyValue SysINI$, "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  503.     CreateIniKeyValue SysINI$, "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  504.     CreateIniKeyValue SysINI$, "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  505.     CreateIniKeyValue SysINI$, "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  506.  
  507.     CreateIniKeyValue SysINI$, "Drivers", "VIDC.RT21", "indeo.drv", cmoOverwrite
  508.     CreateIniKeyValue WinINI$, "mci extensions", "avi", "AVIVideo", cmoOverwrite
  509.  
  510.     CreateIniKeyValue CtlINI$, "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  511.     CreateIniKeyValue CtlINI$, "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  512.     CreateIniKeyValue CtlINI$, "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  513.  
  514.     'Do not register components not installed with Video for Windows for NT or next version of windows
  515. '       IF ((NOT onNT$ = "TRUE") AND MinorVer% < 50) THEN
  516. '       Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  517. '       Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  518. '       Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  519.     
  520. '           ' Uncomment the next line to have the media player icon added to the Accessories program group 
  521. '           ' CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  522.     
  523. '    END IF
  524.     
  525. END SUB
  526.  
  527.  
  528. '*************************************************************************
  529. '** Check to see that we have enough space for the files on the chosen 
  530. '**    destination drive and on the drive containing the windows 
  531. '**    directories (if the drives are different)
  532. '*************************************************************************
  533.  
  534. FUNCTION CheckDiskSpace () STATIC as Integer
  535.     DIM DriveLtr%
  536.                                       
  537.     CheckDiskSpace = 1                                      
  538.     DestDrive$ = Mid$(DEST$, 1, 1)
  539.     
  540.     SizeReq& = GetCopyListCost ( SPACEEXTRA$, SPACECOST$, SPACENEEDED$)
  541.     
  542.     ' if SizeReq& is not zero, we are short of space somewhere    
  543.     IF SizeReq& <> 0 THEN
  544.  
  545.         DriveLtr% = ASC(UCASE$(DestDrive$))    
  546.         ndrive% = DriveLtr% - ASC("A") + 1
  547.         need$ = GetListItem (SPACENEEDED$, nDrive%)
  548.         IF VAL(need$) > 0 THEN
  549.             need$ = "An additional" + STR$(VAL(need$)/1024)+ "KB are needed on drive " + DestDrive$ + "."
  550.             SetSymbolValue AMOUNTNEEDED$, need$
  551.             DestDriveTooSmall
  552.             CheckDiskSpace = 0
  553.             RemoveSymbol AMOUNTNEEDED$
  554.             EXIT FUNCTION
  555.         END IF
  556.     END IF
  557.  
  558. END FUNCTION
  559.  
  560.  
  561. '*************************************************************************
  562. '** Subroutine to inform the user if they don't have enough space on  
  563. '**      chosen destination drive
  564. '*************************************************************************
  565.        
  566. SUB DestDriveTooSmall STATIC
  567.  
  568. SMALLDEST:
  569.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  570.     IF sz$ = "REACTIVATE" THEN
  571.         GOTO SMALLDEST
  572.     END IF
  573.     UIPop 1
  574.  
  575. END SUB
  576.        
  577.