Xoce
Posts: 1
Joined: Thu Nov 09, 2017 8:44 am

Custom RegeX

Am using AdvancedInstaller and I need to validate that the product installation's path doenst contains a group of chars (semi-colon e.g.), those char are allowed by default in windows OS paths but allowing this is creating problems for my custom tool to start when containing such "Special chars"...

how can I define a Condition and validate the installation path against a regex pattern?.

thanks in advance

beste regards.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Custom RegeX

Hello,

This could be implemented using the following method:
- go to "Custom Actions" page and create a new "Process Data" custom action configured as follows:

Code: Select all

"Text:" field enter the formatted reference "[APPDIR]"
"Type:" "Matching"
"What to match:" "Regex"
"Regex:" your regex
"Property name:" "REGEX"
- go to "Dialogs" page and select the "Next" button from "FolderDlg" dialog.
- create a new execute custom action publish event for the Process Data custom action and place it at the top of the publish events list
- create a new "Display a specific child dialog" publish event and place it after the Process data custom action. Condition this event by the property associated with the Process data custom action. Just enter "REGEX" in the condition field. This will ensure the spawn dialog will only be shown when the value of APPDIR matches the regex. You could edit the spawn dialog as you like.
- condition the "Display a specific dialog" publish event that displays the next dialog with the following condition : REGEX="0"
This will ensure that the next dialog will be displayed only if the the APPDIR value doesn't match against your regex.


Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”