I'm doing a windows service setup project on VS2008, it has a custom action for setting app.config values. The setup work fine installing the service and setting the app.config values but when I try to uninstall the service, it removes the files but keep the service registered, so I can install it again using the setup, I need to use "sc delete " in the vs command prompt to proper remove the service... anyone have any idea which could be the issue here?
Thank you.
I'm not sure whether you still have this issue or not, but still giving answer so that it helps others.
Use installer component along with your windows service and override OnBeforeUninstall method and write your own code to unregister the service, such as below
{frameworkpath}\InstallUtil.exe /u <serviceinstalledpath>
This should uninstall your service