invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Setting Install State for New Feature when Updating OldSetup

- Product 1.0 is in the field.
- Product 1.1 setup has the user select Value A or Value B which affects setup by setting in the following way:

Code: Select all

	If Session.Property("VALUE") = "A" then
		Session.FeatureRequestState("FeatureX") = msiInstallStateAbsent 
		Session.FeatureRequestState("FeatureY") = msiInstallStateLocal 
	end If

	If Session.Property("VALUE") = "B" then
		Session.FeatureRequestState("FeatureY") = msiInstallStateAbsent 
		Session.FeatureRequestState("FeatureX") = msiInstallStateLocal 
	end If
Normally this is done in "UI Custom Action" in the UI Dialog portion of the install. But I'm confused how I handle this for existing install that will just run the update.exe version of the install.

I was thinking of manually having the user put in the HKCU registry Value = "A" as a fix for existing installs. The update.exe would read the value and based on that choose the install state for the two features.

My question is, how do I do that in an update situation? The InstallExecuteSequence is too late - setup/update is already baked. So how can I insert the install state in setup before InstallExecuteSequence is off doing its job.

Thanks.
Update: In my haste to make a clean example I neglected to user the proper case for VALUE.
Last edited by invalidptr on Tue Feb 05, 2013 12:34 am, edited 1 time in total.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Setting Install State for New Feature when Updating OldS

Hi,

First, as a recommendation, you should used public properties instead of private ones. i.e. use "VALUE" instead of "Value" as property name. Otherwise, when the property
is passed from the Install UI Sequence to InstallExecute Sequence, it gets reset to its default value, which I think you don't want.

Now back to your question. Do you ask how to get the value of the property set when installing the first version when you are installing the second version, so the user doesn't have
to make the same choice again? If so, this is very simple, all you need to do is to set the property as persistent.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”