cancel
Showing results for 
Search instead for 
Did you mean: 
Mageracer
Pilgrim

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
Pilgrim

Re: Component Upgrade Question

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
Pilgrim

Re: Component Upgrade Question

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
Pilgrim

Re: Component Upgrade Question

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
Highlighted
rrinblue22
Pilgrim

Re: Component Upgrade Question

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
Pilgrim

Re: Component Upgrade Question

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...

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