0

I would like to harvest a directory using Heat which contains a lot of files and not all of them should go into installation. However, i have a list of files that should be included in another XML in this format:

<?xml version="1.0" encoding="utf-8"?>
<FileSystemList>
   <File Path="\some_folder\some.file" />
   ...
</FileSystemList>

It could just as well be a simple text file with one file per line.

I already have a XSL transform which i can specify a file to exclude but it's not really appropriate if you have hundreds of files. I know almost nothing about XSL (been using samples i could find) so i would appreciate a help to somehow include this xml/txt file into the XSL which heat will use and exclude the files in the list.

IlirB
  • 1,410
  • 14
  • 19

2 Answers2

3

Heat doesn't support that. Instead, use your build engine (e.g., MSBuild) to create a staging area that contains only the files you want to harvest.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • 1
    Yeah i found out that Heat doesn't support that but i though maybe i could do that in a transform file (XSL). For example i can use ` ` to exclude certain file and i would like to do the opposite to include only ones listed, in my case a list in another file and if XSL support something like `include` – IlirB Oct 20 '13 at 20:37
  • I got tired trying to learn XSL so i just went and did exactly what you said, use MSBuild for staging and then harvesting, it works. – IlirB Nov 21 '13 at 20:53
0

In this case, XSLT removes all xml files except "Config.xml":

<xsl:key name="XmlToRemove" 
match="wix:Component[ substring( wix:File/@Source, string-length( wix:File/@Source ) - 3) = '.xml' and not (contains(wix:File/@Source, Config.xml))]" 
use="@Id"/>
...     
<xsl:template match="wix:Component[key('XmlToRemove', @Id)]" />
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Anumeler
  • 1
  • 1