Select a drive only

Got a problem you cannot solve? Try here.
alibaba
Posts: 314
Joined: Fri Jun 26, 2009 8:46 am
Location: Thuringia, Germany

Select a drive only

Postby alibaba » Sun May 11, 2014 11:29 pm

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

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Select a drive only

Postby FrancescoT » Mon May 12, 2014 11:18 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

alibaba
Posts: 314
Joined: Fri Jun 26, 2009 8:46 am
Location: Thuringia, Germany

Re: Select a drive only

Postby alibaba » Tue May 13, 2014 3:57 am

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!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Select a drive only

Postby FrancescoT » Wed May 14, 2014 10:54 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

alibaba
Posts: 314
Joined: Fri Jun 26, 2009 8:46 am
Location: Thuringia, Germany

Re: Select a drive only

Postby alibaba » Thu May 15, 2014 12:05 am

Thank you very much for your Test. I can now stop my tests and will try to create a DLL.

Best Regards!


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 10 guests