Archive: Unable to find not formatted drives with GetDrives


Unable to find not formatted drives with GetDrives
Hi,

I'm currently using the macro ${GetDrives} to find removables drives (type FDD), strictly speaking compact flash drives.

This works fine as long as the compact flash disk is already formated. If it doesn't contain a valid file system ${GetDrives} will not find/display the drive.

I call HPUSBF.EXE later in the installer to format the compact flash card and to make it bootable.

Needless to say that Windows Explorer displays the drive letter and presents the dialog "Disk in drive has not been formatted. Format now?" when selecting the drive.

Is there any way to find these types of drives with the ${GetDrives} macro?
Or do I have to call a .dll directly? (This will probably exceed my current NSIS knowledge)

Somebody please point me in the right direction.


Thanks,
kaj73


I guess GetDriveType, which is used internally by GetDrives, returns DRIVE_NO_ROOT_DIR and not DRIVE_REMOVABLE as FDD expects. A slight change to GetDrives to add the ability to get unmounted drives as well might solve this. But you might also get drives which are actually unmounted. I guess you'll have to go one level lower when it comes to drives being formatted or not.

If you can write this using Win32 API, you can write a NSIS plug-in based on Examples\Plugin.


Thanks kichik, but it's all my fault :o

${GetDrives} does what it's supposed to do and returns all requested drives.
But I totally forgot that I'm also using ${DriveSpace} to check the free space, and I only save drives with a total size greater than 100MB.
Naturally not formatted drives don't return any valid size information.

After removing the size check everything works as expected.