PRB: Installing VB App Causes Error Determining Free Disk Space
ID: Q198075
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions 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
- Click the Start button, and then point to Settings. Open the Control
Panel and launch the System applet.
- Select the Environment Tab.
- Type "TMP" into the Variable text box and "%SystemDrive%\TEMP" into the
Value text box. Do not enter the quotes.
- 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.
- 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 <VB5>\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
Keywords : kbwizard kbAppSetup kbVBp kbVBp500 kbGrpVB
Version : WINDOWS:5.0
Platform : WINDOWS
Issue type : kbprb