fix(windows): an older download never goes back over a newer installed launcher; the installed one starts instead (#129) #172

Merged
HumanBean merged 2 commits from madebyjordan/LongshotLauncher:fix/setup-never-downgrades into main 2026-11-17 15:59:49 +00:00
Member

Fixes #129. Starting the old Windows download again (from Downloads or the desktop) and pressing Install put that old launcher back over the newer one installed, which had updated itself since. Installer.Install copied the running file over the installed program without comparing versions.

What changes

  • Installer.InstalledVersion reads the installed launcher's version from its Apps & features entry's DisplayVersion (1.0.0-rc.9, or Nightly 100 · 5f30eea3 turned back into a nightly tag). The installed launcher rewrites that entry at every start, the first one after each self-update too, and rc.3 already did.
  • InstalledIsNewer: when the installed launcher is newer, Install leaves the program, entry and shortcut alone and returns its path, so the Install button and --install start the newer one. The download also skips the Install / Run portable window and starts the installed launcher directly, passing its arguments on (--play and the rest).
  • The same version still offers Install: it copies the same program and puts back its shortcut and entry, a repair. A nightly and a release have no order, so another channel's download still installs.
  • README updated.

Testing

Windows 11, .NET SDK 10.0.404.

  • python -I tests/test_launcher_core.py with TEMP on its long path: main 1439 checks, this branch 1447. The check commit fails on main with An older download's Install put its launcher back over the newer one installed (#129).; breaking the comparison brings it back.
  • dotnet build: 0 warnings.

Not tested: a real older setup started over a real newer install. While a newer launcher is installed, an older download can't reach Run portable; a portable file beside it still makes it portable.

Found on the way, not fixed here (its own topic): the self-update rollback at App/Program.cs never runs on Windows, because SelfUpdate.CurrentFile accepts only names ending .exe, so a process started as LongshotLauncher.exe.old gets null. It only matters when the main exe is missing, so it doesn't explain #129.

🤖 Generated with Claude Code

Fixes #129. Starting the old Windows download again (from Downloads or the desktop) and pressing Install put that old launcher back over the newer one installed, which had updated itself since. `Installer.Install` copied the running file over the installed program without comparing versions. ## What changes - **`Installer.InstalledVersion`** reads the installed launcher's version from its Apps & features entry's `DisplayVersion` (`1.0.0-rc.9`, or `Nightly 100 · 5f30eea3` turned back into a nightly tag). The installed launcher rewrites that entry at every start, the first one after each self-update too, and rc.3 already did. - **`InstalledIsNewer`**: when the installed launcher is newer, `Install` leaves the program, entry and shortcut alone and returns its path, so the Install button and `--install` start the newer one. The download also skips the Install / Run portable window and starts the installed launcher directly, passing its arguments on (`--play` and the rest). - The same version still offers Install: it copies the same program and puts back its shortcut and entry, a repair. A nightly and a release have no order, so another channel's download still installs. - README updated. ## Testing Windows 11, .NET SDK 10.0.404. - `python -I tests/test_launcher_core.py` with TEMP on its long path: main 1439 checks, this branch 1447. The check commit fails on main with `An older download's Install put its launcher back over the newer one installed (#129).`; breaking the comparison brings it back. - `dotnet build`: 0 warnings. Not tested: a real older setup started over a real newer install. While a newer launcher is installed, an older download can't reach Run portable; a `portable` file beside it still makes it portable. Found on the way, not fixed here (its own topic): the self-update rollback at `App/Program.cs` never runs on Windows, because `SelfUpdate.CurrentFile` accepts only names ending `.exe`, so a process started as `LongshotLauncher.exe.old` gets null. It only matters when the main exe is missing, so it doesn't explain #129. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Windows download offers Install every time it is started. Once the
launcher it installed has updated itself, starting that old download again
from Downloads and pressing Install copies the old launcher over the newer
one, and the next start is the old version again. This check installs rc.3,
updates the installed program to rc.9 the way a self-update leaves it, then
installs the rc.3 download again: the rc.9 program and its entry must stay.
It fails on main, where Install never compares versions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(windows): an older download never goes back over a newer installed launcher; the installed one starts instead (#129)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
f2d37ad6d6
The Windows download offers Install or Run portable each time it starts,
and Install copied it over the installed launcher without looking at
versions. After the installed launcher had updated itself (rc.3 to rc.9),
starting the rc.3 download again from Downloads and pressing Install put
rc.3 back, so the update seemed to revert.

The installed launcher's version is read back from its Apps & features
entry (DisplayVersion: 1.0.0-rc.9, or "Nightly 100 · 5f30eea3"), which it
writes again at every start, the first after each of its updates too, so
nothing has to be started to read it. When it is newer than the download:
- the download starts the installed launcher, with its arguments, instead
  of showing the offer;
- Installer.Install (the Install button, --install) leaves the installed
  program, its entry and its shortcut as they are and returns its path, so
  the caller starts the newer one.
The same version is installed again as before: the same program, its Start
menu shortcut and entry put back, which repairs a deleted shortcut. A
nightly and a release have no order, so a download of the other channel is
still installed when the player asks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/setup-never-downgrades 2026-11-17 15:59:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!172
No description provided.