Page 1 of 1

Select a drive only

Posted: Sun May 11, 2014 11:29 pm
by alibaba
Hi,

I need a dialog where the customer can only select a drive. He should not select a path, because the install path is always <selected_drive>\Application .
How can I realize it with InstallAware? Anyone an idea, hint?

Thanks in advance

Re: Select a drive only

Posted: Mon May 12, 2014 11:18 am
by FrancescoT
Dear Alibaba,

the first that comes to my mind is;

- Use the "GetLogicalDriveStrings" WINAPI to retrive a strings that specify valid drives in the system.
http://msdn.microsoft.com/it-it/library/windows/desktop/aa364975(v=vs.85).aspx
- Then fill a Combobox using a script varible that contains the driver list.

Hope this helps you.

Regards

Re: Select a drive only

Posted: Tue May 13, 2014 3:57 am
by alibaba
Thank you Francesco, I did not know this function yet. I tried it but the string with the Drive list alsways contains only the "A:\" drive. I tried a lot, but always the same. :(

Thank you anyway!

Re: Select a drive only

Posted: Wed May 14, 2014 10:54 am
by FrancescoT
Dear Alibaba,

Yes, I see what you mean.

This happens because the function returns a series of null-terminated strings, one for each valid drive in the system.

Unfortunately it is not possible to parse via IA script, each Null - Termination that delimits the returned drive string.

Alternatively, you could create a specialized DLL or EXE that calls the "GetLogicalDriveStrings" WINAPI and then to execute it from your script.
There are many examples available from the web on how to use the function.

Hope this helps you.

Regards

Re: Select a drive only

Posted: Thu May 15, 2014 12:05 am
by alibaba
Thank you very much for your Test. I can now stop my tests and will try to create a DLL.

Best Regards!