“服务无法启动 - 请验证您是否有足够的权限来启动系统服务”
当我尝试运行在 WIX 中创建的安装程序时,出现以下错误消息:
“服务‘报告生成器服务’(报告生成器服务)无法启动。请验证您是否有足够的权限来启动系统服务”。
我已经在这里阅读了一些关于此问题的博客,我的代码几乎相同,但仍然不断弹出此错误。奇怪的是,当我第一次使用与下面几乎相同的代码创建此安装程序时,在安装过程中并没有发生此错误。请帮助我,我迷路了......:(
<File Id="ReportGenerator.exe"
Name="ReportGenerator.exe"
Source="..\ReportGenerator\bin\Release\ReportGenerator.exe"
KeyPath="yes" />
<ServiceInstall Id="ReportGeneratorServiceInstaller"
Name="ReportGeneratorInstaller"
DisplayName="Report Generator Service"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Description="Generate Reports"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]" />
<ServiceControl Id="StartReportService"
Start="install"
Stop="both"
Remove="uninstall"
Name="ReportGeneratorInstaller"
Wait="yes" />
When I tried to run the installer that I created in WIX, the error message below occured:
"Service 'Report Generator Service' (Report Generator Service) failed to start. Verify that you have sufficient privileges to start system services".
I already read some blogs here about this by my codes are almost identical but still this error keeps popping out. The weird thing about this is that when I first created this installer with almost the same code as below, this error is not happening during installation. Please help me guys I'm lost... :(
<File Id="ReportGenerator.exe"
Name="ReportGenerator.exe"
Source="..\ReportGenerator\bin\Release\ReportGenerator.exe"
KeyPath="yes" />
<ServiceInstall Id="ReportGeneratorServiceInstaller"
Name="ReportGeneratorInstaller"
DisplayName="Report Generator Service"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Description="Generate Reports"
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]" />
<ServiceControl Id="StartReportService"
Start="install"
Stop="both"
Remove="uninstall"
Name="ReportGeneratorInstaller"
Wait="yes" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的服务依赖于安装到 GAC 中的程序集,您将无法使用 ServiceControl 启动它。在提交安装之前,GAC 的程序集不会出现,这对于 ServiceControl 来说已经太晚了。
If your service relies on assemblies being installed into the GAC, you won't be able to start it using ServiceControl. GAC'd assemblies aren't present until the install is committed, which is too late for ServiceControl to work.
如果服务帐户没有“作为服务登录”权限,也可能会发生此错误。要修复此问题,
我在这里提到这一点是因为 Google 搜索上述错误时会在其中列出此链接第一页。 :) 有人可能会发现这很有用
This error can also happen if the Service Account doesn't have "Log on as a service" permission. To fix this
I'm mentioning this here because a Google search for the above error lists this link in the first page. :) someone might find this useful