Using heat.exe, enable gac only specific list of binaries dynamically read from a .txt file

589 views Asked by At

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>
1

There are 1 answers

0
Stephen Jennings On

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% ...