Wix Tools update uses old custom actions

后端 未结 2 1262
星月不相逢
星月不相逢 2020-11-28 16:59

we\'ve discovered some strange behavior using WIX Setup Tools. We have deployed some major versions (2.2.0 - to 2.2.4). For 2.2.5 we changed a small things in custom action

2条回答
  •  清酒与你
    2020-11-28 17:36

    You should be more specific about what you mean by "update" because it could be a patch, minor upgrade, major upgrade. If it's a major upgrade you should say where it's sequenced. However there are two general reasons why custom actions from a previous version might run:

    1. Brian's comment/answer - they were conditioned incorrectly in that original install, and when the update goes through the sequences in the older install it finds that the condition evaluates true. If you like, there are no such things as install custom actions or uninstall custom actions: there are only custom actions with conditions. In the WiX source that was posted as an update, the use of UPGRADINGPRODUCTCODE is not correct. This property is set in the older product when it is being uninstalled during a major upgrade, so any condition in the old install that says "or UPGRADINGPRODUCTCODE" will be true. If you want a condition that is set in the upgrade install when it is upgrading an older produce then use WIX_UPGRADE_DETECTED, as used by the MajorUpgrade element.

    2. The act of doing an update has caused a repair of the older product and therefore it has run the custom actions, and they might even have a correct condition. If, for example, a binary file has been replaced and is a candidate for replacement during your update, then Windows Installer will repair and restore the binary that doesn't match so it can decide whether to install the one from the update. This will reinstall the feature containing that binary. Custom actions conditioned on feature or component install could therefore run.

    Also, to extend Stein's answer, Windows Installer and WiX have a move (see the CopyFile element). And why install a file to one location and immediately move it to another location? I assume there's a reason for not simply installing it and the final location without doing a move?

提交回复
热议问题