Repository navigation
[Bug][Desktop/Windows] 应用内更新:安装器已启动但重命名安装目录失败(MoveFileExW error 32),失败后静默退出、不提示、不重启 #12974
Replies: 2 comments
|
相同的问题 |
|
补充一份独立复现 + 代码侧定位(与 #12974 同一缺陷,2026-11-11 22:04–22:11,另一台机器)。 环境
复现三次应用内更新(22:04:20 / 22:07:52 / 22:11:36)各生成一份 22:11:56 应用被重新拉起,版本仍是 rc.1。 关键测量:不是“重试太快”,而是重试窗口被耗尽
代码侧事实
建议(按优先级)
变通(已验证)退出 DSH(托盘退出),最后在任务管理器结束所有 English summaryIndependent reproduction of the same Windows in-app update failure: Measured: the configured retry window is 11.25 s of sleeps (13.8 s wall clock in a controlled analogue) and is fully exhausted, so this is a sustained directory lock, not a transient one — a longer window only delays the failure.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
环境
DSH Desktop 0.2.2-rc.1 → 0.2.2-rc.2(nightly feed,
win-x64)Electron 44.7.0(安装目录
version文件)Windows 11 Home China,
10.0.26300x64安装方式:electron-builder NSIS per-user,路径
%LOCALAPPDATA%\Programs\DeepSeek Harness无 UAC 提权,
isAdminRightsRequired: false复现步骤
应用内出现 0.2.2-rc.2 更新提示,点「安装」;
应用退出,安装器启动(静默,无界面);
约 30–60 秒内无任何提示,应用也没有重新打开;
手动启动应用,版本仍是 0.2.2-rc.1,更新提示再次出现;
重复 3 次(20:10:10 / 20:11:12 / 20:12:55),全部失败。
预期 / 实际
预期:安装完成并自动重启到新版本;至少失败时要有明确提示。
实际:安装器在「替换旧安装目录」阶段失败,静默退出;UI 无反馈;应用不重启。
证据
%LOCALAPPDATA%\@deepseek-aidsh-desktop-updater\installer-logs\下三次各生成一份directory-failure-*.log,内容一致:Restoration error: 0且磁盘上没有产生任何.old-*目录 → 替换没有发生,属于干净失败,不是半更新。安装包本身可证清白:
deepseek-harness-0.2.2-rc.2-win-x64.exe,299,659,528 字节,与update-info.json的 sha512 一致,Authenticode Valid(CN=Hangzhou DeepSeek Artificial Intelligence Co., Ltd.)。附件中的日志已做两处中性化:系统账户目录名替换为
<user>;系统错误消息原文为中文(另一个程序正在使用此文件,进程无法访问。),附件里改用英文等价句,其余逐字未改。时间线(2026-11-11)
时间 事件
20:08:12–20:08:25 下载完成(
pending\...exe+update-info.json)20:10:10 第 1 次安装失败(error 32)
20:11:12 第 2 次安装失败
20:12:55 第 3 次安装失败
20:49:57 先
taskkill /F /T /IM "DeepSeek Harness.exe"结束全部进程,再运行同一个安装包20:50:41 安装成功,自动启动,版本变为 0.2.2-rc.2
同一安装包、同一台机器,唯一变量是「安装目录里是否还有残留进程」——根因可确认。
根因分析
NSIS 更新流程第一步是把旧安装目录
MoveFileExW改名为.old-{GUID};目录内只要有任一文件句柄未释放,Windows 即返回 32(ERROR_SHARING_VIOLATION)。DSH 桌面端用同一个
DeepSeek Harness.exe以ELECTRON_RUN_AS_NODE=1运行 dsh 运行时(见resources\runtime\bin\node.cmd、runtime\bin\node)。这类子进程不随主进程退出而结束,句柄仍留在安装目录内。quitAndInstall()只等主进程退出,不等待整棵进程树;安装器随后改名,必然撞上 32。安装器的 10 次重试是快速重试(数秒内完成),等不到句柄释放,最终静默退出;应用没有把安装器退出码或
installer-logs回传 UI,也没有重新拉起应用。附带问题
安装成功后 updater 缓存没有清理:
@deepseek-aidsh-desktop-updater下遗留 572 MB(installer.exe与pending\各约 300 MB)。连续失败 3 次后再点应用内「安装」,安装器不再启动,直接弹错误(此时没有新的
installer-logs),疑似 pending 状态与缓存不一致;用户只能自己结束进程。建议修复
quitAndInstall前结束并等待整棵进程树(含ELECTRON_RUN_AS_NODE子进程)退出,并设置超时;超时或安装器非 0 退出时:明确提示 + 自动重启旧版本,不要静默;
安装成功后清理 updater 缓存与 pending 状态;
目录仍被占用时,可改为「解压到临时目录 + 下次启动替换」,或交给独立 helper 在应用退出后执行替换。
变通做法(已验证有效)
托盘退出,并在任务管理器结束所有
DeepSeek Harness.exe(会有多个,node 子进程同名);直接双击
%LOCALAPPDATA%\@deepseek-aidsh-desktop-updater\pending\deepseek-harness-0.2.2-rc.2-win-x64.exe;安装完成后版本变为 0.2.2-rc.2。
相关讨论
#9963 Windows desktop: GUI update always fails — Host never exits(安装器从未启动)
#3959 Windows 桌面更新需等待后端退出再替换 node.exe
#11032 0.2.1-rc.3 仍会在 Host 完成收尾确认后拒绝应用内更新
本报告是第三种情形:安装器已启动,但死在目录替换阶段,与上述三条互补。
English summary
On Windows the in-app update does launch the NSIS installer, but it fails at the "rename old install directory" step with
MoveFileEx error 32(sharing violation) ten times and then exits silently: no UI error, no relaunch, version unchanged. The same installer succeeds immediately if everyDeepSeek Harness.exeprocess (includingELECTRON_RUN_AS_NODEchildren) is killed first. Additionally, the updater cache retains ~572 MB after a successful install, and after three failed attempts the in-app install button fails without launching the installer at all.directory-failure-20261111-201010.log
directory-failure-20261111-201112.log
directory-failure-20261111-201255.log
update-fix.log
All reactions