views:

67

answers:

1

How would you implement an automated build and deploy system for Windows services. Things to keep in mind:

  1. The service will have to be stopped on the target machine.
  2. The service entry in the Windows registry might need to be created/updated.
  3. Some, but not all, of the services might need to be automatically started.

I am willing to use TFS for this, but it isn't a requirement. The target machines will always be development machines, we won't be doing this for production servers.

+2  A: 

The automated build part can be done in multiple ways - TFS, TeamCity (what we use), CruiseControl.NET, etc. That in turn could call a build script in NAnt (again, what we use), MSBuild, etc.

As for stopping and installing a service remotely, see How to create a Windows service by using Sc.exe. Note that you could shell/exec out to this from your build script if there isn't a built-in task. (I haven't tried this recently, so do a quick spike first to make sure it works in your environment.)

Alternately, it's probably possible (and likely elegant) in Windows PowerShell 2.0.

TrueWill