views:

396

answers:

3

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?

A: 

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.

Jay
+3  A: 

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.

Joe
A: 

Hi..I want to install my exe as an windows service..I did that using sc.exe...now I able to see my new service name in service.msc list..but when I try to start that am getting

Error:1053: The Service did not respond to the start or control request in a timely fashion

Timeout Error(30000 milliseconds).

My OS is windows 2000 and am in admin login..

As per google help, .Net Framework should be updated to latest version..but already am having version 2.

Plss..help to come out of this issue..I dont know what would be the problem....

Thanks in Advance, Malar