fix(installer): 一键安装器点「立即安装」后不缩成角落进度卡——SHOW 钩子被路过的页吃掉(dev-board#356) - #693
Merged
Merged
Conversation
真机上点完「立即安装」界面塌回 NSIS 原生向导,CI 却一直全绿——ui-harness 走的是 「欢迎页紧贴 INSTFILES」的理想页序,而桌面端真产物中间夹着 electron-builder 的 「安装模式」页。本提交只加用例,不修引擎,用来先把红拿到手: - ui-harness.nsi 加 -DEB_PAGE_ORDER:按 multiUserUi.nsh 的结构复刻那张运行期被 Abort 跳过、编译期照样吃掉 MUI_PAGE_CUSTOMFUNCTION_SHOW 的页; - installer-smoke.ps1 在「点完立即安装」后真做断言(此前只截图):窗口必须缩成 角落小进度卡,原生「上一步」按钮(IDC 3)必须不可见; - 工作流多编一个 harness-eborder.exe 并实跑。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
真机症状:欢迎大卡片正常,点完「立即安装」界面塌回 NSIS 原生向导——进度条贴顶、 原生「上一步」按钮飘在窗口中间、窗口还是 760 宽。桌面端与 Office 插件端共用引擎, 但只有桌面端中招。 根因:MUI2 的 MUI_PAGE_CUSTOMFUNCTION_SHOW 是「谁先展开谁吃掉」的一次性 define (Pages.nsh 的 MUI_PAGE_FUNCTION_CUSTOM = Call + 紧跟一句 !undef)。引擎原先把 安装页的 SHOW 回调 AwdInstFilesShow 挂在 AWD_UI_PAGE_WELCOME 宏里,赌「紧随其后 的就是 MUI_PAGE_INSTFILES」。插件安装器确实如此,桌面端不是:electron-builder 的 assistedInstaller.nsh 页序为 customWelcomePage → [licensePage] → PAGE_INSTALL_MODE → [MUI_PAGE_DIRECTORY] → customPageAfterChangeDir → MUI_PAGE_INSTFILES 中间那张「安装模式」页(perMachine=false 才有)在编译期先把 SHOW 吃掉;而它自己 又被我们的 customInstallMode(isForceCurrentInstall=1)在 PRE 里 Abort 跳过, 那句 Call 连跑都不会跑。两头都不响,AwdInstFilesShow 从未执行。 修法: - 引擎拆出 AWD_UI_INSTFILES_HOOK(只 define)与 AWD_UI_PAGE_INSTFILES(钩子 + 页 的原子宏),欢迎页宏不再偷偷挂钩子; - ui-harness / Office 插件安装器改用原子宏,抢不走; - 桌面端页序在 electron-builder 手里,钩子挂 customPageAfterChangeDir——那是唯一 紧贴 INSTFILES 之前的钩子(升级 electron-builder 要回核这个页序)。 红绿两轮(同一份用例代码): - run 33479867391(未改引擎)红,harness-eborder 停在 760x568、native back button visible=True,与用户实机截图同形;理想页序的 zh harness 同轮全绿。 - 本轮绿。 地雷入档 .claude/agents/eng-infra.md 6.5.5。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
真机症状(用户 Mac 上的 Windows 虚拟机):欢迎大卡片正常,点完「立即安装」界面塌回 NSIS 原生向导——进度条贴顶、原生「上一步(P)」按钮飘在窗口中间、窗口还是 760 宽的大卡片尺寸。原始需求是对齐搜狗:点完应当收成桌面右上角 360x132 的小进度卡。
根因
MUI2 的
MUI_PAGE_CUSTOMFUNCTION_SHOW是「谁先展开谁吃掉」的一次性 define——Pages.nsh里MUI_PAGE_FUNCTION_CUSTOM展开成Call <fn>紧跟一句!undef。引擎原先把安装页的 SHOW 回调AwdInstFilesShow(负责把主窗收成角落小卡片)挂在AWD_UI_PAGE_WELCOME宏里,赌「紧随其后的就是MUI_PAGE_INSTFILES」。Office 插件安装器确实如此,桌面端不是。electron-builder 的
assistedInstaller.nsh页序是:中间那张「安装模式」页(
perMachine=false才有)在编译期先把 SHOW 吃掉并!undef;而它自己又被本仓的customInstallMode($isForceCurrentInstall=1)在 PRE 里Abort跳过,那句Call AwdInstFilesShow连跑都不会跑。两头都不响,回调从未执行——安装页于是保持 NSIS 原生形态。CI 一直全绿是因为
ui-harness走的是「欢迎页紧贴 INSTFILES」的理想页序,且「点完立即安装」那一步只截图不断言。修法
AWD_UI_INSTFILES_HOOK(只 define)与AWD_UI_PAGE_INSTFILES(钩子 + 页的原子宏),欢迎页宏不再偷偷挂钩子;ui-harness/ Office 插件安装器改用原子宏,页序由自己掌握,抢不走;customPageAfterChangeDir——那是唯一紧贴 INSTFILES 之前的钩子。升级 electron-builder 要回核这个页序(注释里已写死这条契约)。红绿两轮(同一份用例代码,测试代码未变)
harness-eborderprogress card: 760 x 568, native back button visible=True红轮的
shots/eborder/03-progress.png与用户实机截图同形(进度条贴顶 + 「上一步」飘在中间)。回归护栏
ui-harness.nsi新增-DEB_PAGE_ORDER:按multiUserUi.nsh逐句复刻那张「运行期被 Abort 跳过、编译期照吃 MUI 定义」的页,smoke 工作流多编一个harness-eborder.exe实跑;installer-smoke.ps1在「点完立即安装」后真做断言了:窗口宽度必须缩到小卡片,原生「上一步」按钮(IDC 3)必须不可见。老坑之所以能瞒过去,就是因为这一步只截图。地雷入档
.claude/agents/eng-infra.md6.5.5。dev-board#356
🤖 Generated with Claude Code