A better installer

So about a month and a half ago, I was driving home from work one day after working on some NSIS installer code (which in my humble opinion is very ugly and hard to work with), when I had the thought “How come no one uses managed code to write installers?”. Managed code is so much cleaner to read, and the .NET framework is so powerful. Most of the time we’re just copying files, writing registries, and running some msiexec anyways right? nothing managed code can’t handle.

So I did a little bit of googling and then found this amazing new beta release of WiX 3.6. In the beta release there is a new bootstrapper/downloader module named Burn which allows you to chain multiple MSIs together (something WiX was lacking for a very long time), download packages online, and use managed code to create the bootstrapper interface. After reading about the features here and trying out the Visual Studios 11 Preview installer, I was pretty convinced to give it a shot.

After using Burn for a while, I can say that there are some clear advantages with using managed code to write a bootstrapper. The first advantage is that it allows you to streamline your interface in so many different ways… for example, you don’t have to create a page where you “accept the license agreements” anymore, since most people don’t read that anyways. It also lets you create an experience where the novice users can simply click an install button, without having to select all the customization options.

Another advantage is that you can use all the features of Windows Forms and WPF to create your interface. So this allows you to use all types of different controls and animations to create a much better looking user interface.

There are disadvantages of using a managed bootstrapper though, because it requires that the user has the .NET framework installed on their computer. Thankfully, Burn also handles that for you. When Burn fails to run the managed bootstrapper, it will run a separate bootstrapper to install the .NET framework first. Following that, it will run your own installer.

Some more disadvantages of using Burn right now, is that there is almost no documentation, and that there are still some bugs in the framework. In terms of the documentation, you really have to be prepared to do a lot of googling to find the answers that you’re looking for. Sometimes, I had to dig through the open source C++ code to get a better understanding of how the Burn engine works.

For those that want to give the toolset a try, here are some tips that I think will be helpful:
1) Read http://blogs.msdn.com/b/heaths/archive/2011/10/28/introducing-managed-bootstrapper-applications.aspx
2) Download the WiX source and take a look at the project stored in “wix36-sources\src\Setup\UX”. It contains the managed code that was used to create the WiX installer
3) Dig through http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/ when you need to find answers

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *