Upgrade a Windows Service without Uninstalling

后端 未结 6 922
抹茶落季
抹茶落季 2020-12-04 18:08

Currently I have to uninstall the old version of my service before I install the new version. I am pretty sure this has something to do with it not being smart enough to upd

6条回答
  •  再見小時候
    2020-12-04 18:44

    Use sc tool from a command line to stop and start the service:

    sc stop {name of your service}
    sc start {name of your service}
    

    When the service is stopped, update the corresponding files and then start the service again. You should be able to do that from your installer as well. If you use Wix for your installer, then take a look at ServiceControl element.

提交回复
热议问题