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>
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:Then when you run candle, first concatenate all your filenames and pass them as an argument to candle: