This how-to will be short and sweet.
The scenario we have on our hands today is the following: on of our customers wanted to synchronize one folder from the project with one folder on the disk, but in the process he wanted to exclude all the XML files but few from a subfolder.
Unfortunately, this would require some regex which we unfortunately do not have support for for the "Include" and "Exclude" filters.
To better understand this, I say we work on an example. Consider we have the following folder structure on disk:
If we open our project, enable synchronization of "Application Folder" with our folder from the disk and while doing so, we also exclude all the XML files, we can notice that "three.xml" and "four.xml" are not included, although we want them to be.
In order to have them included, we can use the following workaround:
- go to "Properties" page and create a new empty property
- in the "Files and Folders" page --> right click on "Application Folder" --> "New folder" --> "Property based" --> select the property we previously created
- we can then synchronize this folder with the "subfolder" from the disk (where the XML files we want included are)
- after that, we can use the "SetDirectoryPath" custom action to set the property-based folder to the value of our subfolder
In my screenshot, you will see that the custom action is duplicated. Basically what I have done there is to share it between the two stages (using shift + drag and drop)
After doing so, select the one under "Install Execution Stage" --> under "Execution Stage Condition" --> click "Advanced execution scenarios..." hyperlink and select "Skip action in Install Execution Stage if executed in Dialogs Stage".
This will make the custom action to not be executed twice if the setup is launched with full UI.
This way, after the installation, you should have the two XML files in the subfolder of the installation directory.
Hope this helps!
Best regards,
Catalin