launcher: check for updates at start and update in one click (LAUNCHER-UPDATE) #3057

Manually merged
github merged 3 commits from github-bot/gh-3057 into gh-pr/3057/base 2026-12-02 07:36:56 +00:00 AGit
Owner

@⁠OreoFR on GitHub · 2026-12-02 06:38 UTC · original
OreoFR:feat/launcher-update → main · +221 −3 · 3 files · 3 commits · merged 2026-12-02 07:35 UTC

Claimed in the coordination issue as LAUNCHER-UPDATE: #2570

What and why

Players keep asking how to update. The launcher had no update path, and a zip install cannot git pull at all.

  • Check at start. A background thread runs git fetch --quiet, then git rev-list --count HEAD..@{u}. When the clone is behind, the Play page's bar shows "Update available: N new commits" and an Update button. A failed fetch, a missing git or a branch with no upstream is reported in one line, never raised.
  • Update (that button, or Tools > Update Leonida, after a confirmation) runs this file's own --update mode, so its output streams into the launcher like the other tools:
    • git pull --ff-only; with local changes or another branch in the way it stops and changes nothing;
    • then the runtime is rebuilt (d3d12\scripts\build-nvidia.ps1), only when d3d12/ changed between the old and new HEAD;
    • after it ends, the check runs again.
  • Zip install (no .git): the launcher says that updating needs a git clone.
  • Settings: a "Check for updates at start" box, on by default, turns the fetch off.
  • docs/launcher.md describes it.

It only talks to the repository's own remote (git fetch). No other service is contacted.

Tested

  • python -I tests/test_leonida_launcher.py: 23 tests, 7 of them new. They use a fake git and cover: zip copy, N commits behind, failed fetch, no upstream, a rebuild only when d3d12/ changed, a pull that cannot fast-forward (no build), the --update command line, and the setting.
  • End to end on Windows 11, with a real bare remote and a clone two commits behind:
    • the check returned behind 2 with the expected note;
    • --update fast-forwarded the clone, saw d3d12/ change and started the rebuild. The rebuild script was absent from that test repository, as expected.
  • tests/test_text_write_line_endings.py and scripts/check_no_game_data.py are clean.
  • Not clicked through in the window: the game was running on the test PC (RTX 4070 Laptop).

Touches the same file as #3056 (a different part of it). Whichever merges second may need a trivial rebase.

AI-assisted (oreofr-agent, Claude).

🤖 Generated with Claude Code

**@⁠OreoFR** on GitHub · 2026-12-02 06:38 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3057) `OreoFR:feat/launcher-update` → `main` · +221 −3 · 3 files · 3 commits · merged 2026-12-02 07:35 UTC Claimed in the coordination issue as `LAUNCHER-UPDATE`: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570 ### What and why Players keep asking how to update. The launcher had no update path, and a zip install cannot `git pull` at all. - **Check at start.** A background thread runs `git fetch --quiet`, then `git rev-list --count HEAD..@{u}`. When the clone is behind, the Play page's bar shows "Update available: N new commits" and an **Update** button. A failed fetch, a missing git or a branch with no upstream is reported in one line, never raised. - **Update** (that button, or Tools > Update Leonida, after a confirmation) runs this file's own `--update` mode, so its output streams into the launcher like the other tools: - `git pull --ff-only`; with local changes or another branch in the way it stops and changes nothing; - then the runtime is rebuilt (`d3d12\scripts\build-nvidia.ps1`), only when `d3d12/` changed between the old and new HEAD; - after it ends, the check runs again. - **Zip install** (no `.git`): the launcher says that updating needs a `git clone`. - **Settings:** a "Check for updates at start" box, on by default, turns the fetch off. - `docs/launcher.md` describes it. It only talks to the repository's own remote (`git fetch`). No other service is contacted. ### Tested - `python -I tests/test_leonida_launcher.py`: 23 tests, 7 of them new. They use a fake git and cover: zip copy, N commits behind, failed fetch, no upstream, a rebuild only when `d3d12/` changed, a pull that cannot fast-forward (no build), the `--update` command line, and the setting. - End to end on Windows 11, with a real bare remote and a clone two commits behind: - the check returned `behind 2` with the expected note; - `--update` fast-forwarded the clone, saw `d3d12/` change and started the rebuild. The rebuild script was absent from that test repository, as expected. - `tests/test_text_write_line_endings.py` and `scripts/check_no_game_data.py` are clean. - Not clicked through in the window: the game was running on the test PC (RTX 4070 Laptop). Touches the same file as #3056 (a different part of it). Whichever merges second may need a trivial rebase. AI-assisted (oreofr-agent, Claude). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
At start the launcher runs git fetch in its folder. When the clone is
behind its upstream, the Play page says how many new commits there are
and shows an Update button. Update runs this file's own --update mode:
git pull --ff-only, then a rebuild of the runtime when d3d12/ changed,
with the output streamed like the other tools.

A copy downloaded as a zip has no .git; the launcher says that updating
needs a git clone. A Settings box turns the check off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 06:41:48 +00:00
The first window test showed the bar line at the very bottom, easy to
miss, and its text pointed at a button "above" that was beside it. An
update now shows as a framed "Update available: N new commits" with its
Update button next to PLAY. The bar keeps the other notes (zip copy, no
git, a failed check).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠OreoFR on GitHub · 2026-12-02 06:56 UTC · original

Merging (oreofr-agent, with OreoFR's written OK as maintainer): head 094be1f323124d5607cd27a8b7ef945e5e832f8d, CI green, merges cleanly into main f37c4a87d. Launcher, its tests and doc only. 23/23 launcher tests pass. Window checked on a test clone two commits behind: "Update available: 2 new commits" and the Update button show beside PLAY. --update fast-forwarded a real clone and started the rebuild when d3d12/ changed. Queued after #3056, which touches another part of the same file.

**@⁠OreoFR** on GitHub · 2026-12-02 06:56 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3057#issuecomment-7337581930) Merging (oreofr-agent, with OreoFR's written OK as maintainer): head `094be1f323124d5607cd27a8b7ef945e5e832f8d`, CI green, merges cleanly into main `f37c4a87d`. Launcher, its tests and doc only. 23/23 launcher tests pass. Window checked on a test clone two commits behind: "Update available: 2 new commits" and the Update button show beside PLAY. `--update` fast-forwarded a real clone and started the rebuild when `d3d12/` changed. Queued after #3056, which touches another part of the same file.
Author
Owner

@⁠OreoFR on GitHub · 2026-12-02 07:24 UTC · original

Merging again (oreofr-agent, with OreoFR's written OK): head d9ac7f6f0c1797fd54430b9e00e39d6979e360a0. The queue had taken it out over a conflict with #3056, which had just merged and changed the same options list. Main is merged in, and the conflict is resolved by keeping both: #3056's label for "Precompile every pipeline" and this PR's "Check for updates at start" box. Launcher tests 23/23, CI green.

**@⁠OreoFR** on GitHub · 2026-12-02 07:24 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3057#issuecomment-7338142952) Merging again (oreofr-agent, with OreoFR's written OK): head `d9ac7f6f0c1797fd54430b9e00e39d6979e360a0`. The queue had taken it out over a conflict with #3056, which had just merged and changed the same options list. Main is merged in, and the conflict is resolved by keeping both: #3056's label for "Precompile every pipeline" and this PR's "Check for updates at start" box. Launcher tests 23/23, CI green.
github-bot changed target branch from main to gh-pr/3057/base 2026-12-02 07:36:34 +00:00
github manually merged commit d9ac7f6f0c into gh-pr/3057/base 2026-12-02 07:36:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/ubiquitarianism--leonida!3057
No description provided.