Wix安装器EV签名后安装报错0x80070001:缓存失败
Wix Bootstrapper签名后安装失败(错误0x80070001)解决方法
问题背景
通过Wix生成MSI,再用Wix Bootstrapper打包成exe安装包,未签名时安装正常。使用signtool结合Yubikey EV证书签名后,签名成功但安装报错,错误代码0x80070001,核心报错为无法打开WixAttachedContainer并提取 payload。
签名命令
.\signtool.exe sign /fd sha256 /tr http://ts.ssl.com /td sha256 /a "E:\Prd5-56-3-4.exe"
安装错误日志
Failed to open container: WixAttachedContainer. [3298:3008][2023-09-15T18:04:52]e312: Failed to extract payloads from container: WixAttachedContainer to working path: C:\Users\roshil\AppData\Local\Temp\{3DD6455A-2130-4F03-9AA7-2315C3BA9077}\ECDB0ABAF5AF393FFD526254943B2729C3DC92ED, error: 0x80070001. [3298:4F68][2023-09-15T18:04:52]e000: Error 0x80070001: Failed while caching, aborting execution. [4928:1160][2023-09-15T18:04:52]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{cb5bf051-f7a1-4dc6-ad66-889e94f68984}, resume: None, restart: None, disable resume: No [4928:1160][2023-09-15T18:04:52]i330: Removed bundle dependency provider: {cb5bf051-f7a1-4dc6-ad66-889e94f68984} [4928:1160][2023-09-15T18:04:52]i352: Removing cached bundle: {cb5bf051-f7a1-4dc6-ad66-889e94f68984}, from path: C:\ProgramData\Package Cache\{cb5bf051-f7a1-4dc6-ad66-889e94f68984}\ [4928:1160][2023-09-15T18:04:52]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{cb5bf051-f7a1-4dc6-ad66-889e94f68984}, resume: None, restart initiated: No, disable resume: No [3298:4F68][2023-09-15T18:04:52]i399: Apply complete, result: 0x80070001, restart: None, ba requested restart: No
解决方法
1. 修正签名顺序
Wix Bootstrapper的容器结构依赖未修改的payload文件,错误的签名顺序会破坏容器:
- 先签名所有要打包进Bootstrapper的MSI及其他payload文件
- 再用Wix Bootstrapper生成exe安装包
- 最后对最终生成的exe进行签名
2. 优化签名命令参数
EV证书需明确指定证书信息,避免自动选择错误:
.\signtool.exe sign /fd sha256 /tr http://ts.ssl.com /td sha256 /n "你的EV证书主题名称" /sm "E:\Prd5-56-3-4.exe"
/n:指定证书的主题名称(可通过signtool.exe sign /v /s MY命令列出机器存储中的证书)/sm:指定使用计算机存储(Yubikey中的EV证书通常在此)
3. 验证签名后文件完整性
签名完成后验证文件是否损坏:
.\signtool.exe verify /pa /v "E:\Prd5-56-3-4.exe"
若验证失败,需重新打包并签名。
4. 清理安装缓存
删除报错中提到的缓存路径后重试安装:
- 删除
C:\Users\roshil\AppData\Local\Temp\中对应临时文件夹 - 删除
C:\ProgramData\Package Cache\{cb5bf051-f7a1-4dc6-ad66-889e94f68984}\
5. 升级Wix版本
旧版Wix可能存在签名后破坏Bootstrapper容器的兼容性问题,建议升级到最新稳定版(如Wix 4.x)。
内容的提问来源于stack exchange,提问作者Roshil K
相关产品推荐
相关产品推荐

