Folder selection: Validation-Permit or Reject selection - 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!

clint
Posts: 139
Joined: Fri Jun 19, 2009 9:46 am
Location: Germany

Folder selection: Validation-Permit or Reject selection

I have a Dialog with browse buttons which calls the BrowseDlg to allow the user to select some folders for special purposes.
Then the results are placed in an EditBox.

How do I validate the results of the Property changed by the EditBox, and if the selected folder is not permitted, (such as under VISTA the user selecting a Windows protected folder as location to store changable data of a legacy application), inform the user and restore the EditBox to the previous value?

I assume I would use an ActionData=CustomAction script in the Subcribed Events which can examine the value of a Property the EditBox uses and then change it to a previous value if needed.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Folder selection: Validation-Permit or Reject selection

Hello,

Using a CustomAction is indeed the solution to your problem, as Advanced Installer does not support this feature directly. Just follow these steps:
- select the browse button
- in the Published Events, add a new SetProperty action with TMP as the property and APPDIR as the value
- TMP will store the value of APPDIR
- select the BrowseDlg
- on the OK button, in PublishedEvents create a new DoAction with your custom action as the argument
- your custom action needs to:
a) check if the value of your editbox has changed
b) if it did, then check if the selected directory is accessible
c) if not, change it back to its previous value, stored in TMP, and inform the user

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
clint
Posts: 139
Joined: Fri Jun 19, 2009 9:46 am
Location: Germany

Re: Folder selection: Validation-Permit or Reject selection

Thank you!

Return to “Common Problems”