Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从nant light任务重写WixVariable_Wix_Nant - Fatal编程技术网

如何从nant light任务重写WixVariable

如何从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

在我的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>

如何从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”