今天是个好日子,
在使用 Wix 时,我很难解决以下错误消息:提示容器来源:WixAttachedContainer
场景:
- 我们有一个带有默认 Wix 模板的安装项目,它充当多个包的捆绑包,称为 MyBundle.exe。
- 我们有一个带有 WPF 和 C# 的托管引导程序应用程序 wix exe,它充当独立的安装程序,但这需要包含在上述捆绑包中,称为 MyApp.exe。
- 安装 MyBundle.exe 时会正确安装 MyApp.exe。
- 当卸载 MyBundle.exe 并具有 DetectCondition 来卸载 MyApp.exe。MyApp.exe 被正确删除。
问题:
- 在某些情况下,MyBundle.exe 将被删除,但必须将 MyApp.exe 安装在后面。
- 删除 MyBundle.exe 并尝试删除 MyApp.exe 后,我在日志中收到以下错误:提示容器来源:WixAttachedContainer,路径:“Path_To_EXE”
如果我将 MyApp.exe 作为独立安装并卸载它,一切正常。如果我在删除 MyBundle.exe 之前安装 MyBundle.exe(MyBundle.exe 中包含 MyApp.exe)并卸载 MyApp.exe,这也可以正常工作。
我已经阅读了出现错误的 MyApp.exe 的日志,我发现 MyApp.exe 正在尝试访问 MyBundle.exe 的缓存文件夹 提示容器来源:WixAttachedContainer,路径:C:\ProgramData\Package Cache\ {Bundle_GUID}\Dependencies\MyApp.exe 但此时,该文件夹已不在系统上。
MyBundle.exe中ExePackage的配置如下:
<ExePackage Id="MyApp_Package"
Description="MyApp Package"
DisplayName="MyApp Package"
SourceFile="My_Path_To_Package"
Compressed="yes"
Permanent="yes"
PerMachine="yes"
Vital="yes"
Cache="yes">
</ExePackage>
我尝试了几种标签Permanent,Cache的组合,但仍然没有效果。
我已经尝试按照如下说明连接到 MyApp.exe 上的 C# 代码中的 ResolveSource 方法: Managed Bootstrapper Application "Failed to resolve source for file"但没有成功。
你们中的任何人都可以指出我正确的方向吗?
更新:MyBundle.exe 和 MyApp.exe 以及包含的 msi 都是使用 signtool 签名的。
谢谢。