aweber
Posts: 52
Joined: Mon Jun 18, 2018 7:45 pm

conditionally include file per Build?

Tue Dec 03, 2019 10:33 pm

I looked at an old thread, and it didn't seem to address the question fully (or not in the way that I would like)...

Is there a way to include a file in the Installer on a Per-Build basis?

For example, can I create a "TrialSoftware" build and include a special license or text file? But in other builds do not include the file at all in the output (MSI or CAB)?

I see that I can conditionally install files, and I see that I can choose a different source path on a per-build basis. These are good features, but they do not address my issue...I do not want the extra file to be include in the distribution at all.

(Not sure if a pre/post build event can do this either.)

Thanks!

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: conditionally include file per Build?

Thu Dec 05, 2019 2:34 pm

Hello,

To achieve what you want you can create in "Organization" page of your setup project a new feature (LicenseFeature) that you will configure to be included only in the build you need so. Then you can add your license file in "Files and Folders" page and in "Organization" page move its component under the above LicenseFeature.

Here is a step by step configuration you can use:

1. go to "Files and Folders" page and add your license file
2. select the license file and press [F8] key (Go To Component shortcut option)
3. in "Organization" page expand the selected component and make sure it does not include any other resources than your license file; otherwise right click on the license file resource and use the "Move to new component" context menu option
4. create a new feature and move the component of your license file under the newly created feature (LicenseFeature)
5. in the "Feature Properties" right pane use the "Include feature only in the selected builds" option and select only the build you want your license file be included into

Hope this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

aweber
Posts: 52
Joined: Mon Jun 18, 2018 7:45 pm

Re: conditionally include file per Build?

Thu Dec 05, 2019 4:20 pm

This procedure looks like it works. Thank you.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: conditionally include file per Build?

Fri Dec 06, 2019 9:12 am

You are always welcome!

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”