Make sure features are always enabled so they can be removed

The WiX installer had a bug that I noticed during our transition from Visual Studio 2005 to Visual Studio 2008. If you had the Votive feature installed for VS2005 and VS2008, then uninstalled VS2005, the Votive feature was "orphaned" and couldn’t be uninstalled. The cause is that the Votive features are enabled only when the corresponding version of Visual Studio is installed. (The Feature/@Level attribute is 0 with a Condition child element to enable it.) MSI sees the feature as disabled in maintenance mode and won’t remove it.

Oops.

The solution is easy, though: Add OR REMOVE to the condition that enables the feature. That ensures the feature is enabled during whole-product uninstall or an attempt to remove that particular feature.

Posted in WiX, Windows Installer at May 16th, 2008. Trackback URI: trackback
Tags:

2 Responses to “Make sure features are always enabled so they can be removed”

  1. May 16th, 2008 at 13:49 #ShayEr

    I smell a new ICE on it’s way…

  2. May 16th, 2008 at 14:22 #Bob Arnson

    Yeah, I’d like to do more checks like that in the linker (or a linker extension) rather than ICEs. That said, covering all the different combinations of condition expressions and features -v- levels isn’t trivial.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>