Use a User Interface property as a folder name - Advanced Installer Community
luc
Posts: 17
Joined: Tue Jun 18, 2013 9:50 am

Use a User Interface property as a folder name

Hi
is it somehow possible to use a 'User Interface' Property as subfolder name for the Application Folder and Application Shortcut Folder?
In a Dialog I added a 'Edit Box' where the user provides a name. This 'User Interface' property I used then in the 'Installation Folders' fields. So I added this property through the Edit->Property Button at the and of the 'Application Folder' and the 'Application Shortcut Folder'. The installer offers to add this property for this purpose with any complains, however when I run the installation it creates the subfolder but not with the provided name during the installation but with the mandatory set 'Default Value'.

Is it not possible to use a user interface property for such a purpose or is there an other approach to do so?

Thanks
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Use a User Interface property as a folder name

Hello,

In order to achieve that, you can go in the “Install Parameters” page and using the “New Property” toolbar button add two properties.
Example:
First property:
Name: PROP_FOLDER_PATH - This property will store the custom name that the user typed
Value: C:\ – we must use a valid value otherwise we get an error message
Second property:
Name: CUSTOM_PATH
Value: Enter a custom name for your folder – also this value will be displayed in the editBox to the user, so you should use a meaningful message for thisproperty's value.

Now, you can go in the “Files and Folders” page and add a property based folder using the “Folder” >> “Property Based” toolbar button. You can select the “PROP_FOLDER_PATH” property (in our example we defined this property) or the property that you had defined instead of it.
So this property based folder will be named according to he user choice.

Now we have to give the right path for this folder, in the application folder as you want.
For that, you can go in the “Custom actions” page and add a “Set installer property” predefined custom action. You can edit the “Property” field to PROP_FOLDER_PATH and the “Value” field to [ProgramFilesFolder][Manufacturer]\[ProductName]\[CUSTOM_PATH] .
Also you can duplicate this custom action using a drag and drop operation, while the “Shift” key is pressed, in the “Wizard Dialogs Stage” after the “Searches” stage.

In the dialog where you added the editBox please select the CUSTOM_PATH defined property (this property we have used in our example) for the “Property Name” of the editbox.

I have attached a sample, which implements a similar scenario.

Let us know if that helped otherwise give us more details.

Best regards,
Dan
Attachments
sample.zip
(2.46 KiB) Downloaded 318 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
luc
Posts: 17
Joined: Tue Jun 18, 2013 9:50 am

Re: Use a User Interface property as a folder name

Thanks a lot Dan
that works fine.

It is a bit cumbersome but seems to work as planned.
Did the same for the Shortcut Folder as well.

Thanks & cheers
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Use a User Interface property as a folder name

Hi,

You're welcome! I'm glad you got this working.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”