Reputation: 267320
I am reading about how you can create an .exe that will install a windows service to the server.
Say I already have the windows service installed and I want to perform an update. Is there a way for the installer to uninstall (stop the service, delete it, uninstall it) the currently running service and then install the updated version?
Upvotes: 0
Views: 990
Reputation: 42666
Don't be that drastic -- if possible, just stop the service, replace the files you need to, and then (optionally) restart the service.
If you delete the service from the SCM, you lose any post-install configuration done by the user -- custom logon credentials, the settings that dictate what to do when the service crashes, etc.
Upvotes: 3
Reputation: 42712
You shouldn't need to create an exe to do this, the "sc" command can uninstall, update, and install services on Windows for you. See:
If you still really want to do this by creating your own executable you certainly can, if you can let us know what language you're working in code samples can be provided.
Upvotes: 0