Bulk Signer - Setup as a Windows Service
The host detects Windows Service mode automatically via Microsoft.Extensions.Hosting.WindowsServices and exits with code 0 on graceful shutdown.
Publish
dotnet publish src\Lacuna.BulkSigner\Lacuna.BulkSigner.csproj -c Release -r win-x64 --self-contained false -o C:\LacunaBulkSigner
Install as a service
sc create LacunaBulkSigner binpath="C:\LacunaBulkSigner\Lacuna.BulkSigner.exe" start=auto
sc description LacunaBulkSigner "Lacuna Bulk Signer v2"
Set environment variables via the service account or registry:
[Environment]::SetEnvironmentVariable("BULKSIGNER_API_KEY", "your-api-key", [EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("BULKSIGNER_PFX_PASSWORD", "your-pfx-password", [EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("Signing__License", "<lacuna-license>", [EnvironmentVariableTarget]::Machine)
Start:
sc start LacunaBulkSigner
Check the rolling log under data\logs\ for startup events. The Spectre console output goes to the service event log/host (not visible by default — use the Serilog file logs for diagnostics).
Upgrade
sc stop LacunaBulkSigner
# Copy new files over C:\LacunaBulkSigner
sc start LacunaBulkSigner
Uninstall
sc stop LacunaBulkSigner
sc delete LacunaBulkSigner