如何在WiX安装程序中更改Windows服务启动类型 [英] How to change the Windows service startup type in a WiX installer
本文介绍了如何在WiX安装程序中更改Windows服务启动类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们需要将Windows服务的启动类型从自动"修改为自动延迟启动".我该怎么做?
We need to modify the Startup type of our Windows service from "Automatic" to "Automatic Delayed Start". How do I do this?
我的代码是这样的:
<ServiceInstall
Id="WinServiceInstall"
Name="ServiceManager"
DisplayName="ServiceManager"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Vital ='yes'
Description ='Monitoring and running the jobs'
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]">
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType ="restart"
cRestartServiceDelayInSeconds ="10" />
</ServiceInstall>
如何设置重启服务时间?如果出现故障,我想在2分钟后设置重启服务.
And how do I set the Restart service time? I would like to set Restart service after 2 minutes if failed.
推荐答案
放置 ServiceConfig
元素.
Place a ServiceConfig
element within the ServiceInstall
element.
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
这篇关于如何在WiX安装程序中更改Windows服务启动类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文