Friday, October 8, 2010

What about that WiX?

Summary: Reflections from my first encounter with Windows Installer XML (WiX).
This is post #1 of the six-part Learning WiX series. For other topics, see:

Table of contents
  1. Background (why WiX?)
  2. Introduction (answers to common questions)
  3. Getting started (references and tutorials)
  4. How-to's and missing links
  5. Slides and demo projects
  6. Improved demo projects (32- and 64-bit installers)
There comes a time in every Windows programmer's life to face WiX (Windows Installer XML). For me this time came with the news of Microsoft's plan to retire Visual Studio Installer in favor of InstallShield Limited Edition. So I spent the last couple of weeks getting to know WiX and using it to implement installers for several production applications. This is what I learned.

Good news: (1) WiX Toolset let me create installers that were on par with installers I used to build in the good ol' pre-Windows Installer days. (2) I did not have a panic attack when I opened the WiX-generated MSI files in Orca (WiX seem to produce less garbage than say Visual Studio Installer). (3) It took relatively few lines of XML code to build an installer that handled deployment of a Windows service, COM object registration, desktop and shortcut menu creation, invocation of a configuration utility, and typical user interface (setup wizard).

Unfortunately, I cannot say that my transition to WiX was seamless. WiX Toolset has a few limitations. To be fair, some of these limitations are caused by idiosyncrasies imposed by Windows Installer (MSI), but some are native to WiX (e.g. it seems impossible to use the recommended type of custom action when invoking an executable from a merge module). WiX tools sometimes lack features (e.g. it's relatively easy to extract COM registration information from a COM DLL, but there is absolutely no way to do it from a COM executable). There are bugs (probably not as obnoxious as InstallShield bugs, but still). Project documentation and information is skimpy and somewhat confusing (why is the project split between SourceForge and CodePlex? how long should it take a WiX novice to figure out what and how to download the toolkit? why is it called Votive? and why is "i" in "WiX" lower case?) And the WiX learning curve is rather steep, especially for those who have not been intimate with Windows Installer (MSI).

One good -- and bad -- thing about WiX is that it's an open-source project. On the positive side, WiX has a momentum now both inside and outside of Microsoft. On the other hand, it's not clear if, or how long, Microsoft's backing of the project will continue (say, Microsoft strikes another back room deal [I'm speculating here] with Flexera [the InstallShield maker] and withdraws all support from WiX).

As long as you are looking for alternatives, here is a list of commercial products that can help you build MSI-based installers:
Some of these are more popular than others (popularity is often an indicator of the size of the marketing budget than product quality), but I haven't use them to extent of recommending one over the other. [I used to be a huge fan of InstallShield in the late 90's, but after the InstallShield 7 migration fiasco (3 months wasted on a failed attempt to convert a complex InstallShield 6.x project to InstallShield 7, mostly due to bugs in the product) I would not want to re-live the pain.] So for the time being I will stick with WiX.

If you are interested in WiX, read my subsequent posts. I will share (time permits) the things that helped me get started. Here is the outline of the upcoming WiX-related posts (I'll convert items to hyperlinks when the posts are ready):
  1. Introduction to WiX (FAQs for novices)
  2. Learning WiX from ground up (resources for WiX beginners)
  3. WiX how-tos and missing links (helpful how-tos and insights)
  4. Bonus: Presentation and demo projects
  5. Extra bonus: Build 32- and 64-bit installers using WiX (new and improved samples)
See also:
Choosing a Windows Installer Deployment Tool
Dude, where is your installer?
Rob Mensching Does Installations with the WiX Toolset (podcast, transcript)


Anonymous said...

I would add SharpSetup to the list of interesting applications. It is not an alternative to WiX but rather a support tool. It adds bootstrapper that allows you to select installation language and check prerequisites (by writing C++ code), but the most important feature is the ability to create GUI for your WiX installer in C# and WinForms. There are also other nice features like translation synchronization tool and adding multiple files with a few clicks.

Anonymous said...

And a link to SharpSetup site.

Alek Davis said...

Thanks Tomasz. I haven't used SharpSetup, so I can't comment on it, but I'll add a link for people to check out.

hasan said...

Thanks to Alek Davis!! I got an informative post on wix. I will visit next time to get more info.