Wix安装的Windows服务

时间:2012-10-30 18:07:05

标签: windows-services wix windows-server-2003

我正在使用WiX 3.6为Windows服务创建安装程序。我有解决方案构建,并且能够在我的开发机器上安装服务,服务就像我想要的那样启动。

当我将msi(Build或Release)复制到运行该服务的Windows Server 2003 R2计算机时,会出现问题。
我能够安装该服务,但是当我尝试启动该服务时出现错误

  

“服务无法启动。请确认您具有足够的权限   启动系统服务。“

现在我能够安装和启动我创建的其他服务,所以我现在拥有对服务器的权限。以下是我的服务安装元素。

我的问题是,我错过了什么服务在开发机器而不是服务器上启动?

   <File Id="CopyService.exe" Name="CopyService.exe" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
    <File Id="App.config" Name="CopyService.exe.config" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe.config" Vital="yes" KeyPath="no" DiskId="1"/>
      <ServiceInstall
               Id="ServiceInstaller"
                Type="ownProcess"
                Vital="yes"
                Name="ACSIAccountingReports"
                DisplayName="ACSI Accounting Reports"
                Description="Service copies accounting reports from NetForum into an ACSI network folder."
                Start="auto" 
                Account="LocalSystem"
                ErrorControl="ignore"          
                Interactive="no">
    </ServiceInstall>
    <ServiceControl Id="StartService" Name="ACSIAccountingReports" Start="install" Wait="yes" />
    <ServiceControl Id="StopService" Name="ACSIAccountingReports" Stop="both" Wait="yes" Remove="uninstall" />

1 个答案:

答案 0 :(得分:1)

您看到的错误消息是Windows Installer中针对所有服务安装失败的默认错误消息。它不是非常有帮助的。要调试真正的问题,请尝试再次启动服务,而错误对话框已启动。您可能会收到有关您的服务未启动的更详细错误消息。如果仍然没有得到任何结果,请尝试使用depends.exe或fuslogvw之类的工具(打开NETFX程序集加载失败),看看服务可执行文件是否有一些缺少的依赖项。

请记住,GAC文件直到安装结束才完成。因此,您的服务不能依赖于GAC文件,而是在安装过程中启动服务。