Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

fix(installer): preserve start type during installs

Open Nonary opened this issue 8 months ago • 1 comments

Description

Preserve whatever start-type (auto, delayed-auto, demand, or disabled) the Windows SunshineService already uses when the program is upgraded or re-installed.
Previously every update reset the service to Automatic.

Key Points

  • Vibe Coding – Most of the code changes and this PR text were AI-generated and then peer-reviewed/tweaked by humans for accuracy and style.
  • install-service.bat
    • Reads a marker file written by the uninstaller and re-creates the service with that start-type; defaults to auto on fresh installs.
    • Starts the service only if the preserved mode isn’t disabled.
  • uninstall-service.bat
    • Detects the current start-type (or the legacy sunshinesvc) and writes it to %TEMP%\sunshine_start_mode.txt before deletion.
  • windows.cmake
    • Removes installation of the obsolete autostart folder and call to autostart-service.bat.
  • autostart-service.bat – Deleted (logic folded into the installer scripts).

Screenshot

Not applicable – no UI changes.

Issues Fixed or Closed

  • Closes #3469

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature
  • [ ] Breaking change
  • [ ] Dependency update
  • [ ] Documentation update
  • [ ] Repository update

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have added or updated the in-code documentation blocks for new or existing scripts

Nonary avatar May 11 '25 05:05 Nonary