views:

127

answers:

1

Hi,

I have a number of editions of the project for which I am making a Visual Studio setup project (installer).

For each edition there is a separate license agreement that should be shown in the default License Agreement window.

What I want to do is to point the LicenseFile of the License Agreement window to a file somewhere on the client FS.

But the license file itself should be conditionally included into the setup package based on either conditional compilation symbol (EDITION_FREE, EDITION_GOLD etc) or just a name of the Configuration.

Not sure how I would do that and what conditions are available for the Condition property for files?

Thanks,
Dmitriy.

A: 

You can create separate versions of the same file with different extensions. Lets assume that your license file is License.txt, so you will need to create several ones more, one per each configuration and give them following names:

License.free.txt

License.gold.txt etc

Then you need to create build configurations with the same name as file suffix (free, gold) and use this-like post build script. Please look at this question too.

Restuta
It will work for non-Setup project. I have added a pre-build event to copy the file to a specific directory and reference the file from *License Agreement* window. But the setup will not compile as initially there is no file (and pre-build event has not executed yet).So I will have to keep a fake file for that which is kind of ugly.
Dmytrii Nagirniak
Why you can't add a pre-build event for setup project?
Restuta
Because the files have to be validated before the pre-build event is executed.Anyway, I have added a post-build event for the other project that copies the relevant file to its directory. Then reference that file from the setup project. This makes sure the file always valid even before the Setup project will be validated.I'll accept your answer as it provided me couple of ideas.
Dmytrii Nagirniak