Search code examples
wixheat

HeatDirectory to harvest only root level files


Is there a way to direct HeatDirectory task in my wixproj to harvest only files at the root level and not to dive into any sub-directories? For sure I can handle it running XSL transform on the output file, but I would prefer a cleaner way. If there is no way then I'd appreciate if anyone has a clean example of XSL transform snippet to handle it (will save me time at least). Thanks a lot :)


Solution

  • XSLT seems to be the most suitable way. A couple of other solutions are mentioned here: How to exclude files in Wix toolset, like making a copy of files to harvest or using external opensource app.

    Also Wix has commercial expansion pack with more powerful replacement of heat.exe, which can exclude files and folder, use masks: https://www.firegiant.com/wix/wep-documentation/harvesting/harvestfolder/