Skip to content

feat: 修改主页下载稳定版功能为在应用内更新#5957

Open
Mine-diamond wants to merge 4 commits intoHMCL-dev:mainfrom
Mine-diamond:switch-stable
Open

feat: 修改主页下载稳定版功能为在应用内更新#5957
Mine-diamond wants to merge 4 commits intoHMCL-dev:mainfrom
Mine-diamond:switch-stable

Conversation

@Mine-diamond
Copy link
Copy Markdown
Contributor

之前主页中预览版提示下载稳定版是打开HMCL官网的下载地址,但是在HMCL内更新应该是更好的选择

bandicam.2026-04-14.22-53-16-847.mp4

@Mine-diamond Mine-diamond marked this pull request as ready for review April 15, 2026 13:57
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 17, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d01199be97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +378 to +380
RemoteVersion target = UpdateChecker.getLatestVersion();
if (target != null) {
UpdateHandler.updateFrom(target);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate stable upgrade on a successful stable check

This callback upgrades from UpdateChecker.getLatestVersion() as soon as checkingUpdate becomes false, but it does not verify that the just-finished check actually fetched a stable result. Because requestCheckUpdate is skipped when another check is already running and latestVersion is left unchanged when a check fails, clicking this link during an in-flight check (or after a failed stable check) can still install a stale dev/nightly version instead of switching to stable.

Useful? React with 👍 / 👎.


public void onSwitchToStableChannel() {
Controllers.confirm(i18n("update.switch_to_stable.confirm"), i18n("update.switch_to_stable.title"), () -> {
UpdateChecker.requestCheckUpdate(UpdateChannel.STABLE, config().acceptPreviewUpdateProperty().get());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Request non-preview build when switching to stable

The new “switch to stable” flow passes acceptPreviewUpdate into requestCheckUpdate, so users who enabled preview updates will query stable-preview rather than stable. That conflicts with the UI text promising installation of the latest stable version and can keep users on pre-release builds after choosing this action.

Useful? React with 👍 / 👎.

update.changelog=Changelog
update.channel.dev=Beta
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds.\n\
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
update.channel.dev.hint=You are currently using a Beta channel build of the launcher. While it may include some extra features, it is also sometimes less stable than the Stable channel builds. <a href="hmcl://update/switch-channel/stable">Switch to Stable channel</a>\n\

update.channel.dev.title=Beta Channel Notice
update.channel.nightly=Nightly
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds.\n\
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds. <a href="hmcl://update/switch-channel/stable">switch to Stable channel</a>\n\
update.channel.nightly.hint=You are currently using a Nightly channel build of the launcher. While it may include some extra features, it is also always less stable than the other channel builds. <a href="hmcl://update/switch-channel/stable">Switch to Stable channel</a>\n\

update.note.dev=Suitable for users who want to experience new features first.\nThe development version includes the latest features and bug fixes,\nbut may also have more issues due to insufficient testing.
update.latest=This is the latest version
update.no_browser=Cannot open in system browser. But we copied the link to your clipboard, and you can open it manually.
update.switch_to_stable.confirm=Switch to stable channel?\nThis will download and install the latest stable version.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.switch_to_stable.confirm=Switch to stable channel?\nThis will download and install the latest stable version.
update.switch_to_stable.confirm=Want to switch to the stable channel of HMCL?\nClick "Yes" to download and install the latest stable version of HMCL.

update.note.dev=适合希望优先体验新功能的用户使用。\n包含最新功能和错误修复,但未经充分测试,可能会存在更多问题。
update.latest=当前版本为最新版本
update.no_browser=无法打开浏览器。网址已经复制到剪贴板,你可以手动粘贴网址打开页面。
update.switch_to_stable.confirm=是否切换到稳定版?\n这将会下载并安装最新的稳定版本。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.switch_to_stable.confirm=是否切换到稳定版?\n这将会下载并安装最新的稳定版本
update.switch_to_stable.confirm=是否切换至稳定版?\n这将会下载并安装最新的 HMCL 稳定版本

update.note.dev=適合希望優先體驗新功能的使用者使用。\n開發版會包含最新功能和錯誤修復,但未經充分測試,可能會存在更多問題。
update.latest=目前版本為最新版本
update.no_browser=無法開啟瀏覽器。網址已經複製到剪貼簿了,你可以手動複製網址開啟頁面。
update.switch_to_stable.confirm=是否切換到穩定版?\n這將會下載並安裝最新的穩定版本。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.switch_to_stable.confirm=是否切換到穩定版?\n這將會下載並安裝最新的穩定版本
update.switch_to_stable.confirm=希望切換至穩定管道嗎?\n這將會下載並安裝最新的 HMCL 穩定版本

update.latest=目前版本為最新版本
update.no_browser=無法開啟瀏覽器。網址已經複製到剪貼簿了,你可以手動複製網址開啟頁面。
update.switch_to_stable.confirm=是否切換到穩定版?\n這將會下載並安裝最新的穩定版本。
update.switch_to_stable.title=切換至穩定版
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.switch_to_stable.title=切換至穩定版
update.switch_to_stable.title=切換至穩定管道

update.channel.dev.title=開發版提示
update.channel.nightly=預覽版
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!\n\
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
update.channel.nightly.hint=你正在使用 HMCL 預覽版。預覽版更新較為頻繁,包含一些未在穩定版和開發版中包含的測試性功能,僅用於體驗新功能。預覽版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定管道</a>\n\

update.changelog=更新日誌
update.channel.dev=開發版
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!\n\
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定版</a>\n\
update.channel.dev.hint=你正在使用 HMCL 開發版。開發版包含一些未在穩定版中包含的測試性功能,僅用於體驗新功能。開發版功能未受充分驗證,使用起來可能不穩定!<a href="hmcl://update/switch-channel/stable">切換至穩定管道</a>\n\

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.

3 participants