【发布时间】:2015-08-16 14:10:56
【问题描述】:
Visual Studio 2015 RC 蜡 v3.10.0.1726
我正在为 Windows 服务创建安装程序。我已经使用 InstallUtil 测试了该服务,它运行良好。不幸的是,我在使用 wix 时遇到了一些问题,这是确切的错误 -
“服务‘服务名称’启动失败。请确认您有足够的权限来启动系统服务。”
现在我已将问题范围缩小到通过 WIX 启动服务。如果我放弃 ServiceControl 标记并使用 services.msc 手动启动它,它工作正常。
从其他问题看来,此错误是一般的 catch 错误,并且会在多种情况下发生。如果您的服务依赖于安装到 GAC(全局程序集缓存)的程序集,那么最受欢迎的是我也不清楚。我从不将任何内容隐式保存到 GAC,我的服务只是调用我编写的包含在项目中的 .cs 文件。
任何帮助将不胜感激!
<Component Id="ProductComponent7">
<File Source="$(var.ServiceName.TargetPath)" KeyPath="yes" Vital="yes"/>
<ServiceInstall Id="ServiceName.exe"
Account="LocalSystem"
Arguments="-start"
Type="ownProcess"
Name="ServiceName.exe"
DisplayName="ServiceName Service"
Description="sdfg"
Start="auto"
Interactive="yes"
ErrorControl="critical" />
<ServiceControl Id="ServiceControl" Name="ServiceName" Start="install" />
</Component>
我还在 ServiceControl 中尝试了各种不同的属性,最近我将它们全部删除以尝试使其尽可能简单。
如果有人有任何见解,那就太好了!
【问题讨论】:
-
您能否在启用详细日志记录的情况下运行安装程序:
msiexec /l*v Install.log /i YourInstallPackage.msi。在日志文件“Install.log”中搜索尝试服务控制的部分。可能有更多关于错误的信息。
标签: c# windows-services wix installation visual-studio-2015