How can I define Wix properties and values that change depending on which Visual Studio configuration is active? e.g. For our release build, var x = 1 and for the export build, var x = 2.
8077 次
3 回答
13
We pass properties into WiX from the wixproj files using
<DefineConstants>configuration=$(Configuration)</DefineConstants>
In a PropertyGroups section. Then you can use them inside wix as $(var.configuration)
<?if $(var.configuration) = Debug ?>
<?define x=1 ?>
<?endif ?>
The WiX help file has a whole section on preprocessor stuff, give that a look for other things you can do.
于 2009-03-09T17:43:40.093 回答
6
I am using WiX 3.10 and $(var.Configuration)
just worked for me.
于 2016-09-28T16:18:50.517 回答
1
You can use Project Reference Variables for that. No need to specify constants.
Sample steps:
- Add a project reference (of the application) to your setup project
Right Click 'References', 'Add References'
- Use project reference values in your wxs file
$(var.ProjectName.Configuration)
<?if $(var.ProjectName.Configuration) = Debug ?>
<?define x=1 ?>
<?endif ?>
Resources:
于 2015-07-19T15:12:56.540 回答