基于 VS 活动配置定义 Wix 属性和值 [英] Defining Wix properties and values based on VS active configuration
本文介绍了基于 VS 活动配置定义 Wix 属性和值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何定义根据激活的 Visual Studio 配置而变化的 Wix 属性和值?例如对于我们的发布版本,var x = 1,对于导出版本,var x = 2.
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.
推荐答案
我们使用
<DefineConstants>configuration=$(Configuration)</DefineConstants>
在 PropertyGroups 部分.然后你可以在 wix 中使用它们作为 $(var.configuration)
In a PropertyGroups section. Then you can use them inside wix as $(var.configuration)
<?if $(var.configuration) = Debug ?>
<?define x=1 ?>
<?endif ?>
WiX 帮助文件有一整节关于预处理器的内容,看看你可以做的其他事情.
The WiX help file has a whole section on preprocessor stuff, give that a look for other things you can do.
这篇关于基于 VS 活动配置定义 Wix 属性和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文