ServiceInstall Table
[This is preliminary documentation and subject to change.]
The ServiceInstall table is used to install a service.
The ServiceInstall table has the following columns.
Columns
-
ServiceInstall
-
This is the primary key for the table.
-
Name
-
This column is the string that gives the service name to install. The string has a maximum length of 256 characters. The service control manager database preserves the case of the characters in the service name, but comparisons of service names are case insensitive. Forward-slash (/) and back-slash (\) are invalid service name characters.
-
DisplayName
-
This column is the string that user interface programs use to identify the service. The string has a maximum length of 256 characters. The service control manager preserves the case of the display name, but display name comparisons are case insensitive.
-
ServiceType
-
This column is a set of bit flags that specify the type of service. One of the following service types must be specified in this column.
Type of Service |
Value |
Description |
SERVICE_WIN32_OWN_PROCESS |
0x00000010 |
A Microsoft® Win32® service that runs its own process. |
SERVICE_WIN32_SHARE_PROCESS |
0x00000020 |
A Win32 service that shares a process. |
SERVICE_INTERACTIVE_PROCESS |
0x00000100 |
A Win32 service that interacts with the desktop. This value cannot be used alone and must be added to one of the two previous types. |
The following types of service are unsupported.
Type of Service |
Value |
Description |
SERVICE_KERNEL_DRIVER |
0x00000001 |
A driver service. |
SERVICE_FILE_SYSTEM_DRIVER |
0x00000002 |
A file system driver service. |
-
StartType
-
This column is a set of bit flags that specify when to start the service. One of the following types of service start must be specified in this column.
Type of Service Start |
Value |
Description |
SERVICE_AUTO_START |
0x00000002 |
A service start during startup of the system. |
SERVICE_DEMAND_START |
0x00000003 |
A service start when the service control manager calls the StartService function. |
The following types of service starts are valid only for driver services.
Type of Driver Service Start |
Value |
Description |
SERVICE_BOOT_START |
0x00000000 |
A device driver started by the operating system loader. |
SERVICE_SYSTEM_START |
0x00000001 |
A device driver started by calling the IoInitSystem function. Use this in the ServiceControl Table, with the StartServices action put after the InstallServices action, to start a driver service during an install. |
-
ErrorControl
-
This column specifies the action taken by the startup program if the service fails to start during startup. These values affect the ServiceControl StartService events for installed services. One of the following error control flags must be specified in this column.
Error Control Flag |
Value |
Startup Program's Action |
SERVICE_ERROR_IGNORE |
0x00000000 |
Logs the error and continues with the startup operation. |
SERVICE_ERROR_NORMAL |
0x00000001 |
Logs the error, displays a message box and continues the startup operation. |
SERVICE_ERROR_CRITICAL |
0x00000003 |
Logs the error if it is possible and the system is restarted with the last configuration known to be good. If the last-known-good configuration is being started, the startup operation fails. |
-
LoadOrderGroup
-
This column contains the string that names the load ordering group of which this service is a member. Specify NULL or an empty string if the service does not belong to a group.
-
Dependencies
-
This column is a list of names of services or load ordering groups that the system must start before this service. Separate names in the list by Nulls. If the service has no dependencies, then specify NULL or an empty string. Dependency on a group means that the service can run if at least one member of the group is running after an attempt to start all members of the group. Because services and service groups share the same name space, group names must have the prefix: SC_GROUP_IDENTIFIER.
-
StartName
-
The service will be logged on as the name given by the string in this column. If the service type is SERVICE_WIN32_OWN_PROCESS use an account name in the form: DomainName\UserName. If the account belongs to the built-in domain it is permitted to specify .\UserName. The LocalSystem account must be used if the type of service is SERVICE_WIN32_SHARE_PROCESS. The CreateService function uses the LocalSystem account if StartName is specified as NULL and most services will therefore leave this column blank.
-
Password
-
This string is the password to the account name in the IpServiceStartName parameter. The service has no password if the pointer in IpServiceStartName is NULL or if it points to an empty string. The Startname of LocalSystem is NULL, and therefore the password for lpServiceStartName in this instance is NULL, so most services will leave this column blank.
Note Services installed with a user name and password cannot be rolled back when deleted.
-
Component_
-
External key to column one of the Component Table.
Remarks
This table has most of the parameters to the Win32 CreateService function.