Discussion:
[WiX-users] multiple product codes returned from <Upgrade> code
gapearce
2014-12-04 19:15:00 UTC
Permalink
I apologize ahead of time for this ancient usage example, but this is legacy
code I am afraid to change ;-)

Note that ProductVersion is defined by me and is something like "1.0.0.99" -
and I know MSI disregards the last level of this version info. Also note
that this MSI is installed "Per Machine".

Suppose I have this kind of thing going on:

<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)"
IncludeMinimum="no"
Property="NEWERPRODUCTFOUND" />
<UpgradeVersion Minimum="0.1.0"
IncludeMinimum="yes"
Maximum="$(var.ProductVersion)"
IncludeMaximum="no"
Property="UPGRADEFOUND" />
<UpgradeVersion Minimum="$(var.ProductVersion)"
IncludeMinimum="yes"
Maximum="$(var.ProductVersion)"
IncludeMaximum="yes"
Property="SAME_VERSION" />
</Upgrade>

After this runs, I have a CA that does some things, and it "reads" the
"UPGRADEFOUND" property. On occasion, I see two product codes in there when
there is (I think) just one product to upgrade. These multiple product
codes are separated by a semi-colon.

Note that my MSI has one UpgradeCode which never changes, and 4 ProductCodes
that do change each time the thing is built. There is one product code
generated for each language transform that is embedded in it, and I know
that I could restrict what is returned in UPGRADEFOUND by specifying the
"Language=" element for UpgradeVersion element, but I have not done that
yet.

So I'm wondering how to properly handle this condition.

I think I could see more than 1 product codes in UPGRADEFOUND if the (same
or different) user installed the product in different languages. Like 2
guys using the same computer, one in English, and one in French?

If I put Language elements in the Upgrade element, this would limit what is
returned, but how do I prevent users from installing the same version number
twice on the same machine when they have different product codes (but same
upgrade code)?

Under what conditions would there be multiple product codes in that
UPGRADEFOUND variable?
Is there any order to the appearance of the product codes returned in the
UPGRADEFOUND variable?

Thanks in advance.
GAP



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-product-codes-returned-from-Upgrade-code-tp7598400.html
Sent from the wix-users mailing list archive at Nabble.com.
Nick Ramirez
2014-12-05 16:04:02 UTC
Permalink
It looks like what you have is correct. You have a SAME_VERSION property.
Although you might want to set OnlyDetect to yes if you want to keep the
existing product there and not overwrite it.

Then, use a launch condition to stop the new installation from going through
if SAME_VERSION is found. The new element, MajorUpgrade, does all of this
for us, but that's how it's done by hand.




--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-product-codes-returned-from-Upgrade-code-tp7598400p7598433.html
Sent from the wix-users mailing list archive at Nabble.com.
Phil Wilson
2014-12-05 17:47:26 UTC
Permalink
There's nothing to prevent multiple products being returned - it just
means there are several installed products on the system that share
the same UpgradeCode. In your case, I guess Nick is saying that one of
the multiples returned might be your own. It looks like the different
languages all share an UpgradeCode, so there may also be two language
products installed. The list is returned by Windows Installer so
there's nothing you can do about the format.

In these situations it's my experience that each language will have a
unique UpgradeCode because most people don't want (say) an English
version to upgrade a French version. Using OnlyDetect for the other
UpgradeCodes can be used to prevent side by side installs of different
languages.
---------------
Phil Wilson
Post by Nick Ramirez
It looks like what you have is correct. You have a SAME_VERSION property.
Although you might want to set OnlyDetect to yes if you want to keep the
existing product there and not overwrite it.
Then, use a launch condition to stop the new installation from going through
if SAME_VERSION is found. The new element, MajorUpgrade, does all of this
for us, but that's how it's done by hand.
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-product-codes-returned-from-Upgrade-code-tp7598400p7598433.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
gapearce
2014-12-06 05:17:28 UTC
Permalink
Thanks for the help Nick and Phil!

You guys have helped me a lot here. I am beginning to see the light.

I've got SAME_VERSION set to NOT only-detect because we use the 4th part of
the version number for upgrades. I've got to allow version 1.0.0x150 to
upgrade 1.0.0x149, for example.

I have a custom action that runs after FindRelatedProducts which manipulates
the SAME_VERSION, NEWERPRODUCTFOUND and UPGRADEFOUND properties based on the
4th part of the version number. We've basically implemented 4th
part-of-the-version-number support for development builds.

I'm hoping that the "Language=" element of the UpgradeVersion element will
help here because I read somewhere that MSI will return only the product
number that has this specified language ID. Then I should get just one
product code in "UPGRADEFOUND".

I have not tested this yet though - tomorrow's task.

I really don't want to (can't?) change upgrade codes for each language
version now, or at least I have not thought this all the way through yet.
This product got released already, so I have to deal with existing installs.

And Phil! Separate upgrade codes for different languages?
Great Idea! This sounds like the right way to do it.
I will do that next time. ;-) (Boo hoo - I wish I would have thought of
that sooner!)

Any insight you guys might have into this aspect of it would be greatly
appreciated.

Thanks again,
GAP




--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-product-codes-returned-from-Upgrade-code-tp7598400p7598456.html
Sent from the wix-users mailing list archive at Nabble.com.

Continue reading on narkive:
Loading...