Skip to content

Skip pre-releases when picking "latest"; consolidate platform matching - #110

Open
999sian wants to merge 1 commit into
SirDiabo:mainfrom
999sian:fix/prerelease-and-consolidate-platform-matching
Open

Skip pre-releases when picking "latest"; consolidate platform matching#110
999sian wants to merge 1 commit into
SirDiabo:mainfrom
999sian:fix/prerelease-and-consolidate-platform-matching

Conversation

@999sian

@999sian 999sian commented Jul 9, 2026

Copy link
Copy Markdown

Fixes SirDiabo#89 and removes duplicated platform-detection logic.

Pre-release handling (SirDiabo#89): the launcher treated the newest GitHub
release as "latest" via Releases.FirstOrDefault(). The /releases API is
newest-first but includes pre-releases, so a repo whose newest release
is a pre-release (e.g. Skate 3 Recomp's nightly builds) was offered as
the current version even though it isn't the finished build. Added
GameInfo.SelectLatestRelease(), which prefers the newest stable release
and falls back to the newest pre-release only when a repo publishes no
stable releases at all (so pre-release-only repos still work). Mirrors
GitHub's own /releases/latest semantics. Wired into all three selection
sites: GameInfo version-check + download, and MainWindow "Update now".

Consolidation: App.axaml.cs and CLIHandler.cs each carried a private
copy of GetPlatformIdentifier() duplicating
PlatformAssetMatcher.GetPlatformIdentifier(TargetOS.Auto). Removed both
copies and call the shared Core method.

Self-update asset selection in both files used a naive
name.Contains(platformIdentifier) check, weaker than the
PlatformAssetMatcher.MatchesPlatform() the game-download path already
uses (e.g. "Linux-X64" is a substring of a "Linux-X64"/"Linux-ARM64"
pairing only by lucky naming). Routed both self-update paths through
MatchesPlatform for consistent, robust matching; the existing
.zip/.tar.gz extension filter is preserved.

Verified against the real compiled GameInfo.SelectLatestRelease (via
reflection) and PlatformAssetMatcher: prerelease-at-top is skipped,
all-stable picks newest, prerelease-only falls back, empty/null -> null;
and the self-update matcher picks the correct asset per platform from
the launcher's real release asset names without the ARM64/X64 mixup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant