手动注册 ShareTarget 时 Add-AppxPackage 报 0x80070005(Win11 26H2 Insider Build 26300.9711,改卷与 DISM/SFC 修复后仍复现)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- swift
- Domain
- desktop, operating-systems
Research direction
Start by reviewing the attached AppX deployment logs, especially event 718 and the ActivityId logs from Get-AppPackageLog, then compare the failure on the E: and C: volumes. The report says staging succeeds but registration fails with 0x80070005; use the requested service status and WindowsApps ACL details to narrow down the deployment failure. Done means identifying a reproducible cause or the next diagnostic step; the issue does not identify a project code change.
Written by the indexing model from the issue text.
Description
你好,先谢谢这个项目。在一台 Windows 11 26H2 Insider 机器上,WeChatBridge 1.1.17 的官方安装器和手动注册两条路径都失败了,最终卡点统一在 Add-AppxPackage 的 HRESULT 0x80070005。已经按能想到的方向做了完整排查(卷、证书、文件完整性、组件存储、系统文件、待重启项逐项排除,见下文),仍然复现。怀疑与这台机器的 AppX 部署栈状态有关,特来请教,尤其是部署事件 718 的 PLM 初始化 0x80070005 这条线是否有已知解。完整证据在附件(已脱敏)里。
环境
- 系统:Windows 11 26H2 Insider 预览版,Build 26300.9711(Windows 10 Pro,DisplayVersion=26H2)
- WeChatBridge:1.1.17 Windows 版,官方蓝奏云包,两个 MSI 的 SHA256 与官方 SHA256SUMS.txt 核对一致
- 主 MSI
WeChatBridge-1.1.17-Windows.msi:62,996,480 字节,SHA256959AA966031A52F029E1A5C05862593B0A2A0CD63715A4C550ADC5305D40EB2E,ProductCode{1226374C-EDDA-4FF2-A262-4FA0A015B685} - 证书 MSI
WeChatBridge-1.1.17-CertificateTrust.msi:479,232 字节,SHA256281A98F74501B30D9B09B3A83FE9285BD21D9B9B8AA5DA831CF6FA95A0EA3688,ProductCode{92216FAF-3A12-449A-93EB-3DAB88307929} - 待注册包:
WeChatBridge.ShareTarget.msix,包全名WeChatBridge.Windows.ShareTarget_1.1.17.0_neutral__k2gw8zhv15c4m
- 主 MSI
- 微信:4.1.15.13
- PowerShell:5.1.26100.9711
- AppX 卷:系统卷
C:\Program Files\WindowsApps,默认卷E:\WindowsApps - 签名证书:
CN=WeChatBridge Windows Dev(项目自签名),叶子证书指纹5D4FA84DA21873846053259620653FB595E02761
复现路径一:官方安装器(WiX Burn)
运行 WeChatBridge-1.1.17-Windows-Setup.exe 共 3 次(含一次重启后重试),均在主 MSI 写 C:\Windows\Installer\inprogressinstallinfo.ipi 时被拒绝访问 0x80030005,继而 MSI Error 2503/2502、Burn 报 0x80070643 整链回滚,应用文件从未落盘。这条失败点与路径二的 0x80070005 是否同源无法判断,一并列出供参考。
复现路径二:手动拆包注册
- 从官方 Setup 内嵌 CAB 解出两个 MSI 分开直装。证书 MSI 安装成功(exit 0),叶子证书进入
LocalMachine\TrustedPeople,项目诊断脚本显示Trusted=True。 - 主 MSI 直装:不再卡
.ipi,但内置的 RegisterShareTarget 自定义动作(WixQuietExec64 调用Add-AppxPackage)报HRESULT 0x80070005(目标卷 E:),自定义动作返回 1603,整体回滚。日志见附件main_install-脱敏版.log第 61–77 行一带。 - 用
msiexec /a把 App 文件树落盘到%LOCALAPPDATA%\WeChatBridge\App(454 个文件),在用户上下文手动运行Register-ShareTarget.ps1 -CertificateTrustPrepared:仍在Add-AppxPackage(脚本第 161 行)处 FAILED,0x80070005,目标卷 E:,ActivityIdd95ac3e8-634d-0002-9033-62d94d63dd01。 - 把 AppX 默认卷从 E: 改到 C: 后重跑:仍
0x80070005,目标卷 C:,ActivityIdd95ac3e8-634d-000c-d057-62d94d63dd01(事后已把默认卷改回 E:)。 DISM /Online /Cleanup-Image /RestoreHealth(exit 0,明确修复了组件存储,无源文件错误)+sfc /scannow(exit 0,未找到任何完整性违规),确认 CBS/WU 无待重启项后重跑:仍同码同点,ActivityIdd95ac3e8-634d-0009-b558-67d94d63dd01。
至今 Get-AppxPackage(当前用户与 -AllUsers)始终查不到此包,诊断输出 RegisteredPackageCount=0,微信转发列表里不会出现「微信流」。
关键日志摘录
最近一次失败的注册日志全文(脱敏版,附件有全部 5 份 FAILED 日志):
2026-10-24T03:23:02.4409546+00:00 user=<user-SID> installRoot=C:\Users\<user>\AppData\Local\WeChatBridge\App trustOnly=False
2026-10-24T03:23:08.7053551+00:00 FAILED System.Management.Automation.PSSecurityException: 部署失败,原因是 HRESULT: 0x80070005, 拒绝访问。
从 (WeChatBridge.ShareTarget.msix) 使用程序包 WeChatBridge.Windows.ShareTarget_1.1.17.0_neutral__k2gw8zhv15c4m 中的目标卷 E: 执行的部署 Add 操作失败,错误为 0x80070005。
注意: 有关其他信息,请在事件日志中查找 [ActivityId] d95ac3e8-634d-0009-b558-67d94d63dd01,或使用命令行 Get-AppPackageLog -ActivityID d95ac3e8-634d-0009-b558-67d94d63dd01
同一时刻的 AppX 部署事件(项目诊断脚本摘录,附件有全文):
- 事件 613(性能摘要):
Failed to reach state PackagesInUseClosed;其中 Stage required cost 312 ms,Registration cost 0 ms,Repository commit transaction cost 0 ms - 事件 404 / 401:部署 Add 操作失败,错误
0x80070005 - 事件 472:失败后包文件夹被移入
E:\WindowsApps\Deleted\…(说明文件 Stage 阶段实际执行过,失败发生在注册收尾阶段) - 事件 607 / 10002:部署请求为当前用户执行、创建复原文件
- 另据安装过程的事件复核,事件 718 记录 PLM 初始化失败
0x80070005,与上述为同一失败签名
已排除项(逐项带证据)
| 排查项 | 结论 | 证据 |
|---|---|---|
| 安装包完整性 | 排除 | 两个 MSI 的 SHA256 与官方 SHA256SUMS.txt 一致 |
| 证书信任 | 排除 | 证书 MSI 安装 exit 0;叶子证书已在 LocalMachine\TrustedPeople;Collect-ShareDiagnostics 显示 Trusted=True |
| App 文件完整性 | 排除 | msiexec /a 落盘 454 个文件,出厂 Register-ShareTarget.ps1 要求的文件全部齐全;诊断中 share-target\ 两项 Present=False 已核对为仓库版诊断脚本与出厂包的路径口径差异(文件实际位于 App 根目录),非缺失 |
| 目标卷 | 排除 | 默认卷 E: 与切换到 C: 后均同码复现 |
| 组件存储损坏 | 排除 | DISM /RestoreHealth exit 0,输出「还原操作已成功完成」,无 0x800f081f 等源错误 |
| 系统文件损坏 | 排除 | SFC /scannow exit 0,「Windows 资源保护未找到任何完整性违规」 |
| 待重启挂起 | 排除 | 重跑前确认 CBS RebootPending=False、PackagesPending=False、WU RebootRequired=False |
旁证(供判断,不作结论):同一台机器上,WorkBuddy、微信、WPS 自家的 MSIX 分享目标包此前也出现过部署失败,因此怀疑问题在这台 Insider 机器的 AppX 部署栈一侧,而不是微信流的包本身。
想请教的问题
- 事件 718 的 PLM 初始化
0x80070005在你们的排查经验里通常指向什么?是 PLM/PackageManager 服务、许可证服务(ClipSVC),还是状态存储(StateRepository)层面的问题? - 失败签名是「Stage 已执行、Registration cost 0 ms、Failed to reach state PackagesInUseClosed」,是否可以理解为问题出在部署收尾的包状态登记阶段,与包内容和签名无关?
- 是否已知 Win11 26H2 Insider Build 26300 的 AppX 部署栈存在同类问题?有没有其他 Insider 用户报告过类似现象?
- 除
Get-AppPackageLog -ActivityID外,还需要补哪些诊断才能进一步定位(例如 AppXDeploymentServer 完整事件导出、相关服务状态、WindowsApps 目录 ACL)?给出清单即可,我这边可以立即按清单补交。 - 有没有绕开当前用户
Add-AppxPackage的替代注册方式值得一试(例如Add-AppxProvisionedPackage预置)?
附件说明
附件为本次全过程的脱敏版材料:手动安装记录、项目诊断脚本输出(2026-10-24 11:24 采集)、5 份 FAILED 注册日志、3 份 MSI 安装日志。机器名、用户名、用户 SID 已替换为占位符,证书指纹、包名、错误码、ActivityId、时间戳等纯技术信息保留原文。需要任何原始日志或补充信息请直接说,谢谢!
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 515
- Avg merge
- 9h 9m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from freestylefly/WeChatBridge
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
freestylefly/WeChatBridge#44 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
freestylefly/WeChatBridge#62 ·
Maintainers usually reply within 1 day
-
Insider预览版的版本检测误报Open
Difficulty 3/5 1-2 days Newbie friendliness 52/100
freestylefly/WeChatBridge#58 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
freestylefly/WeChatBridge#57 ·
Maintainers usually reply within 1 day
-
希望能增加支持TeleAgent智能体Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
freestylefly/WeChatBridge#55 ·
Maintainers usually reply within 1 day
All issues in freestylefly/WeChatBridge
Similar issues
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NobiResearch/Ovenbird#148 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
shanselman/TinyToolTown#883 ·
Maintainers usually reply within 5 days
-
area: agents
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
manaflow-ai/cmux#26908 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4149 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
paritytech/trinity-user-agents#1754 · 1 reaction ·
Maintainers usually reply within 1 day