开发者

Repair setup project throws Error 1001: "The specified service already exists"

The repair function for a setup project is basically a re-install, but because of my custom Install/Commit/Rollback/Uninstall action to manage a Windows service, my repair fails because the service already exists when the r开发者_C百科epair function is called.

The setup project should first remove the service before repairing it. I am already injecting custom actions via using System.Configuration.Install, so it should be possible.

How do I instruct the repair function to first remove the service?


if you are looking for a quick solution, then you can always delete the service manually in the custom action.

Create a new process to the call the "sc.exe" with the parameters as below:

sc.exe delete [service name]

of course, you will require some exception handling in here to check if the service already exists or not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜