3

I'm using heat.exe (harvest directory type) to auto-generate wix authoring. There are ~40 dlls, out of which I want to GAC only a list of 10 dlls, list is available in a .txt file. Yes, I used XSLT (which I'm very new to), I'm able to do it with hardcoded values, but not dynamically read it from .txt. I tried search, not able to find good samples.

Please suggest how can I read the list of dlls dynamically from .txt and match with Source/FileId.

    <xsl:template match="wix:File[contains(@Source, 'binaryOne.dll')] | 
        wix:File[contains(@Source, 'binaryTwo.dll')] | 
        wix:File[contains(@Source, 'binaryThree.dll')]">
        <xsl:copy>
            <xsl:attribute name="Assembly">.net</xsl:attribute>
            <xsl:apply-templates select="@* | node()" />
        </xsl:copy>
    </xsl:template>
Suresh Tadisetty
  • 300
  • 1
  • 2
  • 8
  • Can you provide a sample of the TXT file to demonstrate the format (i.e. CSV, one entry per line, etc). Also, can you use XSLT 2.0? – Mads Hansen Sep 09 '13 at 00:18
  • my .txt file contain list of binaries like binaryOne.dll binaryTwo.dll binaryThree.dll Great, if I could do this with 1.0 itself, if no way, will move to 2.0. – Suresh Tadisetty Sep 09 '13 at 10:52
  • apologies i'm new here, didn't know formatting syntax. binaryOne/Two/Three are seperated by new lines. – Suresh Tadisetty Sep 09 '13 at 11:01

1 Answers1

0

Heat does not have the functionality to read a file to gather a list of files for harvesting. You'll need your build process to do this for you.

One strategy you might try is to harvest 10 times, once per file. In a batch file, you can use the for command to execute heat for each line in your text file:

for /f "delims=" %%F IN (filelist.txt) DO heat file "%%F" -ag -template:fragment -out "%%F.wxs"

Then when you run candle, first concatenate all your filenames and pass them as an argument to candle:

for /f "delims=" %%F IN (filelist.txt) DO set FILELIST=%FILELIST% "%%F.wxs"

candle ... normalfile1.wxs normalfile2.wxs %FILELIST% ...
Stephen Jennings
  • 12,494
  • 5
  • 47
  • 66