Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to update a Windows Service

How to update a Windows Service

Scheduled Pinned Locked Moved C#
csharpannouncementtutorialloungelearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Hansson
    wrote on last edited by
    #1

    Perhaps this should be in the general .NET forum, but what the heck. I've written a program, in C#, that runs as a service. I have done the installer so it will install the service on the system. However what I cannot figure out (and probably because paying for all this Microsoft software made me so broke I cannot afford the approriate book) is how to handle the case where the service is already installed when setup is being run. The installer will just say "Service is already installed" and rollback the entire installation. What I want to achive is that the executable for the service is updated and the service restarted. I figured maybe I could do a check to see if the service was installed, stop it and then delete it, before the installer installs the new version,but I can't seem to find a method to actually remove a service from the system either. Any pointers would be highly appreciated. /CMH

    X 1 Reply Last reply
    0
    • C Chris Hansson

      Perhaps this should be in the general .NET forum, but what the heck. I've written a program, in C#, that runs as a service. I have done the installer so it will install the service on the system. However what I cannot figure out (and probably because paying for all this Microsoft software made me so broke I cannot afford the approriate book) is how to handle the case where the service is already installed when setup is being run. The installer will just say "Service is already installed" and rollback the entire installation. What I want to achive is that the executable for the service is updated and the service restarted. I figured maybe I could do a check to see if the service was installed, stop it and then delete it, before the installer installs the new version,but I can't seem to find a method to actually remove a service from the system either. Any pointers would be highly appreciated. /CMH

      X Offline
      X Offline
      Xiangyang Liu
      wrote on last edited by
      #2

      This utility[^] helps you stop/uninstall/install/start any windows service. So you don't even need to create a service installer project with .NET. ;) Good luck. Click here to see my articles and software tools

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups