cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mageracer
Level 3

Component Upgrade Question

Current Setup:

Version 1.0 contains Component A (a single modular assembly) installed by default.

Version 2.0 contains Component A, but it should not be installed unless we are upgrading from version 1.0. Component A 's feature is hidden.

Version 2.0 is a major upgrade from Version 1.0, and not distributed as a patch.

What is the best conditional to set on the Feature to prevent Component A from being installed except during the upgrade?
Labels (1)
0 Kudos
(5) Replies
DLee65
Level 13

Try the UPGRADINGPRODUCTCODE property.
https://msdn.microsoft.com/en-us/library/aa369786%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

I think this may do it for you.
0 Kudos
Mageracer
Level 3

DLee65 wrote:
Try the UPGRADINGPRODUCTCODE property.
https://msdn.microsoft.com/en-us/library/aa369786%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

I think this may do it for you.


OK, this is moving me forward, but can I use this value on a Feature Condition? UPGRADINGPRODUCTCODE doesn't seem to be set until the "RemoveExistingProducts" custom action is complete. Feature Conditions seem to be evaluated during "CostFinalize", but I'm not certain about this. Recommendations?

Thanks.
0 Kudos
Mageracer
Level 3

I replied earlier to this thread, but it seems to have been eaten by the forum monster. Apologies if this shows up multiple times.

UPGRADINGPRODUCTCODE is set during the "RemoveExistingProducts" action, which takes place during the Deferred Execution Script. Essentially after InstallInitialize.

Feature Conditions seem to be evaluated during "CostFinalize" (but I'm not certain about this.) which appears to need to be evaluated before InstallInitialize is run.

Since UPGRADINGPRODUCTCODE isn't set until well after the list of installed features is determined, when and where can you alter this list during the Deferred Execution Script?

Thanks.
0 Kudos
rrinblue22
Level 9

RemoveExistingProducts sets UPGRADINGPRODUCTCODE in immediate execution and if you feel that's late then you can also look at these custom properties which InstallShield sets for you (action ISSetAllUsers)

IS_MAJOR_UPGRADE and IS_MINOR_UPGRADE and for this to happen you should have set the upgrade item in your project.
0 Kudos
DLee65
Level 13

You can also look at your upgrade table for detecting previous items.
http://blogs.flexerasoftware.com/installtalk/2015/05/installshield-says-its-a-major-upgrade.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+InstallTalk+%28InstallTalk%3A+Discussing+the+Best+Practices+and+Trends+in+Software+Installation+Development%29

FindRelatedProducts will populate a property for you. It is populated before any UI objects are shown so this should work for you. You just need to know what property is set with the product GUID in this event. This should be found in the upgrade table.
0 Kudos