service - 在 WiX 安装程序中设置服务启动类型

标签 service wix windows-installer

我正在尝试使用 WiX 将预安装服务的启动类型设置为自动。另一项任务是在安装时启动服务,我是通过以下方式实现的:

<ServiceControl 
    Id="ServiceRunningState" 
    Name="[Service Name]" 
    Start="install"
    Stop="install"
    Wait="yes" /> 

现在我还想设置启动类型。我已尝试以下操作(请参阅 answer ):

<ServiceConfig
    Id="ServiceStartup" 
    ServiceName="[Service Name]"
    DelayedAutoStart="yes"
    OnInstall="yes" 
    OnReinstall="yes" />

但这并没有改变服务的启动类型(从手动启动类型测试)。此外,我希望启动类型为“自动”,而不是“自动(延迟启动)”。

请注意,我正在尝试修改现有服务,因此没有 ServiceInstall 元素。

这两个元素(ServiceControlServiceConfig)是 Component 父元素中的子元素。

感谢任何帮助:)

最佳答案

MSI 不支持更改软件包未安装的服务的启动类型。 服务配置 doesn't let you get around that :

Applies only to installed auto-start services or services installed by this package with SERVICE_AUTO_START in the StartType field of the ServiceInstall table.

关于service - 在 WiX 安装程序中设置服务启动类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47630422/

相关文章:

android - 基于 Google I/O Android REST 客户端应用建议的 REST 调用是否太复杂

service - AngularJS - 调用 query() 后立即获取数据

windows - Windowsinstaller 中的 Autogen guid (*) 导致 ICE08 错误

c# - 检索存储在 msi 中的应用程序的程序集版本

windows - WIX 工具集 - 自定义操作命令无法正确检测 Windows 10 版本

windows - WiX 安装程序 : How to switch to repair-mode if already installed?

ubuntu - 在 Ubuntu 上通过 Ansible 将 Java Jar 作为服务运行

c# - 调用 WCF 服务时如何触发事件(客户端)

c# - 错误 0x8007000b : Failed to create the managed bootstrapper application

c# - INSTALLLEVEL 不安装功能