“服务无法启动 - 请验证您是否有足够的权限来启动系统服务”

发布于 2024-11-01 15:29:12 字数 1512 浏览 1 评论 0原文

当我尝试运行在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

菩提树下叶撕阳。 2024-11-08 15:29:12

如果您的服务依赖于安装到 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.

櫻之舞 2024-11-08 15:29:12

如果服务帐户没有“作为服务登录”权限,也可能会发生此错误。要修复此问题,

  • 请打开 SecPol.msc,
  • 导航到本地策略/用户权限分配,
  • 查找“作为服务登录”策略并添加服务帐户

我在这里提到这一点是因为 Google 搜索上述错误时会在其中列出此链接第一页。 :) 有人可能会发现这很有用

This error can also happen if the Service Account doesn't have "Log on as a service" permission. To fix this

  • Open SecPol.msc
  • Navigate to Local Policies/User Rights Assigment
  • Find "Log on as a service" policy and add the service account

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文