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

Submitted on Aug 29, 2008, 9:01 a.m.

Well - 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...

(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.

UtilitiesSolution.zip (5.43MB)
BarCamp2_SlideDeck.zip (61KB).

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

http://nant.sourceforge.net/
http://wix.sourceforge.net/index.html
http://msdn.microsoft.com/en-us/library/aa367449(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa368047(VS.85).aspx
http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET
http://en.wikipedia.org/wiki/Daily_build

Wish me luck... :-)

 

Technorati tag: Barcampbangkok2