Repository navigation
Windows installer cleanup follows NTFS junctions and can empty the new runtime #11517
Replies: 1 comment
|
A small data point for this thread (from a machine that hit the same "runtime empty → Host fatal" on 0.2.1-rc.5 → 0.2.2-rc.1, see #11824). Enumerating the whole install tree here ( Both timestamps are from the rc.5 reinstall after the failure (14:31Z ~ update/reinstall window, 14:36Z when
So this may be less "junction following breaks the update" and more "the update's own junction makes deletion ordering unsafe". Worth a look at the order in which |
Uh oh!
There was an error while loading. Please reload this page.
在 Windows x64 上,有一条可复现的安装器清理路径:旧安装目录内的 NTFS directory junction 会在更新收尾时被递归访问,从而删除新安装的 runtime 文件。
本机更新至 0.2.1-rc.5 后,Host 启动时读取
resources/runtime/office-skills/office/SKILL.md报ENOENT,runtime 根目录仍在但内容为空。缓存安装包的 SHA-512 与更新元数据匹配,解包后包含完整的 6,150 个运行文件。随后使用当前上游目录事务代码,在隔离目录中复现了下面的删除路径。证据来自安装文件检查和隔离复现,没有那次真实升级的完整事务跟踪。
复现路径
resources/app/runtime目录联接,绝对目标是最终安装位置的resources/runtime。Application.old-{GUID},新安装被提升到Application。联接的绝对目标仍是Application/resources/runtime。dshFinishDirectories对旧安装执行递归RMDir /r。NSIS 会跟随该联接,删除新 runtime 的内容,留下空目录。原生隔离复现中,清理程序退出 0,旧安装目录消失,同时新 runtime 的 sentinel 文件也消失;runtime 根目录仍存在。取消安装时,待安装目录内指向保留资源的联接也有相同风险。
补丁
官方 CONTRIBUTING 暂不接收外部 PR,GitHub 也拒绝了创建请求,因此按贡献指南在 Discussions 提交报告,并保留以下可审阅补丁:
补丁让更新收尾、回滚和卸载复用现有原生删除实现,只解除重解析点,不枚举其目标。新增入口将清理限定为选定安装目录及 GUID 命名的
.new-/.old-同级目录,并固定父目录句柄。双语打包文档及回归 fixture 一并更新。验证
upgrade-junction场景在普通首次安装和升级通过后失败:新 runtime 的 sentinel 已被删除。upgrade-junction和cancelled-junction。hygiene为 22 项通过、1 项失败。唯一失败为原有 vendor rescope 标记检查;在未修改的同一upstream/masterworktree 中复现相同失败。补丁没有更改 vendor 或削弱检查。签名产品安装包的真实跨版本升级仍需发布者验收。
实现、测试设计和报告由 AI 代理在作者授权下完成,详细 AI 声明和命令证据见草稿 PR。
All reactions