Skip to content

Windows Services Config Examples

daemon.devin edited this page Aug 30, 2025 · 1 revision

Service Configuration Examples

These examples demonstrate how the Services segment can handle complex real-world scenarios while maintaining portability and system stability.

USAGE

To make use of the Service segment, add the section [Service1] (numerical ordering) to the Launcher.ini file.

Each entry supports the following keys:

Name		-	The local/portable service name.
Path		-	The path to the portable service executable. Supports environment variables.
Type		-	Specify whether you are dealing with a service, a kernel driver or a file system driver, etc.
				Choose from: own, share, interact, kernel, filesys, rec, adapter
Start		-	Specify when the service is supposed to start.
				Choose from: boot, system, auto, demand, disabled, delayed-auto
Depend		-	List any dependencies here separated by / (forward slash).
IfExists	-	If the service already exists, you can either skip it or replace it with the portable version of the service.
				Choose from: skip, replace, backup
Description	-	Optional service description
Account		-	Optional service account (LocalSystem, LocalService, NetworkService, or custom)
Password	-	Password for custom account (if Account is specified)
Timeout		-	Timeout in seconds for service operations (default: 30)
Critical	-	If true, failure to start this service will show a warning (true/false)

EXAMPLE

[Service1]
Name=ServiceName
Path=%PAL:DataDir%\Service_driver.sys
Type=kernel
Start=system
Depend=
IfExists=replace
Description=My Portable Service
Timeout=45
Critical=true

Example 1: Database Service with Custom Account

This example shows how to configure a portable database service that runs under a specific service account with dependencies.

[Service1]
Name=PortableMySQL
Path=%PAL:AppDir%\MySQL\bin\mysqld.exe --defaults-file="%PAL:DataDir%\mysql\my.ini"
Type=own
Start=auto
Depend=tcpip
IfExists=replace
Description=Portable MySQL Database Server
Account=NT AUTHORITY\NetworkService
Password=
Timeout=60
Critical=true

Key Features:

  • Uses NetworkService account for better security
  • Depends on TCP/IP stack
  • Marked as critical (will show warnings if it fails)
  • Extended timeout for database initialization
  • Replaces any existing MySQL service

Example 2: VPN Service with Complex Dependencies

This shows a VPN service that requires multiple system services to be running first.

[Service1]
Name=PortableVPN
Path=%PAL:AppDir%\VPN\vpnservice.exe
Type=own
Start=demand
Depend=RasMan/TapiSrv/PlugPlay/Ndisuio
IfExists=backup
Description=Portable VPN Connection Manager
Account=LocalSystem
Password=
Timeout=45
Critical=true

Key Features:

  • Multiple dependencies separated by forward slashes
  • Uses "backup" mode (stops existing service but doesn't delete it)
  • Demand start (starts only when needed)
  • Longer timeout for network initialization

Example 3: Device Driver Service

This example shows how to install a portable device driver.

[Service1]
Name=PortableDriver
Path=%PAL:AppDir%\Drivers\mydriver.sys
Type=kernel
Start=system
Depend=
IfExists=replace
Description=Portable Hardware Driver
Account=
Password=
Timeout=30
Critical=false

Key Features:

  • Kernel-mode driver service
  • System start (loads during boot sequence)
  • No dependencies or custom account needed
  • Not marked as critical (won't show warnings)

Example 4: File System Filter Driver

This shows a more complex driver scenario for file system filtering.

[Service1]
Name=PortableFilter
Path=%PAL:AppDir%\Filters\fsfilter.sys
Type=filesys
Start=boot
Depend=FltMgr
IfExists=skip
Description=Portable File System Filter Driver
Account=
Password=
Timeout=20
Critical=true

Key Features:

  • File system filter driver
  • Boot start (loads very early in boot process)
  • Depends on Filter Manager (FltMgr)
  • Skip mode (won't install if already exists)
  • Critical driver (important for app functionality)

Example 5: Custom Service Account with Password

This example demonstrates using a custom domain/local account.

[Service1]
Name=PortableAppService
Path=%PAL:AppDir%\Service\appservice.exe
Type=own
Start=auto
Depend=
IfExists=replace
Description=Portable Application Service
Account=DOMAIN\ServiceAccount
Password=SecurePassword123
Timeout=30
Critical=true

Key Features:

  • Custom domain service account
  • Password authentication
  • Auto-start service
  • Will replace any existing version

Example 6: Interactive Service (Legacy Support)

For older applications that need to interact with the desktop.

[Service1]
Name=PortableLegacyApp
Path=%PAL:AppDir%\Legacy\legacyservice.exe
Type=interact
Start=demand
Depend=
IfExists=skip
Description=Legacy Interactive Service
Account=LocalSystem
Password=
Timeout=60
Critical=false

Key Features:

  • Interactive service type (deprecated but sometimes needed)
  • Demand start for on-demand usage
  • LocalSystem account for desktop interaction
  • Skip if already exists (don't interfere with existing installs)

Example 7: Network Adapter Service

For applications that install virtual network adapters.

[Service1]
Name=PortableAdapter
Path=%PAL:AppDir%\Network\netadapter.exe
Type=adapter
Start=demand
Depend=Tcpip/AFD
IfExists=replace
Description=Portable Network Adapter Service
Account=LocalSystem
Password=
Timeout=40
Critical=true

Key Features:

  • Adapter service type for network components
  • Depends on TCP/IP and Ancillary Function Driver
  • Demand start (activated when network is used)
  • Replace existing adapters

Example 8: Multiple Dependent Services

This shows how to configure multiple services that depend on each other.

Primary Service:

[Service1]
Name=PortableCore
Path=%PAL:AppDir%\Core\coreservice.exe
Type=own
Start=auto
Depend=
IfExists=replace
Description=Portable Application Core Service
Account=LocalService
Password=
Timeout=45
Critical=true

Dependent Service:

[Service2]
Name=PortableWorker
Path=%PAL:AppDir%\Worker\workerservice.exe
Type=own
Start=auto
Depend=PortableCore
IfExists=replace
Description=Portable Worker Service
Account=LocalService
Password=
Timeout=30
Critical=false

Key Features:

  • Service2 depends on Service1
  • Both use LocalService account
  • Core service is critical, worker is not
  • Auto-start for both services

Example 9: High-Security Service Configuration

For applications requiring elevated security.

[Service1]
Name=PortableSecure
Path=%PAL:AppDir%\Secure\secureservice.exe
Type=own
Start=demand
Depend=CryptSvc/KeyIso
IfExists=backup
Description=High-Security Portable Service
Account=NT SERVICE\PortableSecure
Password=
Timeout=90
Critical=true

Key Features:

  • Virtual service account (NT SERVICE\ServiceName)
  • Depends on cryptographic services
  • Backup mode (preserves existing service)
  • Extended timeout for security initialization
  • Critical service with enhanced error reporting

Example 10: Conditional Service Installation

Using the enhanced error handling for conditional logic.

[Service1]
Name=OptionalService
Path=%PAL:AppDir%\Optional\service.exe
Type=own
Start=disabled
Depend=
IfExists=skip
Description=Optional Portable Service
Account=LocalService
Password=
Timeout=30
Critical=false

Key Features:

  • Disabled start (installed but not started automatically)
  • Skip existing (won't interfere with user's choice)
  • Not critical (failures won't show warnings)
  • Can be started manually when needed

Advanced Configuration Tips:

1. Timeout Guidelines:

  • Drivers: 20-30 seconds
  • Database Services: 60-120 seconds
  • Network Services: 30-60 seconds
  • Simple Services: 15-30 seconds

2. Account Selection:

  • LocalSystem: Full system access (use carefully)
  • LocalService: Limited local access (safest for most services)
  • NetworkService: Network access with limited local rights
  • Custom Account: When specific permissions are needed

3. IfExists Strategy:

  • skip: For optional or user-configured services
  • replace: For core application services
  • backup: For services that might be shared with other apps

4. Dependency Planning:

  • Always list dependencies in order of initialization
  • Use forward slashes (/) to separate multiple dependencies
  • Consider both direct and indirect dependencies
  • Test dependency chains thoroughly

Clone this wiki locally