如何从nant light任务重写WixVariable
在我的Product.wxs文件中,我有以下元素:如何从nant light任务重写WixVariable,wix,nant,Wix,Nant,在我的Product.wxs文件中,我有以下元素: <WixVariable Id="MySourceDir" Overridable="yes" Value="C:\somePath\files\"/> 然后,在一个热生成的wxs文件中,我有如下内容: <Fragment> <ComponentGroup Id="FunctionalLibs"> <Component Id="cmp3A42AC690DA7590004EC
<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>
如何从light任务中设置wix.MySourceDir值?如中所述,您可以使用说明我们使用-d
定义WixVariables向light.exe添加其他参数,因此:
<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>
<arg line="-dMySourceDir=C:\somePath\files\" />
</light>
使用
标记直接支持它们,对源代码的唯一更改是将source=“!(wix.MySourceDir)\file1.dll”
更改为source=“!(var.MySourceDir)\file1.dll”