1

I have somehow managed to half uninstall a windows service I was developing.

In no particular order

  • It won't delete if I use sc delete servicename

  • It gives an exception using installutil /u pathtoservice.exe

    "specified service does not exist as an installed service"

  • And using the installer/uninstaller obviously doesn't work either

  • It's no longer in the Services listing

  • It's not shown if I use sc query

  • And I have rebooted

I don't know what else to do, but something still exists, because attempting to install fails because it already exists.

Please help.

UPDATE:

...Could it be the stuff in the registry elsewhere?

HKEY_CLASSES_ROOT\Installer\Assemblies\D:|Program Files|[path to].exe

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\D:|Program Files|[path to].exe

HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache

HKEY_CLASSES_ROOT\Installer\Products...

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products...

etc...

3
  • stackoverflow.com/questions/197876/…
    – l0c0b0x
    May 20, 2010 at 15:13
  • @l0c0b0x, none of the three options given work, sc delete fails, delserv is the same, and the registry contains nothing under that key with the service name
    – CaffGeek
    May 20, 2010 at 15:21
  • What happens if you delete the key with the service name? May 20, 2010 at 15:25

2 Answers 2

1

I'd try downloading the sysinternals suite from Microsoft (free download) and run procmon and/or regmon and/or Filemon (although procmon is supposed to merge their functionality) and see where in the install process there's a fail or denied message and look there to hunt down why your installer thinks it's already installed. Hopefully it might give a clue as to what's going on.

2
  • I don't see anything, but I'm not sure what I'm looking for, I have 2810 events when running InstallUtil
    – CaffGeek
    May 20, 2010 at 15:44
  • Anything that says "denied" or "failed" as a result, or at the point where you have the failure towards the end of the program run you stop monitoring and see what is happening near the end of the trace, what the last files and keys were that were being accessed :-) May 20, 2010 at 15:55
1

Finally found a combination that worked.

  • UnInstall with InstallUtil /u

  • ReInstall with InstallUtil /i

  • Then uninstall with the SetupProject

If I tried to uninstall with InstallUtil, it wasn't right. If I tried to install with the Setup project it failed.

It was this specific combination that got everything into the correct state again so that I can use the setup project to once again install AND uninstall.

...not to self. Never hit cancel during the installation of a service again!

1
  • I had the same problem as you and this solved it for me too. You should consider marking this as the answer.
    – Chris
    Feb 14, 2011 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .