Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

GetDiskSpaceEx & Novell Systems

2 replies to this topic


  • Full Members
  • 64 posts

Posted 11 July 2001 - 18:57

I have the following code in our script. One of our users has a Novell dedicated server with a Win95 workstation. This user keeps getting the message not enough disk space even though they have 21 gbytes left. Is this a known problem with GetDiskSpace and Novell? Will InstallShield 6 solve this?

lFreeSpace = GetDiskSpaceEx ( svResultPath, MBYTES );
   if (lFreeSpace < 0) then
   MessageBox ("GetDiskSpace failed", SEVERE);
//    else
//SprintfBox (INFORMATION,"", "%ld KBytes free on drive %s.",
//                  lFreeSpace, svResultPath);
lTotal = 20;
if  lFreeSpace < lTotal then
SprintfBox (SEVERE, "Disk space!", "Not enough disk space found. " +
"Need atleast %ld MBytes free", lTotal);

Stefan Krueger

Stefan Krueger


  • Administrators
  • 13,269 posts

Posted 12 July 2001 - 07:36

The problem may be Novell, but it may also be the Windows 95 version. GetDiskSpaceEx internally calls the Windows API function GetDiskFreeSpaceEx, which is not supported in versions of Windows 95 earlier than OEM Service Release 2.
You can check whether the target operating system supports GetDiskFreeSpaceEx by using script code like the following:
prototype  BOOL KERNEL.GetProcAddress(HWND, STRING);
// GetModuleHandle should already be prototyped

if GetProcAddress ( GetModuleHandle("kernel32.dll"),
   "GetDiskFreeSpaceExA" )!=0 then
   nFreeBytes = GetDiskSpaceEx ( "C:", BYTES );
   /* If GetDiskFreeSpaceEx is not supported,
   call GetDiskSpace instead of GetDiskSpaceEx. */
   nFreeBytes = GetDiskSpace ( "C:" );