DOCUMENT:Q198075 11-JAN-2001 [vbwin] TITLE :PRB: Installing VB App Causes Error Determining Free Disk Space PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0 OPER/SYS: KEYWORDS:kbcode kbwizard kbAppSetup kbVBp kbVBp500 kbGrpDSVB ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning Edition for Windows, version 5.0 - Microsoft Visual Basic Professional Edition for Windows, version 5.0 - Microsoft Visual Basic Enterprise Edition for Windows, version 5.0 ------------------------------------------------------------------------------- SYMPTOMS ======== When installing an application built with the Visual Basic 5.0 Setup Wizard on a Windows NT computer, the following error may occur: Invalid procedure call or argument Error determining disk space free for drive \: After pressing the OK button to dismiss the error message, the following error message displays: Invalid procedure call or argument Error determining allocation unit for drive \: Immediately after dismissing this error message, the following dialog box appears: There is not enough free disk space on one or more drives. The dialog box displays the "\:" as a drive letter, the remaining valid local drives on the system, Space Required, Space Available, and Space Needed. There are three buttons on the dialog box labeled "Change Drive", "Install Now", and "Exit Setup". Pressing "Change Drive" does not alleviate the problem and the same errors occur in a similar manner as stated previously. Pressing "Install Now" may or may not continue with the installation. CAUSE ===== The problem is due to code within the Visual Basic 5.0 Setup Toolkit project (Setup1.vbp) that determines the drive letter to install by using the value of TMP or TEMP environment variables. The error messages occur when these environment variables are not defined. Setup1.vbp can be located in the setupkit\setup1 directory under the Visual Basic 5.0 installation directory. RESOLUTION ========== Use the System applet in the Control Panel to define the TMP and TEMP "User" environment variables for the currently logged in user. Step-By-Step Example -------------------- 1. Click the Start button, and then point to Settings. Open the Control Panel and launch the System applet. 2. Select the Environment Tab. 3. Type "TMP" into the Variable text box and "%SystemDrive%\TEMP" into the Value text box. Do not enter the quotes. 4. Add the TEMP environment variable by following step 3 again but using "TEMP" for the Variable and "%SystemDrive%\TEMP". NOTE: If your Windows NT System Drive is the "C" drive, step 3 and 4 would set TMP and TEMP to C:\temp. 5. Try to install the Visual Basic 5.0 application again. The preceding error should not occur again. MORE INFORMATION ================ A more descriptive error message can be generated by making a modification to the Setup1.vbp project found in the \setupkit\setup1 directory, and then recompiling the project. NOTE: Microsoft Technical Support does not support the modification of the setup process, the Setup Toolkit, or any of the setup files. Support is provided for the Setup Wizard on an "as is" basis only. The code found in the "InitDiskInfo" subroutine in the Setup1.bas file should be replaced with the following code. This code produces an error message that explains that the "TEMP" and/or "TMP" variables should be defined. '----------------------------------------------------------- ' FUNCTION: InitDiskInfo ' ' Called before calculating disk space to initialize ' values used/determined when calculating disk space ' required. '----------------------------------------------------------- ' Sub InitDiskInfo() ' 'Initialize "table" of drives used and disk space array ' gstrDrivesUsed = gstrNULL Erase gsDiskSpace mlTotalToCopy = 0 ' 'Get drive/directory for temporary files ' mstrConcatDrive = UCase$(Environ$(gstrTMP_DIR)) If mstrConcatDrive = gstrNULL Then mstrConcatDrive = UCase$(Environ$(gstrTEMP_DIR)) If mstrConcatDrive = gstrNULL Then Dim iRet As Integer iRet = MsgError(Error$ & LS$ & "Unable to determine the " & _ "temporary directory. " & vbCrLf & _ "Please make sure the 'TEMP' and/or 'TMP' " & _ "environment variables are defined.", _ MB_OK Or MB_ICONSTOP, gstrTitle, MSGERR_ERROR) ExitSetup frmSetup1, gintRET_FATAL End If End If AddDirSep mstrConcatDrive Additional query words: ====================================================================== Keywords : kbcode kbwizard kbAppSetup kbVBp kbVBp500 kbGrpDSVB Technology : kbVBSearch kbAudDeveloper kbZNotKeyword6 kbZNotKeyword2 kbVB500Search kbVBA500 kbVB500 Version : WINDOWS:5.0 Issue type : kbprb Solution Type : kbpending ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2001.