WiX FileGroup element considered evil
My previous post details a method to use WiX and NAnt to automatically generate MSI's as part of an automated build. I'm going to recommend that no one follow the part of that example that auto-generates the WiX XML. I'm going to blame my spam filter. Let me explain...
A while ago I subscribed to the WiX mailing list. Unfortunately my spam filter was routing all posts to my junk folder so I wasn't reading them. If I had been reading them I would have noticed a lively debate on the use of the <FileGroup> element and how it is generally considered to be evil-incarnate. So much so that Rob Mensching is talking about removing it from WiX altogether so no one is tempted to misuse it.
FileGroup makes it far too easy to violate Windows Installer Component Rules. The SourceForge WiX mailing lists are not archived yet, but there will be detailed explanations of why its dangerous in posts found in the wix-users list soon.
Once you have defined a component (a set of files), the Component ID (which is a GUID) must not change unless the contents of the component changes. The technique I laid out generated new Component IDs every single build.
The current direction members of the WiX list seem to be leaning involves having a tool to initially generate the WiX XML fragments, checking them in to your source control, and then hand-maintaining them as changes are needed. Although auto-generating each time is handy from a developer perspective because new files are magically picked up, it is a nightmare when it comes to installing upgrades.