How It Works
Launch Strategies
The extension chooses between two strategies per game when exporting to Sunshine:
Strategy A — Direct exe (preferred)
If a game has a File-type play action pointing to an executable that exists on disk, Sunshine launches the exe directly and tracks it. Quitting from Moonlight terminates the process natively — no scripts involved.
Used for: standalone games with a direct executable.
Strategy B — Playnite-launched
For all other games, Playnite is used to launch the game via --start <gameId>. Sunshine runs a sentinel script (WaitForGameStop.ps1) as the tracked process, which polls for a signal from Playnite’s OnGameStopped hook and exits when the game stops, ending the stream.
Used for: Steam, Epic, GOG, emulators, and games with pre/post scripts.
How “Quit App” Works
When you press Quit App in Moonlight, Sunshine kills the tracked process and runs the undo command. For Strategy B games, the undo command runs KillGameChildren.ps1, which kills the game in three phases:
- PID file — PIDs snapshotted 8 seconds after game launch are killed first. This snapshot is taken in the background (no UI freeze) by the
OnGameStartedhook and reliably catches games launched through Steam, Epic, GOG, or other launchers whose process is not a direct child of Playnite. - Install directory scan — Any process running from the game’s install directory is killed. Catches processes that spawned after the initial snapshot.
- Playnite children — Direct child processes of Playnite are killed as a final fallback.
Disconnect vs Quit App: Disconnecting in Moonlight only pauses the stream — it does not trigger the undo command. The game keeps running on the host. Only Quit App terminates the game.
Playnite Desktop / Fullscreen Entries
When enabled in settings, Sunrise adds Sunshine entries that launch Playnite itself rather than a specific game. These entries are session-aware:
- At stream start, Sunrise records whether Playnite was already running.
- Quit App only closes Playnite if this streaming session was the one that launched it. If Playnite was already open, it is left untouched.
- The stream ends naturally when Playnite is closed (by any means).
Sunshine API vs Elevated Write
Sunrise can write app changes in two ways:
API mode (preferred): When Sunshine web UI credentials are configured, all add/remove/sync operations go through Sunshine’s REST API over HTTPS. No UAC prompts, no service restart required — Sunshine reloads its config automatically.
Elevated write (fallback): When credentials are not configured, Sunrise writes apps.json directly using an elevated PowerShell process (one UAC prompt) and optionally restarts the Windows service (sunshinesvc) to reload the config.
Cover Art
Box art is exported from your Playnite library and converted to PNG if necessary. Images are stored in:
%LocalAppData%\PlayniteSunrise\Apps\<GameId>.png
Cover images are only re-exported when the source file has changed since the last export. Unsupported formats (WebP, TGA, DDS) are skipped with a log entry rather than producing a broken file.
Custom Covers for Playnite Entries
To override the default cover for the Playnite Desktop or Fullscreen Sunshine entries, place a PNG at:
%LocalAppData%\PlayniteSunrise\covers\sunrise-playnite-desktop.png
%LocalAppData%\PlayniteSunrise\covers\sunrise-playnite-fullscreen.png
User overrides take precedence over the bundled defaults.