🐛 fix(windows): 修复在线更新挂起与 WebView2 启动闪退

- 隐藏并释放 Windows 更新脚本进程,避免在线更新打开 cmd 并挂起
- 为更新脚本等待宿主进程退出增加超时保护
- 收窄自动 WebView2 zoom reset 触发条件并补充异常兜底
- 补充 Windows 更新启动与窗口缩放回归测试
Refs #468
This commit is contained in:
Syngnat
2026-05-16 22:13:24 +08:00
parent 6c36bd0a08
commit 0cde96844d
11 changed files with 119 additions and 7 deletions

View File

@@ -64,6 +64,7 @@ func TestBuildWindowsScriptWin10Fixes(t *testing.T) {
{"exponential backoff tier 2", `if !RETRY! GEQ 6 set /a WAIT=3`},
{"exponential backoff tier 3", `if !RETRY! GEQ 9 set /a WAIT=5`},
{"retry limit 15", `if !RETRY! LSS 15`},
{"host exit wait timeout", `if !WAIT_PID_SECONDS! GEQ 90 (`},
{"cleanup old file", `del /F /Q "%TARGET_OLD%"`},
}
for _, fix := range win10Fixes {
@@ -110,7 +111,7 @@ func TestBuildWindowsScriptUsesDelayedErrorlevelInsideBlocks(t *testing.T) {
}
}
func TestBuildWindowsLaunchCommandUsesDirectCall(t *testing.T) {
func TestBuildWindowsLaunchCommandUsesDirectHiddenCall(t *testing.T) {
cmd := buildWindowsLaunchCommand(`C:\tmp\gonavi-update\update.cmd`)
if !strings.EqualFold(cmd.Args[0], cmd.Path) && !strings.HasSuffix(strings.ToLower(cmd.Path), `\cmd.exe`) {