kentie.net

Wix Tips & Tricks

Wix is powerful, and I wouldn't recommend any other installation build system for serious projects. Infinitely customizable, scriptable, uses standard MSI files, doesn't cost anything and maybe best of all, integrates directly with Visual Studio. Both Wix itself and the MSI system it's built on introduce a number of quirks though, and the learning curve is pretty, pretty steep. And then there's learning the right mindset: one file per component, preferably added by hand. Here's some miscellaneous tips; nothing too advanced, but worth knowing all the same.

Project references

References to other projects in the solution are perhaps the single most important thing about using Wix, and what makes it so great to use. Adding a reference is simple:

refs1refs2

Projects you reference will be built with the installer, and in the same configuration (debug/release/whatever) too. Takes care of build order issues instantly.

And references have properties too! You can set Wix to automatically harvest files that belong to a project using HEAT. Could be useful if your project includes COM information HEAT is able to process, though I've mostly used HEAT from pre-build steps to harvest things such as a directory full of documentation files. Haven't had much luck using HEAT on self-registering native .exe servers, either.

refs3refs4

Anyway, each reference defines a number of variables you can use in your wxs files. In my case, I can now do things such as