Wix Burn: Custom Bootstrapper upgrade but Installs side by side with older version

可紊 提交于 2019-12-22 23:00:16

问题


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

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

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.

I also tried with

_bootstrapper.Engine.Plan(LaunchAction.UpdateReplace);

and

_bootstrapper.Engine.Plan(LaunchAction.UpdateReplaceEmbedded);

but it has no effect.

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

Regards


回答1:


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

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.

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.

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




回答2:


I also experienced this problem. I had to write my own managed bootstrap application. I had a bug where I was kicking off the Plan() phase before the Detect() phase finished.

Hence the old bundle was not uninstalling as it should have.

It is good practice to implement a handler for every event that the Bootstrapper offers. Write a log entry in every handler listing out the arguments supplied to the handler. It makes chasing down errors a lot easier.

In my case I was migrating from InstallShield 2009 to WiX 3.10 and I had to write my own managed bootstrapper because I had to conditionally install SQL Server express based on user inputs from a fancy WPF boostrapper.



来源:https://stackoverflow.com/questions/21854653/wix-burn-custom-bootstrapper-upgrade-but-installs-side-by-side-with-older-versi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!