Skip to content

Create Windows installation script for daemon/service setup (NSSM / sc.exe) #136

Description

@siculo

Summary

Create a PowerShell script to install, update, and configure the Photometoria server as a Windows Service on Windows.

Part of the platform-specific split of #75.

Scope

Service Manager

Platform Service Manager Config Location
Windows Windows Service (sc.exe / NSSM) Service registry

Script to Create

scripts/install-windows.ps1 supporting three operations:

1. Install

  • Copy the binary to C:\Program Files\Photometoria\
  • Create default config.toml if not present (from config.toml.example)
  • Create the storage directory
  • Register the service using NSSM or native sc.exe
  • Configure appropriate permissions
  • Enable auto-start at boot (Automatic startup type)

2. Update

  • Stop the running service
  • Back up the current binary
  • Replace with the new binary
  • Restart the service
  • Verify the service is running (health check via GET /api/info)

3. Configure

  • Edit config.toml (interactive or via CLI flags)
  • Validate configuration before applying
  • Restart the service to apply changes

Platform-Specific Details

  • Service name: Photometoria
  • Configurable startup type (Automatic / Manual)
  • Event log integration for logging
  • Optional NSSM config: scripts/service-templates/photometoria-nssm.conf

Common Features

  • Idempotent: Running install twice must not break the setup
  • Uninstall: Support --uninstall to cleanly remove the service
  • Status check: --status flag to show service state and health
  • Non-destructive updates: config.toml is never overwritten during updates
  • Pre-flight checks: Verify prerequisites (e.g., Ollama installed and reachable)

File Structure

scripts/
├── install-windows.ps1
└── service-templates/
    └── photometoria-nssm.conf   # NSSM config (optional)

Acceptance Criteria

  • Windows Service install/update/uninstall working
  • Config is preserved across updates
  • Health check after install/update to verify service is running
  • Script is idempotent (safe to run multiple times)
  • Documentation in docs/ for Windows setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions