Hello,
First of all, please note that the
"Application Folder" field from the
"Install Parameters" page is actually linked to the
APPDIR property.
Basically, the APPDIR property will take the value of that field.
Here is how you could achieve what you want, in a different manner.
You can leave the
"Application Folder" field to have the default value, e.g.:
Code: Select all
[ProgramFilesFolder][Manufacturer]\[ProductName]
In
"Dialogs" page, select the
"FolderDlg" and under
"Init Events" tab, add the following:
"New" --> "Set installer property value"
Property: APPDIR
Argument: [VOLUME_D]MyApp
Condition: VOLUME_D
Now please repeat the steps above after creating another search for the volume E, e.g.:
"New" --> "Set installer property value"
Property: APPDIR
Argument: [VOLUME_E]MyApp
Condition: VOLUME_E
This way, the APPDIR will be set to either D:\MyApp or E:\MyApp.
The only problem I see here would be if both drives exist on the machine. This way, the APPDIR will always be set to the second option (because this will overwrite the previous one).
Hope this helps!
Best regards,
Catalin