NAnt, WiX and How to Build and Deploy a Utility Library


NAnt, WiX and How to Build and Deploy a Utility Library

barcamp_imageWell - on the off chance that I get enough votes at BarCamp in the morning... here's my presentation for BarCamp Bangkok 2.

A while back - and thanks mainly to an open source project created by Alexander Groß (a Now Playing Plugin for Windows Live Writer) I discovered the Windows Installer XML (WiX) project.  WiX is pretty cool. It's an XML script based compiler and linker that creates .MSI install packages. Because it's script and command-line driven - it fits well into automated build and deployment systems (using build tools like NAnt or MSBuild).

I've generally kept all my utility and helper classes in a separate solution, separated into namespaces for Strings, Data, Web, Math, Image helpers etc... all static classes (slowly being updated with extension method versions as well).

So for my demo at BarCamp - I've created a SampleUtils solution - with NAnt and WiX and a fairly well organized solution that shows how this can all be put together.

The solution layout looks like this... solution(screen shot to the right).

Again - if I get the chance. I'll do a quick run through of the NAnt build file (I've annotated the targets). And then a quick look at the WiX scripts. Demo the build process and then deploy the library using the installer - followed by a Console app that uses the library to make a few calls... (at least that's the plan).

Here are links to the source package for the demo (all lib and tools included so it will build as soon as you run build-release.bat) as well as the slide deck. (5.43MB) (61KB).

And here are the links at the end of the slide deck...

Wish me luck... :-)




Good luck T, I'm sure you won't need it. Wix is definitely a cool project and worth spreading the word. Don't forget to mention the WIX addin for Visual Studio, a really good selling point.

Cheers Dermot. I've installed Votive as well. Not sure yet - but if feels a little like we're headed back into Visual Studio to build - or at least creating a dependency between WiX and MSBuild. I think I prefer the clean WiX scripts that are build environment independent. Barcamp Bangkok day one was excellent - really good atmosphere and some interesting talks too.... will blog about it later.