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

Changing Feature condition

Hi,
I have a problem with BasicMSI project: Some features have conditions for example APPSERVER=1, APPSERVER - custom Windows Installer property. I need to set the value of this property during installation user interface before features installed and depending on property value feature must be installed or not. Is it possible to do using feature conditions or is there another way to do it?
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

Feature conditions are evaluated when CostFinalize runs; from a dialog box, perhaps look into the Remove and AddLocal control events to remove and add features from the selection list?
0 Kudos
Kelly08
Level 3

I had a similar requirement of removing features based on user input. I had a lot of hassles trying to get the feature conditions to work, so I used the Remove action in the dialog control events. That has been working very well for me.
0 Kudos
alec2000
Level 3

Thank you for replies, I try to call function MsiDoAction(hMSI,"CostFinalize") it's good for functions without subfeatures, but if feature has subfeatues without any conditins, they are not installed, their size is zero in component list.Is it possible to do anything with subfeatures?
0 Kudos
alec2000
Level 3

It is impossile to add addlocal and remove control events for every needed features because some features with conditions added in project by ISWi interface and then project is built automatically. Conditions looks like PROPERTY = VALUE. PROPERTY is BasicMSI Project propety, its value assigned after parsing licence file during user interface running. as I understand it is impossible to refresh features conditions. Now I have a question: is it possible to write an installscript function, which checks all features condition strings and features with false conditions add to Remove property (How to get root feature, process feature tree) ?
0 Kudos
Nick_Umanski
Level 7

First you cannot call "CostFinalize" that is a built in action called automatically.

Second a sub feature cannot be installed if the parent feature is not installed. If you need this to happen, you have got the project design wrong, the sub feature needs to be at the same level as the original parent feature.

The answers already given are the correct ones.

If you need to collect answers from the user to condition out features, then you need to condition them out, by adding Events to the Next button action in a dialog behaviour view (Event=Remove, Argument=, Condition=(PropertyName=Value)). You may add this to the dialog that collects the user selections or at the ReadyToInstall dialog or at the CustomSetup dialog.

If you need to condition out features during a silent install for example, then you use the feature conditions (Level=0, Condition=(PropertyName=Value)) - this you can use for any method that populates the Property values prior to "CostFinalize" eg Command line parameters, .ini file, system search or a CA scheduled to run before "CostFinalize".

If you have a lot of features and conditions, then you have to add a lot of entries.
0 Kudos