I have a custom Python package which we are installing to several Windows platforms (XP, 2003, 2008). During setup, this command is run which registers a service:
python.exe setup.py install
What is the correct way to remove services created this way? I know that I can use sc.exe but should be a last resort.
Have a look inside setup.py, there might be a listing of verbs, one of which can be "uninstall" or "remove"
python code is extremely easy to read
First, There should be no problem in removing the service with sc.
Also, Check in the add remove programs. Most packages that install in this way put entry in the add/remove programs in control panel.
Run the python.exe setup.py --help and see the output. or even just python.exe setup.py without any parameters. Most packeges will print uninstall information.
Removing services using sc.exe is perfectly fine and supported.
Running
python.exe setup.py remove
worked for me. Note that I had to run from an Adminstrator's Command Prompt to either install or remove the service.
Interact with services manager in cmd: (for help just type "sc" in cmd)