24

I'm trying to create an installer for a Windows Service I developed. This installer has a custom UI at one point and it's the first time I do something like that so I installed and uninstalled the service a few times to make sure everything was like I wanted to in the installer.

Now my issue is that when I try to install the service, it fails with Error 1001: Specified service already exists, but the service is listed nowhere in the registry, the services.msc console, or by sc query.

Can anyone give me a clue of what's happening and how to fix it? Thank you

Edit: Thanks for your replies. I re-opened the management console and restarted the computer and am still getting the error. Changing the ProductCode and UpgradeCode did not fix the issue either. There's also absolutely no reference to the service in the registry.

1
  • Did you try to re-register msiexec before running the installer?msiexec /regserver Apr 8, 2011 at 18:19

4 Answers 4

28

Run in command line (adm mode):

sc delete service_name

Service names with spaces must be quoted.

Update: Try this:

sc query type= service > services.txt

and verify that the service does not appear with another name.

3
  • I know SC DELETE and tried it but it didn't change a thing. The service is not listed anywhere (not even by SC)
    – anthonyvd
    Apr 8, 2011 at 18:40
  • I had changed the name of my service so I had one stuck in there that didn't exist so this finally cleared mine up.
    – DoomVroom
    Feb 5, 2016 at 17:27
  • 1
    Make sure you run your cmd in admin mode Aug 9, 2016 at 9:41
4

if you try to remove a service when it's still running, it's marked as deleted so you won't see it in the list of services but any attempt to add a service with the same name will fail afterward. the easy solution is to restart. this way windows removes the service before login or you can remove it from Registry in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

be careful with that

4

Some time when we install windows service from setup then also problem arises like we can not uninstall. here i will discuss few steps which solve this problem to remove install application entry from Add/Remove panel and again we can install the same application.

Open registry by Regedit and To locate the program's uninstall key, navigate to the following sub-folder:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

select Uninstall icon and start find your program by name. when it will appear then just remove that entry from registry. after remove the program name will not display in Add/Remove. problem will be solved and again user can install the same application. i got this tips from this location http://eugene2k.hubpages.com/hub/How-to-force-uninstall-a-program and i tested and it worked.

The below steps is for how to remove services when service is not starting or file missing or corrupted.

1- Open cmd as administrator

sc delete servicename

2- open run > regedit , back it up first and then browse to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services

and delete the service key

3- remove the folder where win service was installed

4- reboot the machine

1

http://www.winvistatips.com/windows-service-wont-uninstall-t535569.html

Have you closed and re-opened the management console? Also restarting your comp might help. Sometimes a service gets marked for uninstall and doesn't really finish until one of the two things listed above happen.

This has happened to me before and generally one of these two things fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.