Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Build Automation Using C#, Visual Studio, Source Safe, InstallShield and NullSoft Installer

0.00/5 (No votes)
14 Oct 2008 1  
Automating the Application Build Process
Sample Image - BuildMaster01.gif

Introduction

This application is written in C# using .NET Framework 1.1 and uses an XML file for configuration.

BuildMaster will do the following:

  • Gets latest source safe for the solution and each of its projects [Uses VSS Component Model].
  • Cleans the solutions if required.
  • Builds the solution using the EnvDTE objects exposed by Visual Studio.
  • Stamps each DLL and executable with the current version number.
  • Copies and moves files according to configuration settings to the target directories.
  • Applies Source Safe Label to solution using the current build number.
  • Creates the installation setup either using Installshield component object model and command line compiler or using Nullsoft command line compiler.
  • Moves the installation executable to the appropriate local or network locations according to configuration.
  • Emails all active recipients in the configuration file letting them know where to get the installation setup from.
  • In case of error, it notifies email recipients that are set up for notify on failure.
  • Email supports regular email and cell phone email or pagers.
  • Auto increment build number or manual override.
  • Provides visual feedback in list view of each action taken.
  • Writes each action to log file as designated in configuration.
  • Supports Release (actions are actually performed) or Debug (FAKE actions are not performed) mode.

Using the Code

This is intended to be used as an application on its own. You might have to make slight modifications, but the purpose is to keep it generic enough that most modifications are handled via the XML Configuration Settings.

Points of Interest

I used a delegate for the events to be sent to the form as the actions were being performed by the background threads. This keeps the UI alive and provides a nice visual feedback to the user.

You may contact me at jfranklin.pena@gmail.com.

History

  • 22nd September, 2005: BuildMaster Version 1.7.0.2100
  • 14th October, 2008: Updated the download for Visual Studio 2008

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here