"Service failed to start - Verify that you have sufficient privileges to start system services"



当我尝试运行我在WIX中创建的安装程序时,出现以下错误消息:

"服务'报表生成器服务'(报表生成器服务)启动失败。验证您是否有足够的权限来启动系统服务"。

我已经在这里读了一些关于我的代码几乎相同的博客,但这个错误仍然不断弹出。奇怪的是,当我第一次用下面几乎相同的代码创建这个安装程序时,这个错误在安装过程中没有发生。请帮帮我,伙计们,我迷路了…(

<File Id="ReportGenerator.exe"
                                Name="ReportGenerator.exe"
                                Source="..ReportGeneratorbinReleaseReportGenerator.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" />

如果您的服务依赖于安装到GAC中的程序集,您将无法使用ServiceControl启动它。GAC程序集在提交安装之前是不存在的,这对于ServiceControl来说已经太晚了。

如果服务帐户没有"作为服务登录"权限,也可能发生此错误。要修复这个

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

我在这里提到这个,因为谷歌搜索上面的错误在第一页列出了这个链接。

相关内容

最新更新