VS 2010 MSI安装程序安装/卸载Windows服务 [英] VS 2010 MSI Setup Install/Uninstall Windows Service
问题描述
我在VS2010中创建了VS安装程序。它适用于初始安装。
Hi,
I have created VS installer in VS2010. it works fine for initial installation.
ProcessInstaller1 = new ServiceProcessInstaller();
ServiceInstaller1 = new ServiceInstaller();
ProcessInstaller1.Account = ServiceAccount.LocalSystem;
ProcessInstaller1.Username = null;
ProcessInstaller1.Password = null;
ServiceInstaller1.StartType = ServiceStartMode.Manual;
ServiceInstaller1.ServiceName = "MonService";
Installers.Add(ServiceInstaller1);
Installers.Add(ProcessInstaller1);
我已将属性RemovePrevousVersions和DetectNewerInstalledVersion设置为true。并且还使用新版本更改版本。产品代码也在变化。
程序集版本和文件名也改变了。
当我尝试运行新的MSI时,它开始安装首先卸载然后提及错误代码1001:服务已经存在
任何建议和帮助,以便我可以实现我的目标。
提前致谢。
I have set properties RemovePrevousVersions and DetectNewerInstalledVersion to true. and also changing version with new build. product code also changing.
Assembly version and file name changed too.
When I try to run fresh MSI, it is starting installation rather uninstallation first and then mentioning "Error Code 1001: The service already exists"
Any Suggestion and Help so that i can achieve my goal.
Thanks in advance.
推荐答案
尝试从命令提示符下删除服务,然后重新安装。
确保以管理员身份打开命令提示符(run - > cmd)。
Try deleting the service from command prompt and then reinstalling.
Make sure that you have opened the command prompt (run-->cmd) as Administrator.
SC DELETE your_service_name
注意:如果服务名称中有空格,请尝试
Note: if you have blank spaces in the service name, try
SC DELETE "your_service_name"
希望,它有帮助:)
Hope, it helps :)
这篇关于VS 2010 MSI安装程序安装/卸载Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!