I've been using the HeatDirectory task in our WiX installer project in the BeforeBuild target to harvest the files of a web application we deploy on the clients network. Been working great.
I now want to deploy a second set of files, which so happens to be some documentation, and it contains files that are of the same name that exist in the previous HeatDirectory output.
I get the following error:
LGHT0293: Multiple files with ID 'Web.Config' exist.
I understand why I am getting the error, I'm wondering how best to resolve it.
Option A:
Copy all the files into a directory and run heat on them in one massive pass.
I like this because it would be fairly easy to implement using stock MSBuild tasks. I dislike it because it would create one massive ComponentGroup and if I ever decided to make optional features (like not install something), I can't.
Option B:
Iterate over the output file of the HeatDirectory task and append a suffix on all the Component ID and File Id's. Example - web.config would become web.config_DocumenationFiles
I like this because it's clean; i.e. I can delete it later or add it to a project that's having the issue and not add it to projects that don't. I dislike it because I'm not sure what 'process' (or MSBuild task) is capable of doing this. I need a custom task I think.
Other Options: ?
Ideas?
I see someone has come along and upvoted this three years later. I thought I'd come back and state that I'm still using Option B, a custom MSBuild task to resolve the issue.
I made a comment on another post about the issue with more details and thought I'd move/copy my implementation over here in case it's helpful.
I had solved it by creating a custom build task to run after the HeatDirectory task to append a suffix to the Id attribute.
The AddSuffixToHeatDirectory task is as such
Hope that helps. I'm still using this method today and I've not done the legwork to look into a Transform or extending HeatDirectory.