home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* MSSetup Toolkit Sample 2
- '**************************************************************************
-
- ' '$DEFINE DEBUG ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- ''Dialog ID's
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST OPTIONS = 800
- CONST APPHELP = 900
- CONST MULTILIST = 5200
- CONST CUSTINST = 6200
- CONST TOOBIG = 6300
- CONST BADPATH = 6400
-
- ''Bitmap ID
- CONST LOGO = 1
-
- ''File Types
- CONST NUMFILETYPES = 5
-
- CONST APPFILES = 1
- CONST FORMATS = 2
- CONST SCANNERS = 3
- CONST PRINTERS = 4
- CONST IMAGES = 5
-
-
- GLOBAL DEST$ ''Default destination directory.
- GLOBAL WINDRIVE$ ''Windows drive letter.
-
- ''CustInst list symbol names
- GLOBAL APPNEEDS$ ''Option list costs per drive
- GLOBAL OPT1NEEDS$
- GLOBAL OPT2NEEDS$
- GLOBAL OPT3NEEDS$
- GLOBAL OPT4NEEDS$
- GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
- GLOBAL BIGLIST$ ''List of option files cost calc results (boolean)
- GLOBAL LISTITEMSIN$
- GLOBAL LISTITEMSOUT$
- GLOBAL MULTILISTTITLE$
- GLOBAL LISTSCANNERS$
- GLOBAL LISTPRINTERS$
- GLOBAL LISTFORMATS$
- GLOBAL LISTIMAGES$
- GLOBAL CUIDLL$
- GLOBAL SrcDir$
- GLOBAL HIFFLDLL$
-
- ''Dialog list symbol names
- GLOBAL CHECKSTATES$
- GLOBAL STATUSTEXT$
- GLOBAL DRIVETEXT$
-
-
- DECLARE SUB AddOptFilesToCopyList (ftype%)
- DECLARE SUB RecalcOptFiles (ftype%)
- DECLARE SUB RecalcPath
- DECLARE SUB SetDriveStatus
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
- DECLARE SUB CopyList (ListTo$, ListFrom$)
- DECLARE SUB GetListOptions (List$, Section$, Option%)
- DECLARE SUB AddOptFiles (List$, Section$, DestDir$)
-
-
-
- INIT:
- CUIDLL$ = "mscuistf.dll" ''custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- SetBitmap CUIDLL$, LOGO
- SetTitle "HALO Desktop Imager Setup"
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
- WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
- DEST$ = WINDRIVE$ + ":\IMAGER2"
-
- ''CustInst list symbols
- CHECKSTATES$ = "CheckItemsState"
- STATUSTEXT$ = "StatusItemsText"
- DRIVETEXT$ = "DriveStatusText"
-
- '**************************
- '* add any sub sections here
- '**************************
- AddListItem "SectionList", "Textures"
- AddListItem "SectionList", "Tutorial"
- AddListItem "SectionList", "Kodak XL 7700"
-
- FOR i% = 1 TO NUMFILETYPES STEP 1
- AddListItem CHECKSTATES$, "ON"
- NEXT i%
- FOR i% = 1 TO NUMFILETYPES STEP 1
- AddListItem STATUSTEXT$, ""
- NEXT i%
- FOR i% = 1 TO 7 STEP 1
- AddListItem DRIVETEXT$, ""
- NEXT i%
- ReplaceListItem DRIVETEXT$, 7, DEST$
-
- ''Disk cost list symbols
- APPNEEDS$ = "AppNeeds"
- OPT1NEEDS$ = "Opt1Needs"
- OPT2NEEDS$ = "Opt2Needs"
- OPT3NEEDS$ = "Opt3Needs"
- OPT4NEEDS$ = "Opt4Needs"
- EXTRACOSTS$ = "ExtraCosts"
- BIGLIST$ = "BigList"
- LISTITEMSIN$ = "ListItemsIn"
- LISTITEMSOUT$ = "ListItemsOut"
- LISTSCANNERS$ = "Scanners"
- LISTPRINTERS$ = "Printers"
- LISTFORMATS$ = "Formats"
- LISTIMAGES$ = "Images"
-
- FOR i% = 1 TO NUMFILETYPES STEP 1
- AddListItem BIGLIST$, ""
- NEXT i%
- FOR i% = 1 TO 26 STEP 1
- AddListItem EXTRACOSTS$, "0"
- NEXT i%
-
- ' IF 1 = DoesIniKeyExist("win.ini", "HALO IFF", "LibDir") THEN
- ' HIFFLDLL$ = GetIniKeyString("win.ini", "HALO IFF", "DLL")
- ' ELSE
- ' HIFFLDLL$ = DEST$ + "\HIFFL"
- HIFFLDLL$ = DEST$
- ' ENDIF
-
- MakeListFromSectionKeys LISTSCANNERS$, "Scanners"
- MakeListFromSectionKeys LISTPRINTERS$, "Printers"
- MakeListFromSectionKeys LISTFORMATS$, "Formats"
- MakeListFromSectionKeys LISTIMAGES$, "Images"
-
- RecalcPath
- SetDriveStatus
-
- '$IFDEF DEBUG
- i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
- '$ENDIF ''DEBUG
-
-
- CUSTINST:
- sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- ''Install only if it will fit.
- FOR i% = 1 TO 3 STEP 1
- IF GetListItem(BIGLIST$, i%) <> "" THEN
- GOSUB TOOBIG
- GOTO CUSTINST
- END IF
- NEXT i%
- UIPop 1
- GOTO INSTALL
- ELSEIF sz$ = "PATH" THEN
- GOTO GETPATH
- ELSEIF sz$ = "CHK1" THEN
- RecalcOptFiles APPFILES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK2" THEN
- RecalcOptFiles FORMATS
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK3" THEN
- RecalcOptFiles SCANNERS
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK4" THEN
- RecalcOptFiles PRINTERS
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "CHK5" THEN
- RecalcOptFiles IMAGES
- SetDriveStatus
- GOTO CUSTINST
- ELSEIF sz$ = "BTN2" THEN
- GOTO DOFORMATS
- ELSEIF sz$ = "BTN3" THEN
- GOTO DOSCANNERS
- ELSEIF sz$ = "BTN4" THEN
- GOTO DOPRINTERS
- ELSEIF sz$ = "BTN5" THEN
- GOTO DOIMAGES
-
- ELSEIF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO CUSTINST
- ELSE
- GOSUB ASKQUIT
- GOTO CUSTINST
- END IF
-
-
-
- INSTALL:
- ClearCopyList
- AddOptFilesToCopyList APPFILES
- AddOptFilesToCopyList FORMATS
- AddOptFilesToCopyList SCANNERS
- AddOptFilesToCopyList PRINTERS
- AddOptFilesToCopyList IMAGES
-
- CreateDir DEST$, cmoNone
- ' CreateDir HIFFLDLL$, cmoNone
- CopyFilesInCopyList
-
- '********** Create the imager.ini file ********'
- imagerini$ = MakePath(DEST$, "imager.ini")
- ini$ = imagerini$
- tmpini$ = MakePath(GetSymbolValue("STF_CWDDIR"), "hdisetup.ini")
-
- '************ Create HALO Desktop Imager Section *******'
- CreateIniKeyValue ini$, "HALO Desktop Imager", "NativeIFF", "TIFF", cmoNone
-
- '************* Install HIFFL
-
- IF GetListItem(CHECKSTATES$, FORMATS) = "ON" THEN
-
- '************* Create hiffl.ini
- ' ini$ = MakePath(DEST$, "foo.INI")
- ' ini$ = MakePath(HIFFLDLL$, "hiffl.INI")
- l% = GetListLength("Formats")
-
-
- FOR i% = l% TO 1 STEP -1
- sz$ = GetListItem ("Formats", i%)
- CreateIniKeyValue ini$, "FORMATS", sz$, GetSectionKeyFilename("Formats", sz$) , cmoNone
-
- CreateIniKeyValue ini$, sz$, "LibraryName", GetSectionKeyFilename("Formats", sz$) , cmoNone
- CreateIniKeyValue ini$, sz$, "Name", sz$, cmoNone
- CreateIniKeyValue ini$, sz$, "Path", "", cmoNone
- CreateIniKeyValue ini$, sz$, "Ext", GetIniKeyString(tmpini$, sz$, "Ext"), cmoNone
- CreateIniKeyValue ini$, sz$, "Options", GetIniKeyString(tmpini$, sz$, "Options"), cmoNone
- NEXT i%
- '************* modify win.ini
- ' ini$ = "win.ini"
- ' CreateIniKeyValue ini$, "HALO IFF", "LibDir", HIFFLDLL$, cmoOverwrite
- ' CreateIniKeyValue ini$, "HALO IFF", "INI", HIFFLDLL$, cmoOverwrite
-
- ini$ = ""
- END IF
-
- '************* Install Scanners *************
-
- IF GetListItem(CHECKSTATES$, SCANNERS) = "ON" THEN
- ini$ = imagerini$
- l% = GetListLength("Scanners")
-
- FOR i% = 1 TO l% STEP 1
- sz$ = GetListItem ("Scanners", i%)
- CreateIniKeyValue ini$, "SCANNERS", sz$, GetSectionKeyFilename("Scanners", sz$) , cmoNone
- NEXT i%
-
- IF l% >= 1 THEN
- CreateIniKeyValue ini$, "HALO Desktop Imager", "Scanner", sz$, cmoNone
- ENDIF
-
- ini$ = ""
- END IF
-
- '************* Install Printers *************
-
- IF GetListItem(CHECKSTATES$, PRINTERS) = "ON" THEN
- ini$ = imagerini$
- l% = GetListLength("Printers")
-
- FOR i% = 1 TO l% STEP 1
- sz$ = GetListItem ("Printers", i%)
- CreateIniKeyValue ini$, "PRINTERS", sz$, GetSectionKeyFilename("Printers", sz$) , cmoNone
- NEXT i%
-
- ' IF l% >= 1 THEN
- ' CreateIniKeyValue ini$, "HALO Desktop Imager", "Scanner", sz$, cmoNone
- ' ENDIF
-
- ini$ = ""
- END IF
-
-
- IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
- '************* modify win.ini
- ' CreateIniKeyValue "win.ini", "HALO Desktop Imager 2.0", "IniPath", DEST$, cmoOverwrite
- CreateProgmanGroup "Media Cybernetics", "", cmoNone
- ShowProgmanGroup "Media Cybernetics", 1, cmoNone
- CreateProgmanItem "Media Cybernetics", "HALO Desktop Imager 2.0", MakePath(DEST$,"imager.exe"), "", cmoOverwrite
- CreateProgmanItem "Media Cybernetics", "Screen Capture", MakePath(DEST$,"scrncapt.exe"), "", cmoOverwrite
- CreateProgmanItem "Media Cybernetics", "Readme", "notepad.exe "+MakePath(DEST$,"readme.doc"), "", cmoOverwrite
- ENDIF
-
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, call Media Cybernetics Tecnical Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- olddest$ = DEST$
- DEST$ = GetSymbolValue("EditTextOut")
-
- ''Validate new path.
- IF IsDirWritable(DEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL1
- END IF
- UIPop 1
-
- ''Truncate display if too long.
- IF LEN(DEST$) > 23 THEN
- ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
- ELSE
- ReplaceListItem DRIVETEXT$, 7, DEST$
- END IF
-
- ''Recalc if path changed.
- IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
- RecalcPath
- SetDriveStatus
- END IF
-
- olddest$ = ""
- GOTO CUSTINST
- ELSEIF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO GETPATHL1
- ELSEIF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- GOTO GETPATHL1
- ELSE
- UIPop 1
- GOTO CUSTINST
- END IF
-
-
-
- DOSCANNERS:
- SetSymbolValue "MultiListHeader", "Select the scanners you will be using with the HALO Desktop Imager"
- GetListOptions LISTSCANNERS$, "Scanners", SCANNERS
- GOTO CUSTINST
-
- DOFORMATS:
- SetSymbolValue "MultiListHeader", "Select the formats of the image files you will be using with the HALO Desktop Imager"
- GetListOptions LISTFORMATS$, "Formats", FORMATS
- j% = GetListLength(LISTFORMATS$)
- IF j% < 1 THEN
- j% = DoMsgBox("You must select at least one format to install", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- GOTO DOFORMATS
- ENDIF
-
- GOTO CUSTINST
-
- DOPRINTERS:
- SetSymbolValue "MultiListHeader", "Select any special printers you will be using with the HALO Desktop Imager"
- GetListOptions LISTPRINTERS$, "Printers", PRINTERS
- GOTO CUSTINST
-
- DOIMAGES:
- SetSymbolValue "MultiListHeader", "Select the smaple images you would like to install"
- GetListOptions LISTIMAGES$, "Images", IMAGES
- GOTO CUSTINST
-
- TOOBIG:
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO TOOBIG
- END IF
- UIPop 1
- RETURN
-
-
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
-
- '*
- '* GetListOptions:
- '* Invoke the multi list options dialog for a specific list
- '* of options
- '*
- SUB GetListOptions (List$, Section$, Option%) STATIC
-
- SetSymbolValue "MultiListTitle", "Install " + List$
-
- MakeListFromSectionKeys LISTITEMSIN$, Section$
- CopyList LISTITEMSOUT$, List$
-
- GLO1:
- sz$ = UIStartDlg(CUIDLL$, MULTILIST, "FMultiDlgProc", APPHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- CopyList List$, LISTITEMSOUT$
- RecalcOptFiles Option%
-
- ELSEIF sz$ = "REACTIVATE" THEN
- RecalcPath
- SetDriveStatus
- GOTO GLO1
- ' ELSEIF sz$ = "EXIT" THEN
- ' GOSUB ASKQUIT
- ' GOTO GLO1
- ELSE
- UIPop 1
- newopt$ = ""
- END IF
-
- END SUB
-
-
- SUB CopyList (ListTo$, ListFrom$) STATIC
-
- l% = GetListLength ( ListFrom$ )
- SetSymbolValue ListTo$, ""
-
- FOR i% = 1 TO l% STEP 1
- sz$ = GetListItem (ListFrom$, i%)
- AddListItem ListTo$, sz$
- NEXT i%
- END SUB
-
-
-
- '**
- '** Purpose:
- '** Adds the specified option files to the copy list.
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** APPFILES, SCANNERS, FORMATS
- '** Returns:
- '** none.
- '*************************************************************************
- SUB AddOptFilesToCopyList (ftype%) STATIC
-
- IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- IF ftype% = APPFILES THEN
- AddSectionFilesToCopyList "HDIFiles", SrcDir$, DEST$
-
- ELSEIF ftype% = SCANNERS THEN
- AddOptFiles LISTSCANNERS$, "Scanners", DEST$
-
- ELSEIF ftype% = FORMATS THEN
- ' AddOptFiles LISTFORMATS$, "Formats", HIFFLDLL$
- AddOptFiles LISTFORMATS$, "Formats", DEST$
-
- ELSEIF ftype% = PRINTERS THEN
- AddOptFiles LISTPRINTERS$, "Printers", DEST$
-
- ELSEIF ftype% = IMAGES THEN
- AddOptFiles LISTIMAGES$, "Images", DEST$
-
- END IF
- SrcDir$ = ""
- END IF
- END SUB
-
- SUB AddOptFiles( List$, Section$, DestDir$) STATIC
-
- l% = GetListLength ( List$ )
-
- FOR i% = 1 TO l% STEP 1
- sz$ = GetListItem (List$, i%)
- AddSectionKeyFileToCopyList Section$, sz$, SrcDir$, DestDir$
- m% = GetListLength ( "SectionList")
- FOR j% = 1 to m% STEP 1
- sz2$ = GetListItem ("SectionList", j%)
- IF sz2$ = sz$ THEN
- AddSectionFilesToCopyList sz$, SrcDir$, DestDir$
- ENDIF
- NEXT j%
- NEXT i%
-
- END SUB
-
- '**
- '** Purpose:
- '** Recalculates disk space for the given option files and sets
- '** the status info symbol "StatusItemsText".
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** APPFILES, SCANNERS, FORMATS
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcOptFiles (ftype%) STATIC
- CursorSave% = ShowWaitCursor()
- ClearCopyList
- AddOptFilesToCopyList ftype%
-
- fExtra% = 0
- IF ftype% = APPFILES THEN
- ListSym$ = APPNEEDS$
- IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
- ''Add extra cost to Windows drive for ini/progman, etc.
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- ReplaceListItem EXTRACOSTS$, ndrive%, "2048"
- fExtra% = 1
- END IF
- ELSEIF ftype% = FORMATS THEN
- ListSym$ = OPT1NEEDS$
- ELSEIF ftype% = SCANNERS THEN
- ListSym$ = OPT2NEEDS$
- ELSEIF ftype% = PRINTERS THEN
- ListSym$ = OPT3NEEDS$
- ELSEIF ftype% = IMAGES THEN
- ListSym$ = OPT4NEEDS$
- END IF
-
- StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
-
- cost& = 0
- FOR i% = 1 TO 26 STEP 1
- cost& = cost& + VAL(GetListItem(ListSym$, i%))
- NEXT i%
- ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
-
- IF StillNeed& > 0 THEN
- ReplaceListItem BIGLIST$, ftype%, "YES"
- ELSE
- ReplaceListItem BIGLIST$, ftype%, ""
- END IF
-
- IF fExtra% THEN
- ReplaceListItem EXTRACOSTS$, ndrive%, "0"
- END IF
- RestoreCursor CursorSave%
- ListSym$ = ""
- END SUB
-
-
- '**
- '** Purpose:
- '** Recalculates disk space and sets option status info according
- '** to the current destination path.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcPath STATIC
-
- CursorSave% = ShowWaitCursor()
-
- RecalcOptFiles APPFILES
- RecalcOptFiles SCANNERS
- RecalcOptFiles FORMATS
- RecalcOptFiles PRINTERS
- RecalcOptFiles IMAGES
-
- RestoreCursor CursorSave%
- END SUB
-
-
- '**
- '** Purpose:
- '** Sets drive status info according to latest disk space calcs.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB SetDriveStatus STATIC
-
- drive$ = MID$(DEST$, 1, 1)
- ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
- cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%)) + VAL(GetListItem(OPT3NEEDS$, ndrive%)) + VAL(GetListItem(OPT4NEEDS$, ndrive%))
-
- free& = GetFreeSpaceForDrive(drive$)
- ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
- ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
-
- IF drive$ = WINDRIVE$ THEN
- ReplaceListItem DRIVETEXT$, 4, ""
- ReplaceListItem DRIVETEXT$, 5, ""
- ReplaceListItem DRIVETEXT$, 6, ""
- ELSE
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%)) + VAL(GetListItem(OPT3NEEDS$, ndrive%)) + VAL(GetListItem(OPT4NEEDS$, ndrive%))
- IF cost& = 0 THEN
- ReplaceListItem DRIVETEXT$, 4, ""
- ReplaceListItem DRIVETEXT$, 5, ""
- ReplaceListItem DRIVETEXT$, 6, ""
- ELSE
- free& = GetFreeSpaceForDrive(WINDRIVE$)
- ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
- ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
- END IF
- END IF
- END SUB
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-