Adding service dependencies
If your service requires that other services be started before it can function properly, you can use the ServiceDependency
element to add those services as dependencies. You'll place it inside the ServiceInstall
element. Here's an example that states that the DNS Client service, named Dnscache
, must be started before starting our Test Service:
<ServiceInstall
Id="InstallWindowsService1"
Name="testsvc"
DisplayName="Test Service"
Description="Test service for WiX"
Start="auto"
ErrorControl="normal"
Type="ownProcess">
<ServiceDependency Id="Dnscache" />
</ServiceInstall>
The ServiceDependency element's Id
attribute sets the name of the service to depend on. Now, Windows will make sure that the DNS Client service is started before the Test Service. You can add more ServiceDependency
elements for additional dependencies.
You can also set Id
to the Name of another ServiceInstall
element. That way, if you're installing two...