Windows服务 – 无法在WiX安装程序中安装和启动Windows服务
发布时间:2021-03-14 06:06:55 所属栏目:Windows 来源:网络整理
导读:我正在使用WiX v3.8创建一个安装和启动 Windows服务的MSI软件包.代码如下: Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes" File Id="ApsService.exe" Name="ApsService.exe" Source="ResourceApsService.exe"
|
我正在使用WiX v3.8创建一个安装和启动 Windows服务的MSI软件包.代码如下: <Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes">
<File Id="ApsService.exe"
Name="ApsService.exe"
Source="ResourceApsService.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. 如何解决错误? 您收到的错误消息是Windows Installer在安装期间无法启动服务时发送的通用消息.几乎总是出现这样的问题:服务在发生启动时缺少依赖关系或者没有完全配置.要调试根问题尝试:>安装MSI包. 如果这是以托管代码编写的服务,请确保它不依赖于放置在GAC中的文件.在安装过程中,非常非常迟的文件不在GAC中.如果您必须使用GAC中的文件,则无法使用内置的ServiceControl元素,并且必须编写一个自定义操作才能在InstallFinalize之后运行.请注意,在InstallFinalize之后,不会提升自定义操作,因此您的服务将不得不支持由非高层用户启动.再次,我建议不要依赖GAC. 祝你好运调试你的服务! (编辑:濮阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 安全研究人员特别喜爱的12款Linux发行版
- Windows10:如何通过几个简单的步骤修复损坏的cbs.log
- hyper-v-server-2012 – 在Hyper-V Server 2012 R2上正确删
- windows-server-2008 – Amazon EC2实例/卷的简单备份策略?
- Windows是否尝试查找IPv6 AAAA记录,即使它没有可路由的IPv6
- 查看一个归档或压缩文件的内容而无需解压它
- chgrp和newgrp命令简介
- 告别Windows 10越升越卡 Windows 10专业工作站版简单上手
- 2019年还用XP系统是怎样的体验?实际体验后发现已凉透
- Windows PC的合理维护计划是什么?
