3

I have a windows service on multiple clients that I constantly update manually. I'm trying to find a way of updating the service automatically either by a server call, or just checking for updates every day. The only thing that I really have to do is to download the new files, stop the service, replace the files and start the service again.

I found the Squirrel.Windows library that adds auto-updating for .Net apps, but I don´t know how can I implement it for a Windows Service. What would be the best option to tackle this problem?

edua_glz
  • 1,187
  • 1
  • 12
  • 22

1 Answers1

0

[...] service automatically either by a server call

I've used MSDeploy/WebDeploy using both the command line or from the Visual Studio publish UI command.

Check this other Q&A I've auto-answered it myself Generated *.SourceManifest doesn't include additional runCommand WebDeploy settings.

You can deploy the service executable and satellite assemblies and/or configuration files using regular MSDeploy and then execute a runCommand of some PowerShell or batch file somewhere in the server's file system (f.e. C:\deploy_service.cmd so you'll be able to update this and all servers running your Windows Services running a single MSDeploy command.

Community
  • 1
  • 1
Matías Fidemraizer
  • 59,064
  • 16
  • 107
  • 181
  • Correct me if I'm wrong, but isn't MSDeploy/WebDeploy used mostly for websites? The app that I'm developing is a desktop Windows Service that comunicates with my server, is there a way of using MSDeploy to deploy to all of my clients? – edua_glz Apr 08 '15 at 19:42
  • @edua_glz You can use not only to Web sites. The issue here is your clients should have an instance of IIS configured in their server machine, but once you've it, you deploy to a fake site and later you run an arbitrary command to move these files, install a service or whatever you think might aid in deploying the Windows service. – Matías Fidemraizer Apr 08 '15 at 20:09
  • @edua_glz I believe installing IIS is a small step and enabling WebDeploy on some site is also very easy. I mean, it's an initial effort that will save a lot of time in the medium and long term. What do you think? – Matías Fidemraizer Apr 08 '15 at 20:10