我制作了一个烧录包,其中封装了 2 msi (msi1 , msi2) 。在 UI 中,我使用复选框要求用户选择要安装的 MSI。
现在,如果用户选择其中一个 msi 进行安装,安装就会顺利进行。但在卸载操作期间,刻录日志文件显示:
[][:15]: Detected package: Netfx4Full, state: Present, cached: None
[][:15]: Detected package: DummyInstallationPackageId3, state: **Absent**, cached: None
[][:15]: Detected package: msi2.msi, state: **Present**, cached: Complete
[][:15]: Detect complete, result: 0x0
[][:16]: Plan 3 packages, action: Uninstall
[][:16]: Will not uninstall package: msi2.msi, found dependents: 1
[][:16]: Found dependent: {08e74372-83f2-4594-833b-e924b418b360}, name: My Test Application
在安装场景中,我选择安装 msi2 而不是 msi1。
我的捆绑代码如下所示:
<Bundle Name="My Test Application" Version="1.0.0.0" Manufacturer="Bryan" UpgradeCode="CC2A383C-751A-43B8-90BF-A250F7BC2863">
<Chain>
<PackageGroupRef Id='Netfx4Full' />
<MsiPackage Id="DummyInstallationPackageId3"
SourceFile="msi1.msi"
ForcePerMachine="yes"
InstallCondition="var1 = 1"
>
</MsiPackage>
<MsiPackage
SourceFile="msi2.msi"
Vital="yes" Cache="yes" Visible="no"
ForcePerMachine="yes"
InstallCondition="var2 = 2"
>
</MsiPackage>
</Chain>
我的 OnDetectPackageComplete() 看起来像:
private void OnDetectPackageComplete(object sender, DetectPackageCompleteEventArgs e)
{
if (e.PackageId == "DummyInstallationPackageId3" )
{
if (e.State == PackageState.Absent)
InstallEnabled = true;
else if (e.State == PackageState.Present)
UninstallEnabled = true;
}
}
我应该怎么做才能使刻录包能够自由卸载用户在安装时选择的 msi。此外,如果我选择同时安装 msi,则卸载工作正常。
IMO, bundle 和 2 msi 的关系存在一些问题。请帮助我,因为我遇到了这个问题。
最佳答案
创建第一个 Burn Bootstrap 时,您的注册表可能会因大量试验和错误而变得困惑。我建议尝试以下方法:
- 在注册表中搜索“家属”(例如:{08e74372-83f2-4594-833b-e924b418b360})并删除这些 key
- 卸载应用程序(应该会成功)
- 在注册表中搜索您之前安装的其他 .msi 的产品代码。验证它不在注册表中。如果确实存在,请删除这些键。
- 尝试重新安装,看看是否可以正常卸载。
关于Wix 烧伤问题 : Uninstall fails saying "Found dependent",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12828514/