0

Problem with developing and testing a service installer: result, the service is 'installed' and appears as such in the Services tool, but does not start and I cannot 'uninstall' it in the conventional way (files missing).

So I used the SC tool to delete the service. Now if I try to reinstall it, the installer reports that the service is 'marked for deletion'.

How can I recover from this?

TIA

haughtonomous
  • 4,602
  • 11
  • 34
  • 52
  • 1
    Try to restart machine and service status should be cleared. – Konrad Kokosa Jan 14 '14 at 12:29
  • Yup, that did the trick. It's the old 'if all else fails, reboot Windows' feature. :-) – haughtonomous Jan 14 '14 at 14:40
  • Now I find that if I use the installer to install it (works) and then uninstall it, if I install the service a second time I get the same error. Is that normal? is there something I can do in the installer to ensure a 'clean' uninstall? – haughtonomous Jan 14 '14 at 15:28

2 Answers2

0

Restart machine and service status should be cleared. It is an old inconvenience I remember from .NET 2.0 and Windows XP times, that seems still not to be resolved.

Konrad Kokosa
  • 16,563
  • 2
  • 36
  • 58
0

It's nearly always an issue with some code somewhere on the system that has a handle open to the service and has leaked it. For example, the handle returned from the Win32 OpenService call, or somebody with a ServiceController class shutting it down and not doing a Close or Dispose. There used to be a bug in the services applet that caused this issue for this reason.

PhilDW
  • 20,260
  • 1
  • 18
  • 28