WiX “Major Upgrade” doesn't completely install app on downgrade

后端 未结 5 1142
灰色年华
灰色年华 2020-12-10 14:54

Currently all upgrades work fine whenever updating to a newer version number, however I\'m getting an odd behavior when downgrading. It seems that it\'ll uninstall the exis

相关标签:
5条回答
  • 2020-12-10 15:17

    Allowing downgrades isn't considered best practice, at least in part because it's so hard to test every combination you'll support while it's still possible to fix them. Is it not feasible to detect and block this case instead (suggest the remove the newer version first), and only automatically support moving forward?

    If you must get this one working, is there anything in a verbose log for the downgrading install (or for the repair - you'll need to set the machine's logging policy to get this one created) which confirms the major upgrade (I'd look near FindRelatedProducts) or discusses why the component for your exe isn't installed? Definitely check for any log lines with SELMGR as they might explain this in a minor upgrade scenario.

    Since an advertised shortcut is in place, it sounds like the component was advertised instead. This could indicate component rules violations in a minor upgrade (specifically the addition of a component in a newer version looking like the removal in your older version - see HeathS's commentary) though it appears the Product/@Id='*' should force a major upgrade.

    You might also try working in a sample project, starting from a base version that has a single feature, single component, and single file with shortcut. If relevant, add another component and file to the upgraded version; otherwise just increment the file versions. Then try your reverse scenario. Slowly add things in until you find your culprit. Then hope it's something you can remove from your real product, or can otherwise be worked around.

    0 讨论(0)
  • 2020-12-10 15:17

    My suggestion is a little on the "make it work" side - you could try a silent repair custom action in case of downgrade.

    0 讨论(0)
  • 2020-12-10 15:32

    What happens if you use two "UpgradeVersion" elements?

    <UpgradeVersion Maximum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMaximum="no" />
    <UpgradeVersion Minimum="CurrentVersion" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="no" />
    
    0 讨论(0)
  • 2020-12-10 15:34

    This is what worked for me:

    <Wix ...>
      <Product ...>
        <Property Id="REINSTALLMODE" Value="amus" />
        <MajorUpgrade AllowDowngrades="yes" />
    
    0 讨论(0)
  • 2020-12-10 15:35

    How did you order the operations in your InstallExecuteSequence?

    If you perform the uninstall after the install (which gives you the best upgrade performance) you might see issues if file versions change to lower versions; which could be the case on your downgrades.

    Windows installer will not overwrite older versions with newer versions unless explicitly asked.

    Reordering to uninstall before installing should help if this is the case.

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