You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows 自动更新静默失败:安装目录改名被拒(ERROR_ACCESS_DENIED 5),更新永远装不上
#10514
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
现象
Windows 桌面端更新静默失败:更新包已下载并通过签名/哈希校验,点"重启并更新"后应用窗口关闭、随后又以旧版本重新打开,界面上没有任何报错。重复 4 次(跨 2 天)都是同样结果。
版本:
0.2.0-rc.2→0.2.1-rc.2系统:Windows 10.0.26200(x64)
复现
日志在
%LOCALAPPDATA%\@deepseek-aidsh-desktop-updater\installer-logs\:安装器还会残留
DeepSeek Harness.new-{GUID}目录(约 1 GB/次),以及%LOCALAPPDATA%\@deepseek-aidsh-desktop-updater\installer.exe副本。定位
apps/desktop/scripts/installer-directories.nsh的dshPromoteDirectories(约 L170–L216)在安装前把现有安装目录改名为<INSTDIR>.old-<GUID>做备份;dshDirectoryOperation对 5/32/33 重试 10 次(累计约 11 秒);失败后dshRollbackDirectories回滚并Quit,旧版本被重新拉起。更新以/S静默方式运行,customInstallerDirectoryFailed(installer.nshL198–L227)不弹窗,于是用户只看到"闪退 + 版本没变"。关键点:本机即使在零 DeepSeek Harness 进程时,该目录也无法改名:
Directory.Move(安装目录, …)Access to the path … is denied(与安装器 error 5 一致)Programs\下新建目录并改名icacls/Get-AclSYSTEM、Administrators均FullControl(继承),无 Deny、无只读属性、非 junction也就是说:目录内部完全可写,只有"整目录改名"被外部(非本应用进程)持久拒绝。当前实现没有降级路径,所以只要改名被拒,已下载的更新就永远装不上。
建议修法
思路:改名失败时不要放弃,用已经完整解包到
<INSTDIR>.new-<GUID>的暂存树做就地发布(不移动目录本身)。我在本机手工验证过这条路径可行(杀掉应用 → 清空安装目录内容、保留卸载器 → 用解包出的 0.2.1-rc.2 文件覆盖 → 修注册表 DisplayVersion),升级成功且运行正常。
对应补丁(约 44 行,只改
installer-directories.nsh):在
dshPromoteDirectories的backup失败分支先调用它,成功即跳过promote继续安装;失败才走原有回滚与失败报告。用/PURGE清掉旧版本独有文件,发布后用${APP_EXECUTABLE_FILENAME}校验。(我未能在本地编译/冒烟验证该补丁——没有该仓库的 Windows 打包链路;建议由 CI 的
apps/desktop/scripts/test-windows-installer.mjs+windows-installer-smoke.ps1覆盖,并补一个"目录改名被拒"的 fixture:在安装目录上保持一个未共享 delete 的句柄,断言仍能装出可运行版本。)另一个小建议
即使改名最终失败,也建议让静默安装留下用户可见的结果(例如写一个
update-failed.json供应用启动后提示),避免"闪退但版本没变"的无声失败。(完整补丁附在下方,可直接
git am应用。)完整补丁(安装器就地发布降级,+44/-0)
All reactions