Problem:While working on a custom Windows Service today I ran into a situation where I couldn't uninstall it (via the .msi, installutil /u, or "add/remove programs"). Countless installing/uninstalling lead to this but I had to get it off so that I could complete the task.
Solution:Delete the registry key associated with it
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/[service name]
Note:
This is and should be used as a "last resort" for removing a service if
all of the below options don't work:
- InstallUtil /u [service name] fails.
- The .msi setup package cannot "remove" it.
- "add/remove programs" fails to remove the service as well.
Also, You'll have to reboot for list to update in the Service Control Manager (SCM).