home *** CD-ROM | disk | FTP | other *** search
/ Fun in Spring 4 / gold.iso / SPACIE / SPACIE.MST < prev   
Encoding:
Text File  |  1994-01-01  |  15.5 KB  |  580 lines

  1. '**************************************************************************
  2. '*                       Spacie Setup Scriptfile "spacie.mst"
  3. '**************************************************************************
  4.  
  5. CONST SW_SHOWMAXIMIZED=3
  6. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  7.  
  8.  
  9. '$DEFINE DEBUG  ''Define for script development/debugging
  10.  
  11. '$INCLUDE 'setupapi.inc'
  12. '$INCLUDE 'msdetect.inc'
  13.  
  14. ''Dialog ID's
  15. CONST ASKQUIT      = 200
  16. CONST DESTPATH     = 300
  17. CONST EXITFAILURE  = 400
  18. CONST EXITQUIT     = 600
  19. CONST EXITSUCCESS  = 700
  20. CONST OPTIONS      = 800
  21. CONST APPHELP      = 900
  22. CONST CUSTINST     = 6200
  23. CONST TOOBIG       = 6300
  24. CONST BADPATH      = 6400
  25. CONST MODELESS       = 5000    
  26.  
  27. ''Bitmap ID
  28. CONST LOGO         = 1
  29.  
  30. ''File Types
  31. CONST APPFILES     = 1
  32. ''CONST OPTFILES1    = 2
  33. ''CONST OPTFILES2    = 3
  34.  
  35. ''Dest.-verzeichnisse
  36. GLOBAL WINDRIVE$   ''Windows drive letter.
  37. GLOBAL DEST$       ''Default destination directory.
  38. GLOBAL DESTMAP$    ''SubDir
  39. GLOBAL DESTOBJ$    ''SubDir
  40. GLOBAL DESTCHAR$   ''SubDir
  41. GLOBAL DESTSMP$    ''SubDir
  42. GLOBAL DESTSHP$    ''SubDir
  43. GLOBAL DESTWING$   ''SubDir
  44.  
  45. ''Source-Verzeichnisse
  46. GLOBAL SRCEXE$      ''Sourcepfad fⁿr Spiel
  47. GLOBAL SRCMAP$      ''Quelleverzeichnis fⁿr Maps
  48. GLOBAL SRCOBJ$        ''Quellverzeichnis fⁿr Objs
  49. GLOBAL SRCCHAR$        ''Quellverzeichnis fⁿr Chars
  50. GLOBAL SRCSMP$      ''Quellverzeichnis fⁿr Samples
  51. GLOBAL SRCSHP$        ''Quellverzeichnis fⁿr Shapes
  52. GLOBAL SRCWING$        ''Quellverzeichnis fⁿr Wing
  53.  
  54. GLOBAL bInstallDVA%
  55.  
  56. ''GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  57. ''GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  58.  
  59. ''CustInst list symbol names
  60. GLOBAL APPNEEDS$    ''Option list costs per drive
  61. GLOBAL OPT1NEEDS$
  62. GLOBAL OPT2NEEDS$
  63. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  64. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  65.  
  66. ''Dialog list symbol names
  67. GLOBAL CHECKSTATES$
  68. GLOBAL STATUSTEXT$
  69. GLOBAL DRIVETEXT$
  70.  
  71.  
  72. DECLARE SUB AddOptFilesToCopyList (ftype%)
  73. DECLARE SUB RecalcOptFiles (ftype%)
  74. DECLARE SUB RecalcPath
  75. DECLARE SUB SetDriveStatus
  76. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  77. ''DECLARE FUNCTION LoadLibrary LIB "KRNL386.EXE" (arg1$) AS INTEGER
  78. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  79.  
  80.  
  81.  
  82.  
  83. INIT:
  84.     hWnd%=HwndFrame()
  85.     junk%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)        
  86.     bInstallDVA% = 0
  87.  
  88.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  89.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  90.  
  91.     SetBitmap CUIDLL$, LOGO
  92.     SetTitle "SPACIE Setup"
  93.  
  94.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  95.     IF szInf$ = "" THEN
  96.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SPACIE.INF"
  97.     END IF
  98.     ReadInfFile szInf$
  99.  
  100.     '' Verzeichnisse    
  101.     WINDRIVE$     = MID$(GetWindowsDir, 1, 1)
  102.     DEST$     = WINDRIVE$ + ":\SPACIE"
  103.     DESTMAP$     = DEST$ + "\MAP"
  104.     DESTOBJ$     = DEST$ + "\OBJ"
  105.     DESTCHAR$     = DEST$ + "\CHAR"
  106.         DESTSMP$        = DEST$ + "\SMP"
  107.     DESTSHP$     = DEST$ + "\SHP"
  108.     DESTWING$     = GetWindowsSysDir
  109.     
  110.  
  111.     '' Borland DLL laden
  112. ''    DllDir$  = GetSymbolValue("STF_SRCDIR")    
  113. ''    i%=LoadLibrary(DllDir$ + "bwcc.dll")     
  114.  
  115.     ''CustInst list symbols
  116.     CHECKSTATES$ = "CheckItemsState"
  117.     STATUSTEXT$  = "StatusItemsText"
  118.     DRIVETEXT$   = "DriveStatusText"
  119.     FOR i% = 1 TO 3 STEP 1
  120.         AddListItem CHECKSTATES$, "ON"
  121.     NEXT i%
  122.     FOR i% = 1 TO 3 STEP 1
  123.         AddListItem STATUSTEXT$, "1"
  124.     NEXT i%
  125.     FOR i% = 1 TO 7 STEP 1
  126.         AddListItem DRIVETEXT$, "1"
  127.     NEXT i%
  128.     ReplaceListItem DRIVETEXT$, 7, DEST$
  129.  
  130.     ''Disk cost list symbols
  131.     APPNEEDS$   = "AppNeeds"
  132.     OPT1NEEDS$  = "Opt1Needs"
  133.     OPT2NEEDS$  = "Opt2Needs"
  134.     EXTRACOSTS$ = "ExtraCosts"
  135.     BIGLIST$    = "BigList"
  136.     FOR i% = 1 TO 3 STEP 1
  137.         AddListItem BIGLIST$, ""
  138.     NEXT i%
  139.     FOR i% = 1 TO 26 STEP 1
  140.         AddListItem EXTRACOSTS$, "0"
  141.     NEXT i%
  142.  
  143.     ''File Option Variables
  144.     OPT1OPT$ = "1"
  145.     OPT2OPT$ = "1"
  146.  
  147.     RecalcPath
  148.     SetDriveStatus
  149.  
  150. '$IFDEF DEBUG
  151.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  152. '$ENDIF ''DEBUG
  153.  
  154.  
  155.  
  156. CUSTINST:
  157.        
  158.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  159.  
  160.     IF sz$ = "CONTINUE" THEN
  161.         ''Install only if it will fit.
  162.         FOR i% = 1 TO 3 STEP 1
  163.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  164.                 GOSUB TOOBIG
  165.                 GOTO CUSTINST
  166.             END IF
  167.         NEXT i%
  168.         UIPop 1
  169.         GOTO INSTALL
  170.     ELSEIF sz$ = "PATH" THEN
  171.         GOTO GETPATH
  172.     ELSEIF sz$ = "CHK1" THEN
  173.         RecalcOptFiles APPFILES
  174.         SetDriveStatus
  175.         GOTO CUSTINST
  176.     ELSEIF sz$ = "CHK2" THEN
  177. ''        RecalcOptFiles OPTFILES1
  178. ''        SetDriveStatus
  179.         GOTO CUSTINST
  180.     ELSEIF sz$ = "CHK3" THEN
  181. ''        RecalcOptFiles OPTFILES2
  182.         SetDriveStatus
  183.         GOTO CUSTINST
  184.     ELSEIF sz$ = "BTN2" THEN
  185. ''        GOTO OPTFILES1
  186.     ELSEIF sz$ = "BTN3" THEN
  187. ''        GOTO OPTFILES2
  188.     ELSEIF sz$ = "REACTIVATE" THEN
  189.         RecalcPath
  190.         SetDriveStatus
  191.         GOTO CUSTINST
  192.     ELSE
  193.         GOSUB ASKQUIT
  194.         GOTO CUSTINST
  195.     END IF
  196.  
  197.  
  198.  
  199. INSTALL:
  200.     ''AddToBillboardList CUIDLL$, MODELESS, "FModelessDlgProc", 1Ticks
  201.     ''sz$ = UIStartDlg(CUIDLL$, MODELESS, "FModelessDlgProc", 0, "")
  202.     
  203.     ClearCopyList   
  204.     AddOptFilesToCopyList APPFILES
  205. ''    AddOptFilesToCopyList OPTFILES1
  206. ''    AddOptFilesToCopyList OPTFILES2
  207.     CreateDir DEST$, cmoNone
  208.     CreateDir DESTMAP$, cmoNone
  209.     CreateDir DESTOBJ$, cmoNone
  210.     CreateDir DESTCHAR$, cmoNone
  211.     CreateDir DESTSMP$, cmoNone
  212.     CreateDir DESTSHP$, cmoNone
  213.  
  214.     CopyFilesInCopyList
  215.  
  216.     IF VflatdPresent() = 0 THEN
  217.         CreateSysIniKeyValue GetWindowsDir + "system.ini", "386Enh", "device", GetWindowsSysDir+"dva.386", cmoOverwrite
  218.     bInstallDVA% = 1
  219.     END IF
  220.     
  221.     ''IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  222.         ''ini$ = MakePath(DEST$, "_SPA.INI")
  223.         ''CreateIniKeyValue "WIN.INI", "Cardy Setup", "Option1", OPT1OPT$, cmoNone
  224.         ''CreateIniKeyValue ini$, "Section 1", "Key 1", "Value 1" , cmoNone
  225.         ''CreateIniKeyValue ini$, "Section 2", "Key 2", "Value 2" , cmoNone
  226.         ''CreateIniKeyValue ini$, "Section 3", "Key 3", "Value 3" , cmoNone
  227.         ''ini$ = ""
  228.     ''END IF
  229.  
  230.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  231.         CreateProgmanGroup "Spacie", "", cmoNone
  232.         ShowProgmanGroup  "Spacie", 1, cmoNone
  233.         CreateProgmanItem "Spacie", "Spacie", ""+MakePath(DEST$,"Spacie.exe"), "", cmoOverwrite
  234.     END IF
  235.  
  236.  
  237. QUIT:
  238.     ON ERROR GOTO ERRQUIT
  239.  
  240.     IF ERR = 0 THEN
  241.         dlg% = EXITSUCCESS
  242.     ELSEIF ERR = STFQUIT THEN
  243.         dlg% = EXITQUIT
  244.     ELSE
  245.         dlg% = EXITFAILURE
  246.     END IF
  247. QUITL1:
  248.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  249.     IF sz$ = "REACTIVATE" THEN
  250.         GOTO QUITL1
  251.     END IF
  252.     UIPop 1
  253.  
  254.     END
  255.  
  256. ERRQUIT:
  257.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  258.     END
  259.  
  260.  
  261. GETPATH:
  262.     SetSymbolValue "EditTextIn", DEST$
  263.     SetSymbolValue "EditFocus", "END"
  264. GETPATHL1:
  265.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  266.  
  267.     IF sz$ = "CONTINUE" THEN
  268.         olddest$ = DEST$
  269.         DEST$ = GetSymbolValue("EditTextOut")
  270.  
  271.         ''Validate new path.
  272.         IF IsDirWritable(DEST$) = 0 THEN
  273.             GOSUB BADPATH
  274.             GOTO GETPATHL1
  275.         END IF
  276.         UIPop 1
  277.  
  278.         ''Truncate display if too long.
  279.         IF LEN(DEST$) > 23 THEN
  280.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  281.         ELSE
  282.             ReplaceListItem DRIVETEXT$, 7, DEST$
  283.         END IF
  284.  
  285.         ''Recalc if path changed.
  286.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  287.             RecalcPath
  288.             SetDriveStatus
  289.         END IF
  290.  
  291.     ''Den DirPfad UpDaten wenn von Benutzer verΣndert
  292.     DESTMAP$  = DEST$ + "\MAP"
  293.     DESTOBJ$  = DEST$ + "\OBJ"
  294.     DESTCHAR$ = DEST$ + "\CHAR"
  295.     DESTSMP$  = DEST$ + "\SMP"
  296.     DESTSHP$ = DEST$ + "\SHP"
  297.     DESTWING$ = GetWindowsSysDir
  298.  
  299.         olddest$ = ""
  300.         GOTO CUSTINST
  301.     ELSEIF sz$ = "REACTIVATE" THEN
  302.         RecalcPath
  303.         SetDriveStatus
  304.         GOTO GETPATHL1
  305.     ELSEIF sz$ = "EXIT" THEN
  306.         GOSUB ASKQUIT
  307.         GOTO GETPATHL1
  308.     ELSE
  309.         UIPop 1
  310.         GOTO CUSTINST
  311.     END IF
  312.  
  313.  
  314.  
  315. ''OPTFILES1:
  316. ''    SetSymbolValue "RadioDefault", OPT1OPT$
  317. ''OPT1L1:
  318. ''    sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  319. ''    newopt$ = GetSymbolValue("ButtonChecked")
  320. ''
  321. ''    IF sz$ = "CONTINUE" THEN
  322. ''        UIPop 1
  323. ''        IF newopt$ <> OPT1OPT$ THEN
  324. ''            OPT1OPT$ = newopt$
  325. ''            RecalcOptFiles OPTFILES1
  326. ''            SetDriveStatus
  327. ''        END IF
  328. ''        newopt$ = ""
  329. ''        GOTO CUSTINST
  330. ''    ELSEIF sz$ = "REACTIVATE" THEN
  331. ''        RecalcPath
  332. ''        SetDriveStatus
  333. ''        GOTO OPT1L1
  334. ''    ELSEIF sz$ = "EXIT" THEN
  335. ''        GOSUB ASKQUIT
  336. ''        GOTO OPT1L1
  337. ''    ELSE
  338. ''        UIPop 1
  339. ''        newopt$ = ""
  340. ''        GOTO CUSTINST
  341. ''    END IF
  342.  
  343.  
  344.  
  345. ''OPTFILES2:
  346. ''    SetSymbolValue "RadioDefault", OPT2OPT$
  347. ''OPT2L1:
  348. ''    sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  349. ''    newopt$ = GetSymbolValue("ButtonChecked")
  350. ''
  351. ''    IF sz$ = "CONTINUE" THEN
  352. ''        UIPop 1
  353. ''        IF newopt$ <> OPT2OPT$ THEN
  354. ''            OPT2OPT$ = newopt$
  355. ''            RecalcOptFiles OPTFILES2
  356. ''            SetDriveStatus
  357. ''        END IF
  358. ''        newopt$ = ""
  359. ''        GOTO CUSTINST
  360. ''    ELSEIF sz$ = "REACTIVATE" THEN
  361. ''      RecalcPath
  362. ''        SetDriveStatus
  363. ''        GOTO OPT2L1
  364. ''    ELSEIF sz$ = "EXIT" THEN
  365. ''        GOSUB ASKQUIT
  366. ''        GOTO OPT2L1
  367. ''    ELSE
  368. ''        UIPop 1
  369. ''        newopt$ = ""
  370. ''        GOTO CUSTINST
  371. ''    END IF
  372.  
  373.  
  374.  
  375. TOOBIG:
  376.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  377.     IF sz$ = "REACTIVATE" THEN
  378.         RecalcPath
  379.         SetDriveStatus
  380.         GOTO TOOBIG
  381.     END IF
  382.     UIPop 1
  383.     RETURN
  384.  
  385.  
  386.  
  387. BADPATH:
  388.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  389.     IF sz$ = "REACTIVATE" THEN
  390.         RecalcPath
  391.         SetDriveStatus
  392.         GOTO BADPATH
  393.     END IF
  394.     UIPop 1
  395.     RETURN
  396.  
  397.  
  398.  
  399. ASKQUIT:
  400.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  401.     IF sz$ = "EXIT" THEN
  402.         UIPopAll
  403.         ERROR STFQUIT
  404.     ELSEIF sz$ = "REACTIVATE" THEN
  405.         GOTO ASKQUIT
  406.     ELSE
  407.         UIPop 1
  408.     END IF
  409.     RETURN
  410.  
  411.  
  412.  
  413. '**
  414. '** Purpose:
  415. '**     Adds the specified option files to the copy list.
  416. '** Arguments:
  417. '**     ftype%  - type of files to add, one of the following:
  418. '**             APPFILES, OPTFILES1, OPTFILES2
  419. '** Returns:
  420. '**     none.
  421. '*************************************************************************
  422. SUB AddOptFilesToCopyList (ftype%) STATIC
  423.  
  424.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  425.         SrcDir$   = GetSymbolValue("STF_SRCDIR")
  426.     SRCEXE$   = SrcDir$
  427.     SRCMAP$  = SRCEXE$ + "map"
  428.     SRCOBJ$  = SRCEXE$ + "obj"
  429.     SRCCHAR$ = SRCEXE$ + "char"
  430.     SRCSMP$  = SRCEXE$ + "smp"
  431.     SRCSHP$  = SRCEXE$ + "shp"
  432.     SRCWING$ = SRCEXE$ + "wing"
  433.  
  434.         IF ftype% = APPFILES THEN
  435.             AddToBillboardList "mscuistf.dll", MODELESS, "FModelessDlgProc", 1
  436.  
  437.             AddSectionFilesToCopyList "Files", SRCEXE$, DEST$
  438.             AddSectionFilesToCopyList "map_dir", SRCMAP$, DESTMAP$
  439.             AddSectionFilesToCopyList "obj_dir", SRCOBJ$, DESTOBJ$
  440.             AddSectionFilesToCopyList "char_dir", SRCCHAR$, DESTCHAR$
  441.             AddSectionFilesToCopyList "smp_dir", SRCSMP$, DESTSMP$
  442.             AddSectionFilesToCopyList "shp_dir", SRCSHP$, DESTSHP$
  443.             AddSectionFilesToCopyList "wing_dir", SRCWING$, DESTWING$
  444.         END IF
  445.         SrcDir$ = ""
  446.     END IF
  447. END SUB
  448.  
  449.  
  450. '**
  451. '** Purpose:
  452. '**     Recalculates disk space for the given option files and sets
  453. '**     the status info symbol "StatusItemsText".
  454. '** Arguments:
  455. '**     ftype% - type of files to add, one of the following:
  456. '**             APPFILES, OPTFILES1, OPTFILES2
  457. '** Returns:
  458. '**     none.
  459. '*************************************************************************
  460. SUB RecalcOptFiles (ftype%) STATIC
  461.     CursorSave% = ShowWaitCursor()
  462.     ClearCopyList
  463.     AddOptFilesToCopyList ftype%
  464.  
  465.     fExtra% = 0
  466.     IF ftype% = APPFILES THEN
  467.         ListSym$ = APPNEEDS$
  468.         IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  469.             ''Add extra cost to Windows drive for ini/progman, etc.
  470.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  471.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  472.             fExtra% = 1
  473.         END IF
  474.     END IF
  475.  
  476.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  477.  
  478.     cost& = 0
  479.     FOR i% = 1 TO 26 STEP 1
  480.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  481.     NEXT i%
  482.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  483.  
  484.     IF StillNeed& > 0 THEN
  485.         ReplaceListItem BIGLIST$, ftype%, "YES"
  486.     ELSE
  487.         ReplaceListItem BIGLIST$, ftype%, ""
  488.     END IF
  489.  
  490.     IF fExtra% THEN
  491.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  492.     END IF
  493.     RestoreCursor CursorSave%
  494.     ListSym$ = ""
  495. END SUB
  496.  
  497.  
  498. '**
  499. '** Purpose:
  500. '**     Recalculates disk space and sets option status info according
  501. '**     to the current destination path.
  502. '** Arguments:
  503. '**     none.
  504. '** Returns:
  505. '**     none.
  506. '*************************************************************************
  507. SUB RecalcPath STATIC
  508.  
  509.     CursorSave% = ShowWaitCursor()
  510.  
  511.     RecalcOptFiles APPFILES
  512. ''    RecalcOptFiles OPTFILES1
  513. ''    RecalcOptFiles OPTFILES2
  514.  
  515.     RestoreCursor CursorSave%
  516. END SUB
  517.  
  518.  
  519. '**
  520. '** Purpose:
  521. '**     Sets drive status info according to latest disk space calcs.
  522. '** Arguments:
  523. '**     none.
  524. '** Returns:
  525. '**     none.
  526. '*************************************************************************
  527. SUB SetDriveStatus STATIC
  528.  
  529.     drive$ = MID$(DEST$, 1, 1)
  530.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  531.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%))
  532.     free& = GetFreeSpaceForDrive(drive$)
  533.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  534.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  535.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  536.  
  537.     IF drive$ = WINDRIVE$ THEN
  538.         ReplaceListItem DRIVETEXT$, 4, ""
  539.         ReplaceListItem DRIVETEXT$, 5, ""
  540.         ReplaceListItem DRIVETEXT$, 6, ""
  541.     ELSE
  542.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  543.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%))
  544.         IF cost& = 0 THEN
  545.             ReplaceListItem DRIVETEXT$, 4, ""
  546.             ReplaceListItem DRIVETEXT$, 5, ""
  547.             ReplaceListItem DRIVETEXT$, 6, ""
  548.         ELSE
  549.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  550.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  551.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  552.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  553.         END IF
  554.     END IF
  555. END SUB
  556.  
  557.  
  558. '**
  559. '** Purpose:
  560. '**     Appends a file name to the end of a directory path,
  561. '**     inserting a backslash character as needed.
  562. '** Arguments:
  563. '**     szDir$  - full directory path (with optional ending "\")
  564. '**     szFile$ - filename to append to directory
  565. '** Returns:
  566. '**     Resulting fully qualified path name.
  567. '*************************************************************************
  568. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  569.     IF szDir$ = "" THEN
  570.         MakePath = szFile$
  571.     ELSEIF szFile$ = "" THEN
  572.         MakePath = szDir$
  573.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  574.         MakePath = szDir$ + szFile$
  575.     ELSE
  576.         MakePath = szDir$ + "\" + szFile$
  577.     END IF
  578. END FUNCTION
  579.  
  580.