Gotcha | Windows Service reinstall

System.ComponentModel.Win32Exception: The specified service has been marked for deletion.

This is the first time I have ever seen this error and it may well have been complete luck that I haven't as there seems to be a pretty solid reason why it occurs.

It popped when I uninstalled a service using InstallUtil.exe, then tried to install again using the same utility.  Because I had the Windows Services window open (apparently it can also happen when you run uninstall without stopping the service as well, but seriously, who would be so reckless! ;-) ) when executing the uninstall there are some registry keys that are not deleted so when you try an install again the error occurs.

The simple solution was to close the windows services window and run uninstall/install again...Bingo!

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Sunday, April 27, 2008 7:09 PM

Feedback

# re: Gotcha | Windows Service reinstall

Left by Paul at 6/15/2009 4:06 PM
Gravatar Thanks, fixed my problem!

# re: Gotcha | Windows Service reinstall

Left by Robert at 10/28/2009 1:04 PM
Gravatar Fixed mine, too! Thanks!

# re: Gotcha | Windows Service reinstall

Left by Joanne at 11/18/2009 1:29 PM
Gravatar Hi, thanks! Fixed mine as well.

# re: Gotcha | Windows Service reinstall

Left by granadaCoder at 1/13/2010 5:35 AM
Gravatar All right. So apparent, yet so mysterious! Just keep the windows service window closed when installing/uninstalling. Go figure.

Thanks!

# re: Gotcha | Windows Service reinstall

Left by Sankar at 1/20/2010 6:51 PM
Gravatar Thanks a lot..Fixed my problem...

# re: Gotcha | Windows Service reinstall

Left by headboards at 1/21/2010 8:45 PM
Gravatar I'm having the same issue but having the services window doesn't appear to have any effect in Windows XP SP3.

However, deleting a service from the following key has helped me in the past:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

# re: Gotcha | Windows Service reinstall

Left by Matt at 3/22/2011 4:20 AM
Gravatar Thank you very much! Helped me clear my hurdle in Windows Server 2003!

# re: Gotcha | Windows Service reinstall

Left by Daniel at 3/24/2011 4:21 AM
Gravatar Holly shit, it was only that? thanks a lot

# re: Gotcha | Windows Service reinstall

Left by David at 8/9/2011 6:25 AM
Gravatar O!!!!!! M!!!!!!! G!!!!!!!!!!!! Finally, after years of searching it's Sys Internals Process Explorer!!! This has been driving me nuts, hate having to logoff/reboot. Thank you, thank you, thank you!!! Where do I send the check for 1000s???

# re: Gotcha | Windows Service reinstall

Left by Mike at 10/21/2011 1:55 AM
Gravatar Thanks! I've had reinstalled services many times with the Windows Services window open and never had that problem before...

# re: Gotcha | Windows Service reinstall

Left by Jason Nadal at 11/8/2011 1:41 AM
Gravatar Thanks for that tip; best part of this, no need to reboot even if the problem had already occurred... simply rerun your installer and you're good to go!

# re: Gotcha | Windows Service reinstall

Left by Priya at 1/12/2012 11:01 AM
Gravatar Thanks.. Solved mine too :-)))

Your comment:





 
 

Copyright © Steve Clements

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski