如何覆盖 nant light 任务中的 WixVariable
在我的 Product.wxs 文件中,我有以下元素:
<WixVariable Id="MySourceDir" Overridable="yes" Value="C:\somePath\files\"/>
然后在热生成的 wxs 文件中,我有一些类似的内容:
<Fragment>
<ComponentGroup Id="FunctionalLibs">
<Component Id="cmp3A42AC690DA7590004EC5796B1C6BA95" Directory="dir5DCBEA4AA069AE7BD92B4A3EA9C5EC79" Guid="{8FD7F7BF-68C1-492C-8F29-8E3003A6F441}">
<File Id="fil007BA1D3A56EDEA1D669D51D8C61F518" KeyPath="yes" Source="!(wix.MySourceDir)\file1.dll" />
</Component>
</ComponentGroup>
</Fragment>
在我的 nant 构建文件中,我有
<light exedir="${wix.dir}"
out="${output.dir}\PluginInstaller.msi"
cultures="en-us"
rebuild="true"
suppresspdb="true">
<sources basedir="${release.dir}\obj\\${configuration}">
<include name="*.wixobj" />
</sources>
</light>
如何从轻任务中设置 wix.MySourceDir 值?
In my Product.wxs file I have the following element:
<WixVariable Id="MySourceDir" Overridable="yes" Value="C:\somePath\files\"/>
then in a heat generated wxs file I have something along the lines of:
<Fragment>
<ComponentGroup Id="FunctionalLibs">
<Component Id="cmp3A42AC690DA7590004EC5796B1C6BA95" Directory="dir5DCBEA4AA069AE7BD92B4A3EA9C5EC79" Guid="{8FD7F7BF-68C1-492C-8F29-8E3003A6F441}">
<File Id="fil007BA1D3A56EDEA1D669D51D8C61F518" KeyPath="yes" Source="!(wix.MySourceDir)\file1.dll" />
</Component>
</ComponentGroup>
</Fragment>
in my nant build file I have
<light exedir="${wix.dir}"
out="${output.dir}\PluginInstaller.msi"
cultures="en-us"
rebuild="true"
suppresspdb="true">
<sources basedir="${release.dir}\obj\\${configuration}">
<include name="*.wixobj" />
</sources>
</light>
How do I set the wix.MySourceDir value from the light task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如 Light 的 NAnt 任务参考中所述,您可以向 Light 添加其他参数.exe 使用
标记。 light.exe 的命令行参考 表示我们使用-d< /code> 定义 WixVariables,所以:
这应该可以解决问题。然而,也许像您一样定义源目录的更简单、更受支持且更常见的方法是使用预处理器变量。 蜡烛任务直接使用标记,对源代码的唯一更改是将
Source="!(wix.MySourceDir)\file1.dll"
更改为Source="!(var.MySourceDir)\ file1.dll”
。As described in the NAnt Task Reference for Light, you can add additional arguments to Light.exe using the
<arg>
tag. The command line reference for light.exe says we use-d
to define WixVariables, so:That should do the trick. However, perhaps the simpler, more supported, and more common way of defining a source directory like you're doing is using a preprocessor variable. The Candle Task supports them directly using the
<defines>
tag and the only change to your source code would be to changeSource="!(wix.MySourceDir)\file1.dll"
toSource="!(var.MySourceDir)\file1.dll"
.