Detecting MajorUpgrade in Wix 3.8
Asked Answered
S

2

4

I am installing all new versions of my software as major upgrades, as the installations are very small and most of the time, all files change anyway.

I would like to skip one dialog in the installer, if an upgrade as compared to a fresh installation is done, but so far I have failed to figure out what conditional (like "Installed AND PATCH") in the following example to use.

     <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" 
              Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
Sabol answered 23/6, 2014 at 6:2 Comment(1)
Change "AND PATCH" to AND (NOT PATCH) to prevent the dialog from showing up in a patch upgrade.Rebutter
R
5

You need to show us your major upgrade element or your upgrade elements in the WiX for details, but the way you detect that you're doing an upgrade is to use the upgrade property name. Sometimes the name is PREVIOUSVERSIONSINSTALLED, but if you used the MajorUpgrade elements it sets a property called WIX_UPGRADE_DETECTED.

http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html

That means the condition in your dialog will be:

Not WIX_UPGRADE_DETECTED

if you want to suppress the dialog. You don't want PATCH because you are not doing anything at all related to patches.

Ruth answered 24/6, 2014 at 18:13 Comment(0)
B
0

You can identify a major upgrade by the special property UPGRADINGPRODUCTCODE.

The condition listed: (Installed AND PATCH) should make the dialog show only during patch installs though?

Check this cheat sheet of MSI conditons from Installshield. It is not complete, but better than nothing.

Bueschel answered 23/6, 2014 at 8:20 Comment(3)
UPGRADINGPRODUCTCODE seems not to work in that context - and knowing what to look for, I might have found out why: "UPGRADINGPRODUCTCODE is set only for the hidden uninstallation of a package found via the Upgrade table and FindRelatedProducts/RemoveExistingProducts. This does not show any UI, so conditioning control events off of this property will not be helpful. By contrast UPGRADINGPRODUCTCODE is not set for the newer installation." I wonder anyway why "Installed" does not work ...Sabol
I don't get why you have Installed AND PATCH - that would mean the dialog is only shown for patch installs?Rebutter
Sorry, "Installed AND PATCH" was just taken from the original dialog set, as an example. It has nothing to do with my installation. "Installed" alone does not work, however ...Sabol

© 2022 - 2024 — McMap. All rights reserved.