Skip to main content
Version: v3

ServiceControl Element

Description
Starts, stops, and removes services for parent Component. This element is used to control the state of a service installed by the MSI or MSM file by using the start, stop and remove attributes. For example, Start='install' Stop='both' Remove='uninstall' would mean: start the service on install, remove the service when the product is uninstalled, and stop the service both on install and uninstall.
Windows Installer references
ServiceControl Table
Parents
Component
Inner Text
None
Children
Sequence (min: 1, max: 1)
  1. ServiceArgument (min: 0, max: unbounded): Ordered list of arguments used when modifying services.
Attributes
NameTypeDescriptionRequired
IdString Yes
NameStringName of the service.Yes
RemoveInstallUninstallType Specifies whether the service should be removed by the DeleteServices action on install, uninstall or both. For 'install', the service will be removed only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource); for 'uninstall', the service will be removed only when the parent component is being removed (msiInstallStateAbsent); for 'both', the service will be removed in both cases.  
StartInstallUninstallType Specifies whether the service should be started by the StartServices action on install, uninstall or both. For 'install', the service will be started only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource); for 'uninstall', the service will be started only when the parent component is being removed (msiInstallStateAbsent); for 'both', the service will be started in both cases.  
StopInstallUninstallType Specifies whether the service should be stopped by the StopServices action on install, uninstall or both. For 'install', the service will be stopped only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource); for 'uninstall', the service will be stopped only when the parent component is being removed (msiInstallStateAbsent); for 'both', the service will be stopped in both cases.  
WaitYesNoTypeSpecifies whether or not to wait for the service to complete before continuing. The default is 'yes'. 
See Also
Wix Schema