Service

A Service object represents a service for installation on the target system. Note that this is different from the installation of the service's executable program: that must be installed separately as a file. The Service object merely registers the executable program as a service on the target system.

Installation of a service is controlled partially by its component: if the component is installed, the service is installed. However, for compatibility with Windows Installer, if the component is removed the service is not automatically removed. Instead, you must create a separate Service Action action that has its Remove action set to Delete Service, and link this Service Action action to the service's component.

If the service is not linked to a component, it is installed when the product as a whole is installed. In that case, the corresponding Delete Service service control action should not be linked to a component either.

Tip: If you want to start the newly installed service after installation and stop it prior to removal, you must add an additional service control object with its Install action set to Start Service and its Remove action to Stop Service, linked to the same component as the service itself.

Note: Service installation only applies to Windows NT-based platforms (NT4, 2000, XP, 2003 and later). Moreover, it requires 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 created.
Type

Select the type of service from the drop-down list. The following choices are available:

Type Description
File System Driver The service is a file system driver.
Kernel Driver The service is a kernel driver.
Own Process The service runs in its own process.
Own Interactive The service runs in its own process and may interact with the desktop.
Shared Process The service runs in a process that is shared with other services (i.e., the service's executable program implements more than one service).
Shared Interactive The service runs in a process that is shared with other services (i.e., the service's executable program implements more than one service) and may interact with the desktop.
Display name Enter the user-visible name of the service; this field is localizable.
Description Enter the user-visible description of the service; this field is localizable.
Localized Check this box to localize the Description field and use different descriptions for different languages.
Executable file Enter the path of the file that implements the service, or click ... (browse) to open the Select Installation File or Folder dialog box that allows you to browse for the desired file.
Arguments

Enter the command line arguments for the service if the service requires them for an automatic start. Be sure to quote any arguments that contain spaces or may expand to contain spaces, for example: /p "<INSTALLDIR>\file.ext".

These arguments are used when the system starts the service automatically or on demand (see Start type); if you start the service with a Service Action Start Service action, the Service Action action can specify its own startup arguments.

Start type

Select how the service is started. The following choices are available:

Start type Description
Boot The service must be started by the system loader. This option is only valid for driver services.
System The service must be started by the Windows IoInitSystem function. This option is only valid for driver services.
Automatic The service must be started during system startup.
Automatic, delayed The service must be started during system startup, but with a short delay after all Automatic services have started. This option only has effect on Windows Vista and later; on earlier Windows versions, it behaves the same as Automatic.
Manual The service must be started when a process uses the Windows StartService function to start the service.
Disabled The service may not be started and any attempts to do so will fail.
Group

Enter the name of the load order group to which the service belongs, or leave empty if the service is not part of a group. If you specify a group name, the service will be started when its group is being loaded as determined by the registry value:

HKLM\System\CurrentControlSet\Control\ServiceGroupOrder

Depends on

Enter the semicolon-delimited list of services and service groups on which the current service depends for its startup. The service will be started if all explicitly named services and at least one service from each group are running. You must prefix group names with a plus ('+') character to distinguish them from service names, for example:

+Network;LanmanWorkstation;LanmanServer

Error control

Select how the system should respond if the service fails to start. The following choices are available:

Error control Description
Ignore Service startup errors are logged but otherwise ignored.
Normal Service startup errors are logged and a message box is shown, but the system continues with its startup process.
Severe Service startup errors are logged. If the last-known-good configuration is being started, the system continues with its startup process. Otherwise, the system is restarted with the last-known-good configuration.
Critical Service startup errors are logged. If the last-known-good configuration is being started, the system startup process fails. Otherwise, the system is restarted with the last-known-good configuration.
Start account

Select the name of the account under which the service must be started. The following choices are available:

Start account Description
LocalSystem Start the service under the LocalSystem account .\LocalSystem.
LocalService

Start the system under the LocalService account NT AUTHORITY\LocalService. This account has fewer privileges than the LocalSystem account and is therefore preferred from a security point of view.

Note: This account is only available under Windows XP and later.

NetworkService

Start the system under the LocalService account NT AUTHORITY\NetworkService. This account has fewer privileges than the LocalSystem account and is therefore preferred from a security point of view.

Note: This account is only available under Windows XP and later.

Other/Driver Name

For regular services: Start the service under the account name specified by Start name (below).

For driver services: Use Start name as the driver object name for the driver.

Start name If Start account is set to Other/Driver Name, enter the service's startup account name or its driver object name. An account name must have the format DomainName\UserName. To specify a user name in the local domain, use .\UserName.
Password

Enter the password for the Start name user account if it requires any, or leave blank otherwise.

Security warning: The password is stored unencrypted in the installer's database, which might pose a security risk.

Related topics

Service Action, Services, Working with attribute panes