WiX Heat.exe Win64 Components - Win64="yes"
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>
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.
I also had this problem. Below is what I've done and it helped.
1)
Open .wixproj file in notepad and manually change Condition-s in PropertyGroup-s to be "x64" instead of "x86":
<Platform Condition=" '$(Platform)' == '' ">x64</Platform> ... <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> ... <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> ...
2)
Go to Configuration Manager for the solution and make sure that x64 is chosen as the platform for the Wix project.
Although Heat still generates Component nodes without Win64="yes", but it builds ok and installs to the C:\Program Files!