Uninstall Service that has been removed causes uninstall to end abnormally

Is there any way I can tell the deployment project to ignore the fact that my service is not there during uninstall?

I have a deployment project that installs/uninstalls a service along with other stuff. It does this via Custom Actions entries in the setup project and the ProjectInstaller class in the service project. Somehow the service is gone (how is not the issue here). When I uninstall the product via the Add/Remove Programs option, I get the message :
 An Exception occured while uninstalling ... The specified service does not exist as an installed service.
When I answer the message, the uninstall rolls back. Thus I cannot uninstall my product. Removing it manually is a big pain.

Thank you
Who is Participating?
surajgupthaConnect With a Mentor Commented:
How about trying to install the windows service using this method

and during uninstall try ignoring the failure in installing the windows service
So you are basically looking for a way by which it can uninstall the other stuff even though the service uninstall is unsuccessfull
MikeBroderickAuthor Commented:
No. I am looking for a way to tell it to not abend when it tries to delete a service that isnt there.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.