This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Getting Drive Information
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
01:27 AM
Getting Drive Information
Hi,
I need to find out that if a drive selected is local drive or Network or anyother. In a nutshell I need to find the drive type. I have been trying using the code
di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
svResult = GetDiskInfo(&di);
but Installscript return error for the code svResult = GetDiskInfo(&di);
What is the correct method to find drive information.
Madhu
I need to find out that if a drive selected is local drive or Network or anyother. In a nutshell I need to find the drive type. I have been trying using the code
di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
svResult = GetDiskInfo(&di);
but Installscript return error for the code svResult = GetDiskInfo(&di);
What is the correct method to find drive information.
Madhu
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
02:20 AM
Start here:
http://msdn.microsoft.com/en-us/library/aa364939(v=vs.85).aspx
Use Kernel32.dll in your Installscript code.
Something like:
prototype BOOL KERNEL32.GetComputerName ( BYREF STRING, BYREF NUMBER );
Then use the dll :
UseDLL ("kernel32.dll"); in your code and call the appropriate function. In your case GetDriveType().
Hope this helps.
http://msdn.microsoft.com/en-us/library/aa364939(v=vs.85).aspx
Use Kernel32.dll in your Installscript code.
Something like:
prototype BOOL KERNEL32.GetComputerName ( BYREF STRING, BYREF NUMBER );
Then use the dll :
UseDLL ("kernel32.dll"); in your code and call the appropriate function. In your case GetDriveType().
Hope this helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 25, 2011
03:18 AM
Thank you for the reply. I have been able to achieve it using the following code
di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
if GetDiskInfo(&di) = ISERR_SUCCESS then
if di.nDriveType != DRIVE_FIXED then
MessageBox ("Not a Fixed Drive", INFORMATION);
endif;
endif;
di.szDiskPath = szDir;
di.nInfoToQuery = DISK_INFO_QUERY_DRIVE_TYPE;
if GetDiskInfo(&di) = ISERR_SUCCESS then
if di.nDriveType != DRIVE_FIXED then
MessageBox ("Not a Fixed Drive", INFORMATION);
endif;
endif;