Saturday, September 23rd, 2006

Moving to WiX

NUnit has finally gotten rid of it’s Visual Studio Install projects in favor of WiX

VS projects support only a simple, single-feature install. What’s more, if you outgrow your install project, you can’t simply migrate it to another tool. You have to start over with the new tool. It would be cool if VS could use WiX syntax as it’s internal format, but I suspect that’s not likely to happen since it would tie future development of the two together in some ways that would probably discomfit both WiX and Visual Studio. But an open source converter from the vdproj format to WiX would definitely be a cool thing!

One side effect of this change is that users of C# Express can now load and build the entire NUnit solution. I’m hoping this will gain us a few volunteers.

Jamie Cansdale – of NUnit Addin and TD.Net fame – did the initial implementation of the WiX scripts and I made additional changes and figured out how to use the the NAnt tasks so it could be made part of our standard build.

It’s unfortunate that the WiX tasks for NAnt come without documentation. By reading the source, I was able to construct the commands I listed below, which I’m posting in the hope that they will be of help to somebody.

<candle out="${wix.work.dir}/" exedir="${wix.dir}">
    <define name="ProductVersion" value="${package.version}" />
  <sources basedir="${project.install.dir}">
    <nclude name="bin.wxs" />
    <include name="nunit-gui.wxs" />
    <include name="doc.wxs" />
    <include name="tests.wxs" />
    <include name="samples.wxs" />
    <include name="NUnit.wxs" />

<light exedir="${wix.dir}"
    <include name="${wix.work.dir}/NUnit.wixobj" />
    <include name="${wix.work.dir}/bin.wixobj" />
    <include name="${wix.work.dir}/nunit-gui.wixobj" />
    <include name="${wix.work.dir}/doc.wixobj" />
    <include name="${wix.work.dir}/samples.wixobj" />
    <include name="${wix.work.dir}/tests.wixobj" />
    <include name="${wix.dir}/wixui.wixlib" />

You’ll find our WiX scripts in the latest version of the NUnit source on SourceForge.