WiX Heat.exe Win64 组件 - Win64=“是" [英] WiX Heat.exe Win64 Components - Win64="yes"

查看:29
本文介绍了WiX Heat.exe Win64 组件 - Win64=“是"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm building an installer at the moment that targets just 64bit machines. Part of the process involves running Heat.exe to produce a Fragment elements containing part of the deployed application.

问题是由热量产生的组件会产生 ICE:80 错误,这是 WiX 抱怨组件针对 32 位系统而我的安装程序正在尝试将它们加载到:

The problem is the components that are produced by heat produce ICE:80 errors which is WiX complaining that the components target 32bit systems and my installer is trying to load these into:

<Directory Id="ProgramFiles64Folder">

查看文档,有一个 -platform 开关可用于告诉 Heat 我们的目标是 x64 环境,但是文档中没有任何线索如何使用这个开关.我试过了:

Looking at the documentation there is a -platform switch that can be used to tell Heat that we are targeting an x64 environment however there is no clue in the documentation on how to use this switch. I've tried:

-platform=x64

-platform=Win64

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

Nothing seems to effect the output in order to set the Win64 attribute on the generated components. Has anyone figured this out? Or am I barking up the wrong tree entirely?

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

If I manually edit the harvested components to add Win64="yes" the ICE error goes away.

在我的 <Product> 元素中,我有 Platform="x64" 据我所知 candle 应该接受这个并计算出默认情况下,组件应设置为 x64,但这似乎不起作用.

In my <Product> element I have Platform="x64" as I understand it candle should take this and work out that the components should be set to x64 by default but this isn't working it seems.

很困惑.

推荐答案

这里是 XSLT 文件.将其另存为例如HeatTransform.xslt:

Here would be the XSLT-file. Save it as e.g. 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>

然后,在您的 heat-命令行中添加参数 -t \HeatTransform.xslt.这会将 Win64 属性添加到每个组件.此外,我的 WiX 源文件中有 Platform='x64'-attribute,并将 -arch x64-参数添加到 candle,正如您在问题中已经描述的那样.

Then, in your heat-commandline add the parameter -t <PathToYourFile>\HeatTransform.xslt. This will add the Win64-attribute to every component. Additionally I have Platform='x64'-attribute in my WiX source file(s) and add the -arch x64-parameter to the invocation of candle, as you already described in your question.

这篇关于WiX Heat.exe Win64 组件 - Win64=“是"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆