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
Msbuild 如何引用Wix中heat.exe生成的wxs文件中的File元素_Msbuild_Wix_Windows Installer_Heat - Fatal编程技术网

Msbuild 如何引用Wix中heat.exe生成的wxs文件中的File元素

Msbuild 如何引用Wix中heat.exe生成的wxs文件中的File元素,msbuild,wix,windows-installer,heat,Msbuild,Wix,Windows Installer,Heat,我将为我的web项目创建安装程序。我用它作为我的参考。在文章的中间,作者使用热.exe:创建了一个名为 WebStisteCuth.Wxs的文件。 <Target Name="Harvest"> <!-- Harvest all content of published result --> <Exec Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWeb

我将为我的web项目创建安装程序。我用它作为我的参考。在文章的中间,作者使用热.exe:

创建了一个名为<代码> WebStisteCuth.Wxs<代码>的文件。
<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec
    Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
    ContinueOnError="false"
    WorkingDirectory="." />
</Target>

运行msbuild后,文件包含以下内容:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <!--...-->
  <Fragment>
    <ComponentGroup Id="MyWebWebComponents">
      <!--...-->
      <Component Id="cmpCDB7F4EFDEF1E65C3B12BEBAD7E4D7EA" Directory="INSTALLFOLDER" Guid="{7EA5DB39-513D-482B-9FDC-2F16FCE5E712}">
        <File Id="fil8994620207C22CA15AF75ACDD6420C79" KeyPath="yes" Source="$(var.publishDir)\Web.config" />
      </Component>
    </ComponentGroup>
  <!--...-->
  </Fragment>
</Wix>

我想按中所述更改web.config文件内容的值,但我不知道如何将WebSiteContent.wxs文件之外的引用添加到FIL899462070C22CA15AF75ACDD6420C79元素

我知道我可以将xml脚本添加到WebSiteContent.wxs文件中。但是,因为在每个版本中它都会被清除,所以我不想在每个版本中更改WebSiteContent.wxs文件。

在属性中使用带有#前缀的文件id,如您引用的示例所示。heat生成的文件ID相对于其位置规范来说是稳定的


如果这使其无法读取,您可以使用heat和XSL将文件id更改为固定值。

谢谢您的帮助。您能帮助我如何将其添加到Product.wxs文件中吗?在哪个标记中?@TomBlodget您能举个例子吗,因为这似乎是无效的语法。我使用了类似于@SeyedMortezaMousavi@Ultratrunks的东西,他的意思是你可以使用标签
[#fil899462070c2ca15af75acdd6420c79]
来检索文件路径。看见