我正在尝试使用 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
元素。
这两个元素(ServiceControl
和 ServiceConfig
)是 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/