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.
Photo

Catastrophic Error on unmapped drive


1 reply to this topic

cswarwick

cswarwick
  • Members
  • 6 posts

Posted 22 February 2002 - 22:11

I've been asked to investigate InstallShield functionality and see if we can prevent our users from being stupid.... Basically, if a user enters a destination location for say, M:, and M: isn't a mapped drive, the install will continue until it gets to the file copy process.  As soon as the install tries to create the folders (and drive in this case) the install chokes and a Catastrophic Error pops up.  What makes this extra fun is that of course the install aborts, and the ikernel is locked and has to either be released by the user (which many don't know how to do) or the user has to reboot to try the install again.   So my question is if there's anything I can do to stop the user from continuing at the point they entered an invalid drive letter so that this Ctastophic Error doesn't occur?  Thanks!

Christina


Blake Miller Wonder

Blake Miller Wonder
  • Members
  • 121 posts

Posted 25 February 2002 - 16:42

You cna use the GetLogicalDrives function that retrieves a bitmask representing the currently available disk drives.

DWORD GetLogicalDrives(VOID);

prototype LONG KERNEL.GetLogicalDrives();

Then you check the bits to see if the drive is a valid drive letter.  Bit 1 = A, Bit 2 = B, etc.

Or you can use GetDriveType function that determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive.

UINT GetDriveType(
 LPCTSTR lpRootPathName   // root directory
);

prototype LONG KERNEL.GetDriveType(BYREF STRING);

Or you can try to make the drive root directory the current directory and then switch back to 'real' current directory.  If it fails to become current, then maybe assume that drive is not valid.