Services
Install Windows services with your package.
Applies to: MSI and MSIX.
services – Windows services
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | – | Service name (used by sc, the registry, etc.). Max 256 chars. Cannot contain / or \. Windows treats service names case-insensitively – pick a unique, brand-prefixed name (e.g., My ApplicationUpdater not Updater). |
displayName | string | no | – | User-friendly name shown in services.msc. Max 256 chars. |
executable | string | yes | – | Path inside the package to the service binary. Validated against fileSystemEntries. |
arguments | string | no | – | Command-line arguments. |
startAccount | enum | no | LocalSystem | One of LocalSystem, LocalService, NetworkService. For MSI only, custom domain accounts are also accepted (see notes). |
startupType | enum | no | Auto | One of Auto, Manual, Disabled. |
description | string | no | – | Service description. |
dependencies | string[] | no | – | Other service names or load-ordering groups that must start first. |
msi | object | no | see defaults below | MSI-specific config. |
msi sub-object
| Property | Type | Default | Description |
|---|---|---|---|
loadOrderGroup | string | – | The load-order group name. |
errorControl | enum | Normal | Ignore, Normal, Critical. Action if the service fails to start at boot. |
serviceType | enum | OwnProcess | OwnProcess or ShareProcess. Whether the service runs in its own process. |
interactive | boolean | false | Whether the service can interact with the desktop. Requires LocalSystem. |
startAccountPassword | string | – | Password for a custom startAccount. NOT allowed for LocalSystem/LocalService/NetworkService. |
Examples
Simple background service
"services": [
{
"name": "My ApplicationUpdater",
"displayName": "My Application Updater",
"executable": "$.installDir\\My Application.Service.exe",
"startupType": "Auto",
"description": "Periodically syncs notes to the cloud."
}
]
Default account is LocalSystem, default error control is Normal.
Run as LocalService and depend on the network
{
"name": "My ApplicationSync",
"displayName": "My Application Sync",
"executable": "$.installDir\\My Application.Sync.exe",
"startAccount": "LocalService",
"startupType": "Auto",
"dependencies": ["LanmanWorkstation", "Tcpip"],
"description": "Syncs notes over the LAN."
}
MSI-only: custom domain account
{
"name": "My ApplicationEnterprise",
"executable": "$.installDir\\My Application.Enterprise.exe",
"startAccount": ".\\My CompanyService",
"startupType": "Auto",
"msi": {
"serviceType": "OwnProcess",
"errorControl": "Normal",
"startAccountPassword": "[SERVICE_PASSWORD]"
}
}
[SERVICE_PASSWORD] is an MSI Formatted token resolved at install time – pass SERVICE_PASSWORD=Sup3r$ecret! on the msiexec command line. Never hard-code service passwords in JSON.
startAccount rules:
- For
OwnProcessMSI services:DomainName\UserNameor.\UserName(built-in domain). ShareProcessandinteractive: trueMSI services must useLocalSystem.- MSIX services support only
LocalSystem,LocalService,NetworkService. Custom accounts will fail validation for MSIX builds.
MSI vs MSIX behavior
| Aspect | MSI | MSIX |
|---|---|---|
Custom startAccount (domain user) | Allowed (with startAccountPassword). | Not allowed. Validation fails. |
interactive services | Supported. | Not supported. |
serviceType: ShareProcess | Supported. | Limited. |
| Auto-detected MSIX capabilities | – | MPDEV automatically declares localSystemServices / packagedServices / allowElevation as needed. |
Validation rules
| Validator | Catch |
|---|---|
required | name, executable are mandatory. |
max size | services.name and services.displayName ≤ 256 chars. |
illegal characters | services.name cannot contain / or \. |
valid path in package | services.executable must point to a path inside fileSystemEntries. |
valid value | Enum-based fields must use a valid value. |
valid service start account | Custom startAccount only for MSI. |
valid start account password | startAccountPassword cannot be set for built-in accounts. |