[wix-users] Applying patch with heat

Helge Kruse Helge.Kruse at gmx.net
Fri Jan 13 08:59:42 PST 2017

Am 12.01.2017 um 16:29 schrieb Phill Hogland:
> With regard to #2, this is not a direct answer but code I use to set some attributes.

But this was very helpful. I'm still learning XSLT but got a basic idea
how this file affects the processing. Useful is Michael Kays book "XSLT"
2nd edition.

To apply the transforms (exclude files by extension, add attributes to
files selected by extension) I use this XSLT file.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"

  <xsl:output method="xml" />

  <!-- Identity transform. -->
  <xsl:template match="@*|node()">
      <xsl:apply-templates select="@*|node()" />

  <!-- Special case: Skip components by file type .PDB .WSC -->
  <xsl:key name="pdb-search"
match="wix:Component[contains(wix:File/@Source, '.pdb')]" use="@Id" />
  <xsl:template match="wix:Component[key('pdb-search', @Id)]" />

  <xsl:key name="wsc-search"
match="wix:Component[contains(wix:File/@Source, '.wsc')]" use="@Id" />
  <xsl:template match="wix:Component[key('wsc-search', @Id)]" />

  <!-- Special case: Add attribute to DLLs because these are .NET
assemblies to put them to GAC. -->
  <xsl:template match="wix:File[contains(@Source,'.dll')]">
      <xsl:copy-of select="@*" />
      <xsl:attribute name="Assembly">

  <!-- Add a comment at root node. -->
  <xsl:template match="/">
    <xsl:comment>!!!DO NOT EDIT!!! Generated by HarvestDirectory
    <xsl:apply-templates />


It would be nice to have this built in into heat, but the possibility to
define a custom transform is much more flexible. E.g. the selection of
components should be difficult to configure.

Thanks for the help!


More information about the wix-users mailing list