Service Action

A Service Action executes a service-related action during installation and removal of your product.

Execution of a service action is controlled by its component. If the component is installed, the Install action is executed; if the component is removed, the Remove action is executed. If a service action is not linked to a component, the Install action is executed during installation of your product and the Remove action when the product is removed.

Note: Service actions only apply to Windows NT-based platforms (NT4, 2000, XP, 2003 and later). Moreover, they require that the installation is performed by a user with Administrator privileges. You can have the installer check for the required privileges by setting the Installation level attribute on the Installer options project page to Administrator.

Attributes

The following attributes and options are available.

Attribute Description
Service name Enter the name of the service that must be controlled. This may be a service that is installed by your product, or any other service that you know to be present on the target system.
Install action
Remove action

Select the desired installation or removal action from the drop-down list. The installation action is executed when the service control's component is installed; the removal action when the component is removed. If the service control is not linked to a component, the installation action is executed when the product as a whole is installed, and the removal action when the product is removed.

The actions are identical for installation and removal; the only difference is their relationship with the component installation or removal. The following actions are available:

Action Description
No action Don't perform any action.
Start Service Start the service. You can use this as an Install action to start services that were installed for your product.
Stop Service Stop the service. You can use this as an Install action to stop services that will be updated for your product, or as a Remove action to stop a service that will be removed.
Pause Service Pause the service if it is running.
Resume Service Resume the service if it was paused.
Delete Service Delete the service. You must add this service control action as a Remove action to remove services that were installed for your product.
Arguments Add any arguments that the service control action requires. This option only applies to the Start service action; none of the other actions require arguments. If you specify any arguments, they will be used both for the Install action and the Remove action.

Related topics

Service, Services, Working with attribute panes