Friday, September 21, 2007

New favorite deployment method

Having run into so many crazy errors from installing MSI's, I've settled on a new favorite deployment mechanism: NAnt (or MSBuild).  Here's how it works:

  • Package application and build scripts into one ZIP file
  • Package any tools needed for the build (NAnt, NUnit, etc.)
  • Package a bootstrapper batch file that calls NAnt and your build file with the appropriate targets
  • Run the batch file


  • Install script can be the same script as run on a local dev box
  • Can package NAnt along with application, so no need to install any tools on their machine
  • More robust than XCopy deployment
  • Far fewer headaches than with MSI deployment
  • No need for proprietary scripting languages to do complex work, instead use open-source, standard tasks
    • No more Wise script or InstallScript


  • Not for commercial products
  • MSI's do take care of a lot of boilerplate tasks
  • MSI's have rollback and uninstall built in
    • Though with custom actions, still a pain
  • Nice UI
  • Familiar interface

Here's what my final ZIP file looks like:

    • (zipped up application)
    • Tools
      • NAnt
      • NUnit
    • Install.bat
    • Uninstall.bat
    • Go.bat

What's really cool is that the structure of the distribution zip file matches my local structure, so installing locally is the exact same as installing on a clean box.  Also, I can deploy NUnit and the tests, so I can run tests on deployed machines for some extra build verification.

No comments: