简体   繁体   中英

Windows Service Setup issue removing the windows service

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM