Review: Windows Installer XML Toolkit

Windows Installer XML Toolkit
free
Microsoft
Redmond, Washington
sourceforge.net/projects/wix

There's been a fair amount of virtual ink spilled about the political implications of Microsoft releasing the Windows Installer XML Toolkit (otherwise known as WiX) as an open-source project. As far as I'm concerned, the implications are that there's an open-source project that originated inside of Microsoft; when you consider the amount of code that Microsoft has shipped out in samples over the years, that's hardly all that earthshaking. It's not like they've suddenly decided the Windows source code will be open to all comers or anything. Anyhow, political implications aside, what about the software?

As you probably know, the Windows Installer Service is the part of Windows that's responsible for installing and uninstalling software. Though software doesn't have to use this service as part of its setup process, I tend to think it's a good idea; the Installer Service provides a lot of services that are well-tested and flexible, from handling clean uninstalls to rollback in case of trouble to advertising and more. Building software that works with the Installer Service is a matter of constructing the proper setup package (.msi file). Most developers these days build their setup packages using one or another GUI tool. Visual Studio .NET setup projects are one example, while companies such as Wise and InstallShield provide much more complex and flexible alternatives.

What WiX brings to the table is an alternative way of building .msi files. Instead of starting with a graphical design process, WiX starts with an XML file that describes the structure of the .msi file. This file is run through command-line compiler and linker tools, and your .msi file pops out the other end, ready to install.

Why is this important? Because XML is so accessible to so many tools, and such a simple format, that using it as the base of your setup instantly opens up many automation prospects. You can, for example, imagine using command-line XML tools to automatically update the build number and EULA directly within the XML file, which could be stored in a source code control system. You could also pull out the list of files to be included from some other data source, and massage it easily into the right format. Having different people work on the same setup becomes a matter of merging text files. When you're all done, the build steps easily integrate into almost any larger build process that you can think of.

WiX is actually a fairly mature tool at this point, since it's been refined and used on multiple projects within Microsoft already. The documentation in the current builds is thorough when showing you what you can do with the XML schema, but a bit sketchy when it comes to practical examples. However, there's also a third command-line tool that can decompile an .msi file to a WiX source file. This opens up some interesting possibilities for synergy: use your existing setup authoring environment to come up with your setup, then move it over to the WiX process to automate it. All in all, this is a nice addition to the universe of setup tools for Windows, and it's free.

About the Author

Mike Gunderloy has been developing software for a quarter-century now, and writing about it for nearly as long. He walked away from a .NET development career in 2006 and has been a happy Rails user ever since. Mike blogs at A Fresh Cup.