Reputation: 18411
I have a WiX script, that does installation of service. I have following ServiceInstall
element under Component
.
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes"
Name="abc" DisplayName="abc service"
Description="It does this" Start="auto"
Account="LocalSystem" ErrorControl="normal" Interactive="no">
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
</ServiceInstall>
And as seen from the code, I am using ServiceConfig
with DelayedAutoStart
flag to set the service to start in delayed auto start mode. However the WiX compiler (candle.exe
) triggers a warning:
warning CNDL1150: ServiceConfig functionality is documented in the Windows Installer SDK to "not [work] as expected." Consider replacing ServiceConfig with the WixUtilExtension ServiceConfig element.
Hence, I tried using util:ServiceConfig
^, however this element doesn't have any attribute to control service startup.
^ Namespace import:
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
Hence, the questions are simply:
Upvotes: 4
Views: 3406
Reputation: 54
Yes the vanilla ServiceConfigworks , Infact i am using both ServiceConfig,(from utils and from wix) inside a service
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart"
RestartServiceDelayInSeconds="0"
/>
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
Upvotes: 0
Reputation: 1671
After checking the source it does not seem possible at the moment. Wix calls the ChangeServiceConfig2 function only with the SERVICE_CONFIG_FAILURE_ACTIONS
parameter and not with SERVICE_CONFIG_DELAYED_AUTO_START_INFO
.
If I was you, I'd write a custom action calling sc config abc start=delayed-auto
in a CMD.
As for your second question add VersionNT version condition (VersionNT >= 600
for all version greater than Vista)
Upvotes: 7