Skip to content

Clarify update guidance for builds that cannot self-update - #2

Merged
LYKD merged 1 commit into
LYKD:mainfrom
stellariums:codex/source-update-hint
Oct 17, 2026
Merged

LYKD merged 1 commit into
LYKD:mainfrom
stellariums:codex/source-update-hint

Conversation

@stellariums

Copy link
Copy Markdown
Contributor

背景

源码运行(pythonw.exe exmaterial_app.py)时,更新窗口始终会渲染一个置灰的“下载并重启更新”按钮,并提示“请从发布页下载 Windows 版更新包,或更新本地源码。”——但源码版用户真正要做的是 git pull,下载 EXE 更新包对他们无效。非 Windows 平台和缺少可校验资产的发布也走同一句提示。

改动

  • updates.manual_update_hint():把“能不能自动更新、不能的原因是哪个”收敛成一个纯函数,返回空字符串表示可以自动安装,并给出对应提示(源码运行 → git pull;非 Windows → 发布页;无可校验安装包 → 发布页)。launch_installer() 与 download_release() 复用同一批文案。
  • 更新窗口:不可自动更新时不再创建那个永远点不动的按钮和空进度条,只保留“查看发布页 / 稍后”和可执行的说明。
  • 启动后台检查:不可自动更新时只在状态栏提示一行,不再弹窗打断;“帮助 → 检查更新”仍打开完整窗口,发布说明和发布页入口不变。可自动安装的 Windows EXE 路径完全未变。

验证

  • python -m unittest test_updates test_core test_file_import:38 项全部通过(新增 1 项覆盖三种运行方式的提示判定)。
  • 实跑 Tk 界面逐个截图确认:源码 + 后台检查(仅状态栏)、源码 + 手动检查(无死按钮、给出 git pull)、EXE + 手动检查(进度条与“下载并重启更新”照旧)、EXE 但发布缺可校验资产(提示到发布页下载)。
  • 未改动下载、校验、替换与回滚逻辑,installer_script 的 Windows 集成测试照常通过。

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.
@LYKD
LYKD merged commit 5ee6de5 into LYKD:main Oct 17, 2026
3 checks passed
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.

2 participants