WiX Heat.exe Win64组件 - Win64 ="是"

Jam*_*mer 11 windows-installer wix

我目前正在构建一个仅针对64位计算机的安装程序.该过程的一部分涉及运行Heat.exe以生成Fragment包含已部署应用程序的一部分的元素.

问题是由热量产生的组件产生ICE:80错误,WiX抱怨组件以32位系统为目标而我的安装程序正在尝试将这些组件加载到:

<Directory Id="ProgramFiles64Folder">
Run Code Online (Sandbox Code Playgroud)

查看文档时-platform,可以使用一个开关来判断Heat我们是否针对x64环境,但是文档中没有关于如何使用此开关的线索.我试过了:

-platform=x64

-platform=Win64
Run Code Online (Sandbox Code Playgroud)

似乎没有任何效果影响输出,以便Win64在生成的组件上设置属性.有没有人想到这个?还是我完全吠叫错了树?

如果我手动编辑收集的组件以添加Win64="yes"ICE错误就会消失.

在我的<Product>元素中Platform="x64",据我了解它candle应该采取这一点并确定组件应该默认设置为x64,但这似乎不起作用.

非常困惑.

taf*_*fit 15

这将是XSLT文件.保存为例如HeatTransform.xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
    xmlns="http://schemas.microsoft.com/wix/2006/wi"
  exclude-result-prefixes="wix">

  <xsl:output method="xml" encoding="UTF-8" indent="yes" />

  <xsl:template match="wix:Wix">
    <xsl:copy>
      <!-- The following enters the directive for adding the config.wxi include file to the dynamically generated file -->
      <!--xsl:processing-instruction name="include">$(sys.CURRENTDIR)wix\config.wxi</xsl:processing-instruction-->
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>

  <!-- ### Adding the Win64-attribute to all Components -->
  <xsl:template match="wix:Component">

    <xsl:copy>
      <xsl:apply-templates select="@*" />
        <!-- Adding the Win64-attribute as we have a x64 application -->
        <xsl:attribute name="Win64">yes</xsl:attribute>

        <!-- Now take the rest of the inner tag -->
        <xsl:apply-templates select="node()" />
    </xsl:copy>

  </xsl:template>

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)

然后,在heat-commandline中添加参数-t <PathToYourFile>\HeatTransform.xslt.这将为Win64每个组件添加-attribute.另外,我Platform='x64'在我的WiX源文件中有-attribute并将-arch x64-parameter 添加到调用中candle,正如您在问题中已经描述的那样.


Iva*_*van 11

我也有这个问题.以下是我所做的并且有所帮助.

1)

在记事本中打开.wixproj文件并手动将PropertyGroup-s中的Condition-s更改为" x64 "而不是"x86":

<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
...
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
...
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
...
Run Code Online (Sandbox Code Playgroud)

2)

转到Configuration Manager以获取解决方案,并确保选择x64作为Wix项目的平台.

虽然Heat仍然生成没有Win64 ="yes"的Component节点,但它构建正常并安装到C:\ Program Files!


Mic*_*ann 5

包元素蜡烛任务的文档建议使用该InstallerPlatform属性:

平台

包支持的平台。不鼓励使用该属性;相反,请在 Candle.exe 命令行或 .wixproj MSBuild 项目中的 InstallerPlatform 属性中指定 -arch 开关。

安装平台

指定包的处理器架构。[...]这相当于candle.exe 中的-arch 开关。

那是:

<PropertyGroup>
  <InstallerPlatform>x64</InstallerPlatform>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

为了完整性:如果您想要一个用于多个目标平台的 WiX 项目,您应该查看WiX 3.0 中的平台识别