Repository navigation
Clarify update guidance for builds that cannot self-update - #2
Merged
Merged
Conversation
The update window always rendered a "下载并重启更新" button, disabled for source runs, non-Windows platforms and releases without a verifiable asset, and its hint told source users to download a Windows update package they cannot apply. Decide the reason in one pure helper, show the actionable step instead (git pull for a source checkout), and drop the dead button and progress bar from that window. A background startup check now only reports in the status bar when no automatic install is possible; the manual check still opens the full window so release notes and the release page stay reachable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
源码运行(
pythonw.exe exmaterial_app.py)时,更新窗口始终会渲染一个置灰的“下载并重启更新”按钮,并提示“请从发布页下载 Windows 版更新包,或更新本地源码。”——但源码版用户真正要做的是git pull,下载 EXE 更新包对他们无效。非 Windows 平台和缺少可校验资产的发布也走同一句提示。改动
updates.manual_update_hint():把“能不能自动更新、不能的原因是哪个”收敛成一个纯函数,返回空字符串表示可以自动安装,并给出对应提示(源码运行 →git pull;非 Windows → 发布页;无可校验安装包 → 发布页)。launch_installer()与download_release()复用同一批文案。验证
python -m unittest test_updates test_core test_file_import:38 项全部通过(新增 1 项覆盖三种运行方式的提示判定)。git pull)、EXE + 手动检查(进度条与“下载并重启更新”照旧)、EXE 但发布缺可校验资产(提示到发布页下载)。installer_script的 Windows 集成测试照常通过。