feat(migrate): carry the previous launcher's language and cache folder #316

Merged
HumanBean merged 1 commit from riqmarmes/LongshotLauncher:feat/stable-preferences into main 2026-11-28 00:21:05 +00:00
Contributor

Why. The upgrade notes tell players coming from Longshot Launcher 1.3.x to set their language, update channel and custom cache drive again. Two of those are safe to reuse — the launcher language, the game language and a custom build-files (work) folder location — so a player does not have to repeat setup that has not changed. Nothing here is a consent or a channel choice.

What changed.

  • New src/home/stable_prefs.rs reads the previous launcher's settings.json read-only and fills only what this launcher has not set yet: uiLanguage (validated against the launcher's languages), language (validated against the wizard's game languages), and work only when it is an absolute existing folder. The folder's contents are never reused or copied.
  • Deliberately not imported: launcherChannel (it would point this launcher's updater at the older C# stable launcher), telemetry/crash consents, licence acceptances, the profile choice, buildsFolder.
  • One-time marker stable-prefs-v1.json, mirroring the save/mod import markers; a player's later choice is never overwritten.
  • Called from preferences::bind (after the settings file exists), best-effort: a failure is logged and startup continues.
  • Docs: the README upgrade notes, docs/saves.md, and the marker list in docs/paths.md.

Tests.

  • 4 new unit tests in stable_prefs: the safe values are carried once, values chosen here are not replaced, no previous launcher means no change, and unknown languages or a missing folder are skipped; the old settings.json is asserted byte-identical.
  • cargo fmt --all -- --check; cargo clippy --locked --all-targets -- -D warnings; cargo test --locked → 12 pre-existing Windows environment-only failures, none in touched code; python -I scripts/translations.py; Tooling tests/test_release.py → 46 tests OK.
  • Not run: the builder-contract half of tests/test_launcher_core.py (needs the pinned Longshot checkout, as above); CI covers it.

Screenshots. None: no visible UI change, the settings simply start from the previous values.

**Why.** The upgrade notes tell players coming from Longshot Launcher 1.3.x to set their language, update channel and custom cache drive again. Two of those are safe to reuse — the launcher language, the game language and a custom build-files (`work`) folder location — so a player does not have to repeat setup that has not changed. Nothing here is a consent or a channel choice. **What changed.** - New `src/home/stable_prefs.rs` reads the previous launcher's `settings.json` **read-only** and fills only what this launcher has not set yet: `uiLanguage` (validated against the launcher's languages), `language` (validated against the wizard's game languages), and `work` only when it is an absolute existing folder. The folder's **contents are never reused or copied**. - Deliberately not imported: `launcherChannel` (it would point this launcher's updater at the older C# stable launcher), telemetry/crash consents, licence acceptances, the profile choice, `buildsFolder`. - One-time marker `stable-prefs-v1.json`, mirroring the save/mod import markers; a player's later choice is never overwritten. - Called from `preferences::bind` (after the settings file exists), best-effort: a failure is logged and startup continues. - Docs: the README upgrade notes, `docs/saves.md`, and the marker list in `docs/paths.md`. **Tests.** - 4 new unit tests in `stable_prefs`: the safe values are carried once, values chosen here are not replaced, no previous launcher means no change, and unknown languages or a missing folder are skipped; the old `settings.json` is asserted byte-identical. - `cargo fmt --all -- --check`; `cargo clippy --locked --all-targets -- -D warnings`; `cargo test --locked` → 12 pre-existing Windows environment-only failures, none in touched code; `python -I scripts/translations.py`; Tooling `tests/test_release.py` → 46 tests OK. - Not run: the builder-contract half of `tests/test_launcher_core.py` (needs the pinned Longshot checkout, as above); CI covers it. **Screenshots.** None: no visible UI change, the settings simply start from the previous values.
feat(migrate): carry the previous launcher's language and cache folder
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Blocked by required conditions
CI / Rust formatting, lint and tests (pull_request) Blocked by required conditions
CI / Release packages and stable upgrades (pull_request) Blocked by required conditions
PR title / Conventional Commit title (pull_request) Blocked by required conditions
1e6fc3f10c
Member

Possibly related, for context:

  • PR #315 feat(migrate): reuse the previous launcher's game file automatically — Parallel migration from the same settings.json and upgrade path
Possibly related, for context: - PR #315 feat(migrate): reuse the previous launcher's game file automatically — Parallel migration from the same settings.json and upgrade path
HumanBean deleted branch feat/stable-preferences 2026-11-28 00:21:06 +00:00
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Blocked by required conditions
CI / Rust formatting, lint and tests (pull_request) Blocked by required conditions
CI / Release packages and stable upgrades (pull_request) Blocked by required conditions
PR title / Conventional Commit title (pull_request) Blocked by required conditions
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!316
No description provided.