Reputation: 1062
I have created the setup of window form application using visual studio setup project. It install fine and works fine my application.
But when i uninstall the application it uninstall properly without any error, but the service of the application does not remove from services.
I don't know why this happens.
Please somebody help me. thank you in advance.
Upvotes: 0
Views: 1204
Reputation:
I have a same issue in my application.
I just add the window restart code in installer class, so when i uninstall the application system restarts and application process & service both have removed.
Upvotes: 1
Reputation: 20780
There are a few possible reasons for this:
You did not add your installer class to every node of the custom actions list in your setup project. In other words, maybe there is no uninstall custom action so the service won't be uninstalled.
If there is an uninstall method, it will typically not stop your service unless you do that, by adding shutdown code to an override, before base.Uninstall(). That means it will attempt to uninstall it, probably mark it as Disabled in the services applet and remove it at the next reboot.
You might be using Installer classes (without using custom actions) and trying to run InstallUtil.exe. This is not the right way to do it, but if you didn't run it as uninstall custom action then you haven't uninstalled, and number 2 still applies. Finding InstallUtil.exe to do this is not safe anyway.
Having said that you still haven't been explicit about how you used installer classes, if they are custom actions, or if you're running InstallUtil.exe, if there is an uninstall custom action, and what is the exact state of the service after the uninstall.
Upvotes: 1