Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How Can I Install a Feature Conditionally Based on


5 replies to this topic

Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 26 July 2012 - 14:00

Hi all,

I'm trying to install a Feature conditionally based on &OtherFeature=3 as its condition.

I'm thinking this isn't going to work as my testing is not looking good.

I'm also building x32 and x64 from the same template.

Here's my Features...

Common (Release Flag = Common)
Server (Server)
Server32 (Server32)
Server64 (Server64)
P2A (P2A)
P2A32 (P2A32)
P2A64 (P2A64)
RealD32 (RealD32)
RealD64 (RealD64)

The release flags settings are...

32 Bit = Common,Server,P2A,P2A32,Server32,RealD32
64 Bit = Common,Server,P2A,P2A64,Server64,RealD64

To totally explain this web would take forever. The RealD features are based on the installation of P2A. If P2A is being installed, RealD should NOT. My conditions on these are...

&P2A<>3 OR !P2A<>3

Also, the P2A32 & 64 features are to be installed if P2A is being installed. Those conditions are...

&P2A=3

My guess is that I will need to create a custom action to modify the ADDLOCAL property accordingly. Does this sound right or is there a way to put the conditions on the Features?

Let me know if clarification is needed.

Any help more than appreciated!

Edited by Superfreak3, 26 July 2012 - 14:46.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 July 2012 - 14:59

"The expression in the Condition column should not contain reference to the installed state of any feature or component. This is because the expressions in the Condition column are evaluated before the installer evaluates the installed states of features and components. Any expression in the Condition table that attempts to check the installed state of a feature or component always evaluates to false."

Also note that feature conditions are evaluated during CostFinalize (i.e. before the dialogs are shown) and they change the level number of the feature. So the actual effect also depends on the value of the INSTALLLEVEL property.

You can use AddLocal and Remove control events on the "Next" button of a dialog to modify feature selection.



Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 27 July 2012 - 13:55

Thanks! I think that is what I need.

So, you're saying I have to deal with both? For the Features to be installed conditionally, should I set their InstallLevel so it won't be installed then adjust on the dialog control with events like the install state?

Edited by Superfreak3, 27 July 2012 - 14:01.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 July 2012 - 16:41

No, if you need to select/unselect features after CostFinalize, feature condition won't work. Instead you can sue the control events to select/unselect features. InstallLevel doesn't matter at this point.

Superfreak3

Superfreak3
  • Full Members
  • 437 posts

Posted 27 July 2012 - 20:22

But for features that are not installed in all instances should have an InstallLevel greater than that set for INSTALLLEVEL, correct. In this instance, I have my RealD feature set to 102.

Then I just add an AddLocal event and condition with the state of the conditional feature or in my example....

RealD is conditionally installed based on the state of P2A. It should not be installed if &P2A=3 so I condition the AddLocal event for RealD with

&P2A<>3 OR !P2A<>3.

The later is added as we have other features that may be installed via Maintenance so if P2A is already installed, RealD shouldn't get installed.

Am I on the right track?

Edited by Superfreak3, 27 July 2012 - 20:25.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 30 July 2012 - 09:17

Yes, that looking good.
You may also need to add a Remove control event for RealD with the opposite condition, in case users go back to the feature selection dialog and select P2A (after your AddLocal control event ran when they visited that dialog fopr the first time without selecting P2A).