[wix-users] Applying patch with heat
Phill Hogland
phill.hogland at rimage.com
Thu Jan 12 07:10:16 PST 2017
For #1, I seen many similar examples in google resuts and there may be several approaches, but the approach I uses is something like:
<?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:fire='http://schemas.microsoft.com/wix/FirewallExtension'
xmlns='http://schemas.microsoft.com/wix/2006/wi'
exclude-result-prefixes='wix'
>
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<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:template match="wix:ComponentRef[key('pdb-search', @Id)]" />
</xsl:stylesheet>
For #2 it would take some more research. Maybe something like this will help
http://stackoverflow.com/questions/18078679/how-to-add-attribute-to-a-parent-node-conditioned-by-a-child-element-with-inden
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded]<http://stackoverflow.com/questions/18078679/how-to-add-attribute-to-a-parent-node-conditioned-by-a-child-element-with-inden>
How to add attribute to a parent-node conditioned by a ...<http://stackoverflow.com/questions/18078679/how-to-add-attribute-to-a-parent-node-conditioned-by-a-child-element-with-inden>
stackoverflow.com
Like in this other question I have difficulty to express simple things with XSLT1... In a xsl:stylesheet I have this "identity like" transform to add an attribute ...
________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Helge Kruse <Helge.Kruse at gmx.net>
Sent: Thursday, January 12, 2017 3:54:49 AM
To: WiX Toolset Users Mailing List
Subject: [wix-users] Applying patch with heat
While harvesting files from a directory I failed to meet two requirements:
- Some files shall be omitted. The selection shall be on the file name.
e.g. all .PDB files should be excluded for the installation.
- Files containing a .NET assembly shall have the corresponding
attributes: Assembly, AssemblyManifest, AssemblyApplication. This should
register these files in the GAC.
I could exclude the files by creating a temporary folder, copy only
required files to the temporary, and call heat with that folder. But
since the missing attributes are still an open issue, I though about the
Transform option of heat.
The heat command allows to apply a patch based on an XSL file to the
harvester output. So I could invoke it like
heat dir SomeFolderName -o xx.wxs -t myTransform.xsl
Unfortunately the page
http://wixtoolset.org/documentation/manual/v3/overview/heat.html shows
only the possibility to perform a transform, but I could not find an
example for this.
I would like to do two operations.
(1) <Component> nodes containing a file with a specific extension (.pdb)
should be removed.
(2) <File> nodes with specific extensions (.exe, .dll) should get
additional attributes:
- Assembly=".net"
- AssemblyManifest="[File/Name]"
- AssemblyApplication="[File/Name]"
Where [File/Name] stands for the name of the file at the installed file
name.
I am not experienced with XML transform language. Do you know examples
or tutorials how this can be implemented?
Is there a different way to add the attributes like "Assembly" to files
during harvesting?
Regards,
Helge
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list