Recently I worked on a project where Windows application is delivered to the customer with Windows installer(.msi). Msi-file was created using the out-of-the-box Visual Studio Windows setup-project. The setup project was built whenever new .msi had to be delivered. The first time building the setup-project failed because some file was left out of the project, we decided it needs to be automated to be built daily.
Well, how does one automate building .msi-package? Surely all you have to do is set up a job on your CI-server that builds the setup-project, right? Well, no. I was quite shocked to find out you can't automate .msi-creation when using setup-project! Unless of course you install Visual Studio on your CI-server. And we weren't ready to stoop to that kind of madness yet.
After research I found out there is a tool called Windows Installer XML aka WiX. Which happen to be created by Microsoft and is apparently they use it in-house to create msi-packages. Wix uses "sexy" XML to define the files and behavior of your installer. It also lacks easy tutorials.
First I tried decompiling our existing msi with Dark-tool which is part of WiX. It seemed to create XML that is quite horrible even for XML. After that I started from scratch using WixEdit. It was a lot of help, but it's not very intuitive. Maybe because WiX is not intuitive. Because of the lack of intuitiveness I needed to do some XML editing by hand. The decompiled msi I had tried earlier proved to be a useful template for some specific stuff I had to do by hand.
It took me about day and a half, but eventually I got to the point where we could set up nightly build to run a rake task like this:
task :build_installer do
sh "Wix\bin\candle.exe Setup.wxs"
sh "Wix\bin\light.exe Setup.wixobj -ext WixUIExtension -ext WixNetFxExtension"
And we would have fresh installer waiting for us in the morning.