Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

c# - Service already exists (when it clearly doesn't)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...