本文介绍了Wix Burn:自定义引导程序升级但与旧版本并排安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力解决我的自定义引导程序升级问题.通过关注此线程,我正在使用 LaunchAction.Install.

I'm struggling with my Custom Bootstrapper Upgrade issue. By following this thread, I'm using LaunchAction.Install.

这会升级产品和 Boostrapper,但旧的 Bootstrapper 仍然存在,如下面的屏幕截图所示.

This does Upgrade the Product as well as Boostrapper, but older Bootstrapper remains there, as shown in following screen shot.

如果我从这里调用 1.0.0.0 版,它会显示 Dialog to Install,但什么也不做.但是,调用 1.0.1.0 版可以让我选择卸载产品.但是,在卸载时,它只会自行删除,而留下我的产品".

If I invoke ver 1.0.0.0 from here, it would display Dialog to Install, but would do nothing. However, invoking ver 1.0.1.0 would give me the option to Uninstall the product. However, upon Uninstall, it would only remove itself, and "My Product" is left behind.

我也试过

_bootstrapper.Engine.Plan(LaunchAction.UpdateReplace);

_bootstrapper.Engine.Plan(LaunchAction.UpdateReplaceEmbedded);

但是没有效果.

问题:如何升级旧安装而不出现上述情况?任何人都可以提供 CustomBA 升级的工作示例吗?

Question: How to upgrade older installation without falling in above situation? Can anyone please provide a working example of CustomBA upgrade?

问候

推荐答案

检查 PlanRelatedBundle 事件.您可以在其中告诉引擎如何处理旧包.

Check the PlanRelatedBundle event. Its where you can tell the Engine what to do with the old bundles.

如果您想要一个 Bundle 来替换旧的 Bundle,则两者的 UpgradeCode 应该相同.在这种情况下,它将默认卸载旧包.此外,旧包需要支持静默卸载,因为它会在安装新包后使用参数/quit 调用.

If you want a Bundle to replace the old one the UpgradeCode should be the same for both. In this case it will uninstall the old bundle as default.Also the old bundle needs to support quiet uninstallation since it will be called with the argument /quit after installing the new one.

您可以在 BootstrapperApplication.Command.Display 属性中检查它.如果它是从另一个 Bundle 调用的,它应该是嵌入的".在这种情况下,BootstrapperApplication.Command.Action 设置为卸载".

You can check it in the BootstrapperApplication.Command.Display property. It should be "Embedded" if its called from another Bundle. The BootstrapperApplication.Command.Action is set to "Uninstall" in this case.

如果这些都不起作用,请检查在 AppData\Temp 文件夹中创建的日志.

If nothing of this works check the logs that are created in the AppData\Temp folder.

这篇关于Wix Burn:自定义引导程序升级但与旧版本并排安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:52