首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WiX Heat.exe Win64 Components -Win64=“是”

WiX Heat.exe Win64 Components -Win64=“是”
EN

Stack Overflow用户
提问于 2014-04-08 09:30:01
回答 4查看 11.5K关注 0票数 20

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

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

代码语言:javascript
复制
<Directory Id="ProgramFiles64Folder">

在文档中,有一个-platform开关可以用来告诉Heat我们正在针对一个x64环境,但是在文档中没有关于如何使用这个开关的线索。我试过:

代码语言:javascript
复制
-platform=x64

-platform=Win64

为了在生成的组件上设置Win64属性,似乎没有任何东西影响输出。有人想清楚了吗?还是我完全搞错了树?

如果我手动编辑收获的组件以添加Win64="yes",则ICE错误将消失。

在我的<Product>元素中,我有Platform="x64",因为我理解它,candle应该接受它,并计算出在默认情况下应该将组件设置为x64,但这似乎不起作用。

很困惑。

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2014-04-11 12:16:53

这里是XSLT文件。将其保存为例如HeatTransform.xslt

代码语言:javascript
复制
<?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>

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

票数 21
EN

Stack Overflow用户

发布于 2014-06-24 21:14:33

我也有这个问题。下面是我所做的,这是有帮助的。

1)

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

x64 .

2)

转到解决方案的Configuration,确保选择x64作为Wix项目的平台。

虽然仍然在没有Win64=的情况下生成组件节点,但是它构建了ok并安装到C:\Program!

票数 21
EN

Stack Overflow用户

发布于 2018-10-12 10:15:08

封装元件蜡烛任务的文档建议使用InstallerPlatform属性:

平台 该软件包支持的平台。不鼓励使用此属性;相反,在candle.exe命令行指定candle.exe开关或在.wixproj MSBuild项目中指定InstallerPlatform属性。InstallerPlatform 指定包的处理器体系结构。..。这相当于candle.exe中的candle.exe交换机。

即:

代码语言:javascript
复制
<PropertyGroup>
  <InstallerPlatform>x64</InstallerPlatform>
</PropertyGroup>

另外,如果您想要一个用于多个目标平台的单个WiX项目,那么您应该看看WiX 3.0中的平台识别

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22932942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档