How to execute Custom Action before RemoveExistingProducts with After=“InstallValidate” in WiX

我们两清 提交于 2019-12-03 08:34:53

Unfortunately you cannot run an elevated custom action before RemoveExistingProducts with your current configuration.

Some possible approaches would be:

  1. Move RemoveExistingProducts right before InstallFinalize. This solves the custom action problem, but other problems may occur since this approach has many restrictions (the components need to maintain their names and GUIDs between versions, your custom actions should be aware that the upgrade is performed at installation end etc.).

  2. Create an EXE bootstrapper which fixes the old installer before launching the new MSI. This bootrapper can require Administrator privileges through a manifest:

http://msdn.microsoft.com/en-us/library/bb756929.aspx

  1. Repair the broken MSI by using this method:

    • fix the problem in the old MSI
    • create a BAT or EXE bootstrapper which recaches it through this command:

    msiexec /fv <path_to_msi>

    • distribute this MSI as an update before your new package

When your new package runs RemoveExistingProducts, the old cached MSI should be fixed and it should uninstall correctly.

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