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

后端 未结 1 389
你的背包
你的背包 2021-02-09 15:01

I have something like this:


  

相关标签:
1条回答
  • 2021-02-09 15:45

    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.

    0 讨论(0)
提交回复
热议问题