New favorite deployment method


This post was originally published here.

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</ul> Pros

        • 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</ul> Cons
                • 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</ul> Here’s what my final ZIP file looks like:

                        • Product-Dist.zip

                          • Product.zip (zipped up application)
                            • Tools
                              • NAnt
                                • NUnit</ul>
                                • install.build
                                  • Install.bat
                                    • Uninstall.bat
                                      • Go.bat</ul> </ul> 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.
Agile cheat sheet