zho*_*ang 15 windows-services wix wix3.8
我正在创建一个MSI包,用于使用WiX v3.8安装和启动Windows服务.代码如下:
<Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes">
   <File Id="ApsService.exe"
         Name="ApsService.exe"
         Source="Resource\ApsService.exe"
         KeyPath="yes"
         Vital="yes"
         DiskId="1"></File>
   <ServiceInstall Id="ApsServiceInstaller"
                   Name="ApsService"
                   DisplayName="ApsService"
                   Type="ownProcess"
                   Start="auto"
                   ErrorControl="normal"
                   Description="A monitor service for windows application."
                   Account="[SERVICEACCOUNT]"
                   Password="[SERVICEPASSWORD]"
                   Vital="yes"
                   Interactive="no"></ServiceInstall>
    <ServiceControl Id="StartService"
                    Start="install"
                    Stop="both"
                    Remove="uninstall"
                    Name="ApsService"
                    Wait="yes"/>
</Component>
但安装失败,日志中出现以下错误:
Executing op: ServiceControl(,Name=ApsService,Action=1,Wait=1,)
StartServices: Service: ApsService
Error 1920. Service 'ApsService' (ApsService) failed to start. Verify that you have      sufficient privileges to start system services.
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3676 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1888 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1764 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3504 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 2100 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 2752 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3672 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3876 could not be cancelled. Error: 1168
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 1400 could not be cancelled. Error: 1168
MSI (s) (F0:C0) [15:57:28:630]: Product: WinApsSetup64 -- Error 1920. Service 'ApsService' (ApsService) failed to start. Verify that you have sufficient privileges to start system services.
我该如何修复错误?
Rob*_*ing 13
您收到的错误消息是Windows Installer在安装期间无法启动服务时发送的通用消息.问题几乎总是服务缺少依赖关系,或者在启动时没有完全配置.要调试root问题,请尝试:
如果这是用托管代码编写服务,确保它不依赖于文件被放置在GAC.在安装过程中非常非常晚,文件不在GAC中.如果必须使用GAC中的文件,则无法使用内置ServiceControl元素,并且必须编写自定义操作才能运行InstallFinalize.请注意,在InstallFinalize不提升自定义操作后,您的服务必须支持由非提升用户启动.我再次建议不要依赖GAC.
祝你好运调试你的服务!
在OP的示例中对ServiceInstall帐户进行了模糊处理,但如果忘记完全限定帐户,则会发生此错误,如下所示:
<ServiceInstall ... Account="NT AUTHORITY\LocalService" />
如果您只指定用户名(没有NT Authority),您的安装程序将失败:
<ServiceInstall ... Account="LocalService" />
| 归档时间: | 
 | 
| 查看次数: | 17314 次 | 
| 最近记录: |