diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index c73faa820c..42d19308fc 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -54,8 +54,8 @@ en: cfd5780dd26a8e46 zh: f7a16b1ede793b7b /deepseek-harness-desktop/package/windows-installer-interface: - en: 94ddb11f514d8dea - zh: 15021ae8e3bc8a9c + en: 1fc1db8f54475c8f + zh: dd834ed206070396 /deepseek-harness-desktop/package/windows-ev-signing: en: 8efe3498dbe8686d zh: a88c16f20a9430f3 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 79101fc002..1657622238 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -327,7 +327,7 @@ The command requires `DSH_DESKTOP_APP_ID` and the normal build dependencies, inc ### Windows installer interface -The Windows installer uses native NSIS pages with light and dark palettes, system shadows, an editable installation directory, and a finish page whose launch checkbox is selected by default. Installation is restricted to the current user. Clicking Install or pressing Enter validates the current path; new destinations must be empty, and nonempty destinations must be registered installations. Running executables at the affected installation path produce a native prompt and remain running; same-named applications in other directories do not block installation. Silent updates wait up to ten seconds for the affected application to exit, then stop with exit code 2 if it is still running. +The Windows installer uses native NSIS pages with light and dark palettes, system shadows, an editable installation directory, and a finish page whose launch checkbox is selected by default. Installation is restricted to the current user. Clicking Install or pressing Enter validates the current path; drive roots remain invalid after normalization, including repeated trailing separators. New destinations must be empty, and nonempty destinations must be registered installations. Running executables at the affected installation path produce a native prompt and remain running; same-named applications in other directories do not block installation. Silent updates wait up to ten seconds for the affected application to exit, then stop with exit code 2 if it is still running. The theme follows Windows at startup; `/THEME=light`, `/THEME=dark`, and `/THEME=auto` select a palette explicitly. The window appears after its branded controls are ready. When the welcome page first appears, the installer moves above ordinary windows once and flashes its taskbar button if another window has focus; it does not remain always on top. Progress reads the pinned 7-Zip extractor’s percentage; directory promotion, registration, and cleanup retain bounded estimates. The weighted percentage does not predict remaining time. After NSIS reports success, the bar fills over 600 ms and displays 100% briefly before the finish page appears; the transition targets 750 ms. The finish page preserves the window position. Finish dismisses the installer before launching the installed executable; a launch failure restores the page for retry. Directory replacement and failure recovery follow the installation flow described above. First-launch profile preparation remains a separate Desktop operation. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 190e5bc816..a5e6f3b4c2 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -329,7 +329,7 @@ pnpm run package:desktop:win:x64:unsigned ### Windows 安装界面 -Windows 安装程序使用原生 NSIS 页面,提供亮暗配色、系统阴影、可编辑的安装目录,以及默认勾选立即启动的完成页。安装仅面向当前用户。点击安装或按 Enter 均校验当前路径;新安装位置必须为空,非空位置必须是已登记的安装目录。受影响安装路径中的程序运行时显示系统提示,并保持应用运行;其他目录中的同名应用不阻止安装。静默更新最多等待受影响应用退出十秒,若仍在运行则以退出码 2 结束。 +Windows 安装程序使用原生 NSIS 页面,提供亮暗配色、系统阴影、可编辑的安装目录,以及默认勾选立即启动的完成页。安装仅面向当前用户。点击安装或按 Enter 均校验当前路径;路径规范化后仍拒绝磁盘根目录,包括带重复末尾分隔符的写法。新安装位置必须为空,非空位置必须是已登记的安装目录。受影响安装路径中的程序运行时显示系统提示,并保持应用运行;其他目录中的同名应用不阻止安装。静默更新最多等待受影响应用退出十秒,若仍在运行则以退出码 2 结束。 主题在启动时跟随 Windows;可用 `/THEME=light`、`/THEME=dark` 和 `/THEME=auto` 显式选择配色。窗口在品牌控件准备完成后显示。欢迎页首次出现时,安装窗口会一次性移到普通窗口前方;若焦点在其他窗口,任务栏按钮会闪烁提示,但安装窗口不会始终置顶。进度读取锁定版本的 7-Zip 解压器百分比;目录替换、注册和清理仍使用有界估算。加权百分比不代表剩余时间。NSIS 报告成功后,进度条用 600 毫秒补满并短暂显示 100%,再显示完成页;切换目标时长为 750 毫秒。完成页保留窗口位置。点击完成后,安装程序先隐藏窗口,再启动已安装的可执行文件;启动失败会恢复页面以供重试。目录替换和失败恢复遵循上文描述的安装流程。首次启动的配置档案准备仍属于独立的 Desktop 操作。 diff --git a/apps/desktop/installer/path.nsh b/apps/desktop/installer/path.nsh index 6d5723c196..01aafe135f 100644 --- a/apps/desktop/installer/path.nsh +++ b/apps/desktop/installer/path.nsh @@ -106,7 +106,8 @@ Function ${PREFIX}InstallerValidatePath ${GetParent} $2 $2 ${Loop} System::Call 'kernel32::GetFullPathNameW(w "$InstallerPath", i ${NSIS_MAX_STRLEN}, w .r4, p 0) i.r0' - ${If} $0 == 0 + ; Repeated trailing separators can normalize to a drive root. + ${If} $0 < 4 ${OrIf} $0 >= ${NSIS_MAX_STRLEN} Return ${EndIf} diff --git a/apps/desktop/tests/expected/windows-installer.json b/apps/desktop/tests/expected/windows-installer.json index 031352a046..a9d08b5a3c 100644 --- a/apps/desktop/tests/expected/windows-installer.json +++ b/apps/desktop/tests/expected/windows-installer.json @@ -2,6 +2,7 @@ "launchCheckboxState": 1, "nativeProgressVisible": false, "cases": [ + "canonical-drive-roots-rejected-before-ownership-check", "enter-validates-current-path-and-unchecked-launch", "completion-preserves-window-position", "welcome-ready-before-first-show", diff --git a/apps/desktop/tests/windows-installer-smoke.ps1 b/apps/desktop/tests/windows-installer-smoke.ps1 index 67a8aa38df..53404b494d 100644 --- a/apps/desktop/tests/windows-installer-smoke.ps1 +++ b/apps/desktop/tests/windows-installer-smoke.ps1 @@ -142,11 +142,13 @@ try { Click-Control $process $copy.INSTALLER_BROWSE Dismiss $process $copy.INSTALLER_CHOOSE_PATH [void][InstallerCapture]::SendMessage($window, 0x28, $edit, [IntPtr]1) - foreach ($invalidPath in @('C:\Windows\Harness Installer Test', [IO.Path]::GetPathRoot($installPath), ([IO.Path]::GetPathRoot($installPath) + '\'))) { + $driveRoot = [IO.Path]::GetPathRoot($installPath) + foreach ($invalidPath in @('C:\Windows\Harness Installer Test', $driveRoot, ($driveRoot + '\'), ($driveRoot + '\\'))) { [void][InstallerCapture]::SendMessage($edit, 0xC, [IntPtr]::Zero, $invalidPath) [void][InstallerCapture]::PostMessage($edit, 0x100, [IntPtr]13, [IntPtr]::Zero) Dismiss $process $copy.INSTALLER_PATH_INVALID } + $results.Add('canonical-drive-roots-rejected-before-ownership-check') [void][InstallerCapture]::SendMessage($edit, 0xC, [IntPtr]::Zero, $installPath) [InstallerCapture]::MoveBy($window, 73, -41) $bounds = [InstallerCapture]::Bounds($window)