开发者

Automated Build and Deploy of Windows Services

开发者 https://www.devze.com 2022-12-11 05:55 出处:网络
How would you implement an automated build and deploy system for Windows services. Things to keep in mind:

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 machin开发者_StackOverflow中文版e.
  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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消