[wix-users] Transfer to Exclude Directories{

Steven Packer stevenp at fps-gold.com
Wed Oct 19 08:46:41 PDT 2016

I am trying to Harvest a directory and exclude some of the subfolders in
this directory.  I found an example of a transform to help with this.  It
works well except that it leaves all of the ComponentRefs for all files,
even those in the directories that were excluded.  I have tried to change
the transfer to exclude the ComponentRefs but have been unsuccessful.  I
have very limited experience with WiX and transforms and so I am relying on
the superior knowledge and intellect of the WiX users group.
This is what my transform looks like.  The last section is my attempt to
exclude the ComponentRefs.  Any help is greatly appreciated.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
  <!-- Copy all attributes and elements to the output. -->
  <xsl:template match="@*|*">
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="*" />
  <xsl:output method="xml" indent="yes" />
  <!-- Create searches for the directories to remove. -->
  <xsl:key name="plugins-search" match="wix:Directory[@Name = 'Plugins']"
use="@Id" />
  <xsl:key name="tellercapture-search" match="wix:Directory[@Name =
'TellerCapture']" use="@Id" />
  <xsl:key name="help-search" match="wix:Directory[@Name = 'Help']"
use="@Id" />
  <!-- Remove directories. -->
  <xsl:template match="wix:Directory[@Name='Plugins']" />
  <xsl:template match="wix:Directory[@Name='TellerCapture']" />
  <xsl:template match="wix:Directory[@Name='Help']" />
  <!-- Remove Components referencing those directories. -->
  <xsl:template match="wix:Component[key('plugins-search', @Directory)]" />
  <xsl:template match="wix:Component[key('tellercapture-search',
@Directory)]" />
  <xsl:template match="wix:Component[key('help-search', @Directory)]" />
  <!-- Remove DirectoryRefs (and their parent Fragments) referencing those
directories. -->
  <xsl:template match="wix:Fragment[wix:DirectoryRef[key('plugins-search',
@Id)]]" />
match="wix:Fragment[wix:DirectoryRef[key('tellercapture-search', @Id)]]" />
  <xsl:template match="wix:Fragment[wix:DirectoryRef[key('help-search',
@Id)]]" />
   <!-- Remove ComponentRef referencing those Components. -->
match="wix:ComponentGroup[wix:ComponentRef[key('plugins-search', @Id)]]" />
@Id)]]" />
match="wix:ComponentGroup[wix:ComponentRef[key('help-search', @Id)]]" />
I also tried this to exclude the ComponentRefs. Still no success.
  <xsl:template match="wix:Fragment[wix:ComponentRef[key('plugins-search',
@Id)]]" />
match="wix:Fragment[wix:ComponentRef[key('tellercapture-search', @Id)]]" />
  <xsl:template match="wix:Fragment[wix:ComponentRef[key('help-search',
@Id)]]" />
If there is documentation on how to create transforms I would like to know
where to find it.  Most of what I have done is guess work because this is
very difficult for me to understand.
Steven Packer
This email and any files transmitted with it are confidential. If you have received this email in error please delete it immediately. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of DHI. Finally, this email and attachments have been scanned for viruses; however, DHI Computing Service accepts no liability for any damage caused by any virus transmitted by this email.

More information about the wix-users mailing list