Add "Browse for folder" button to dialog - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

digitalman
Posts: 36
Joined: Mon Oct 30, 2006 7:55 pm

Add "Browse for folder" button to dialog

I've created a new dialog and want to have a browse to folder button like there is on the FolderDlg dialog. I've added a "Path Edit" and "Button" control but when I look at the event for the "Browse" button on the FolderDlg dialog I see [_BrowseProperty] but I don't see that as a choice when I add my own. I need to ask for a shared folder for some shared components if they select a "network install" radio button. Thanks.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Here is how you can achieve that:

1. Define a public property (in uppercases) in the "Install Parameters" page.
2. Create a "Property Based" folder with this property in the "Files and Folders" view.
3. Switch to "Dialogs" page and add following events on the browse button of the new dialog:

Event: select SetProperty and type in the same combo: [_BrowseProperty]
Argument: MY_DIR (property defined in the "Install Parameters" page)

Event: SpawnDialog
Argument: BrowseDlg

4. Add following event on the next button of the new dialog:

Event: SetTargetPath
Argument: MY_DIR

Please let me know if you encounter any problem.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mcg
Posts: 3
Joined: Tue Nov 28, 2006 5:06 pm

I need something similar to this, but finding it difficult to get right. Probably doing something very stupid.
Event: select SetProperty and type in the same combo: [_BrowseProperty]
So to be sure I have this correct:
Browse Button -> Published Events ->

Name: [SetProperty][_BrowseProperty]
Argument: [NETWORK_PATH]

When I attempt this step, the dialog box's OK button is disabled.

I have tried with just [_BrowseProperty] and [SetProperty] and I get a runtime error code.

Also is there a way of having the default value of my PATH EDIT control to be blank, or a FORMATED_TYPE value?
digitalman
Posts: 36
Joined: Mon Oct 30, 2006 7:55 pm

My confusion came from the fact that you select "Set Property" from the dropdown and type [_BrowseProperty] over it. The PathEdit needs to be a valid value. I set it to C:\.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
The PathEdit needs to be a valid value. I set it to C:\
Yes, you have right. But note that "C:\" may not exit on some computers. So to be sure that the path is always valid you need to do this:

Create a "Property Set with Formatted" custom action under "InstallUISequence->Begin" section. Use following options for this custom action:
1. Property Name: MY_DIR (defined in the "InstallParameters" page)
2. Formatted Text: [WindowsVolume]
3. Execution Condition: empty

Now drag & drop (while shift key is pressed) this custom action to "InstallExecutesSequence->Begin".

Hope this helps.

Kind Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”