cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RayKode
Level 6

Adding a feature “conditionally”

Hello folks.
Here's the deal.

The current version of our product has 3 features.
The new version of our product has 4 features.

By default, Feature 4 has an Install Level of 200.
(So it will not be installed automatically. It needs to be selected.)

Our Client has asked that, during a major upgrade, I look for the presence of a file on the hard drive.
If I find this file, I should install this new 4th feature.

If I don't find the file on the hard drive I should NOT install the 4th feature.

That SOUNDS simple enough.

But, I can't seem to make this happen.

I find the file on the hard drive alright.
Then I set a public property to a value of Yes.
(I do this with an InstallScript custom action.)

In Feature 4's description, I have a condition that sets the Level to 100.
Based on the condition of the public property having a value of "Yes".
(100 is the installations install level.)

It seems no matter what I do, this Fourth feature will not install during a major upgrade.

If I set the Feature description to an install level of 100, then Feature 4 installs just fine during a Major upgrade.
So, I don’t think there is an issue with the new 4th Feature.

Any ideas as to how I might proceed would be greatly appreciated.
Labels (1)
0 Kudos
(4) Replies
ElenaN
Level 6

If your major upgrade has some dialog, you can try to use AddLocal event on its “Upgrade Now” button.

Event - Addlocal
Argument - 4th feature name
Condition - public property
0 Kudos
TsungH
Level 12

You will want to take a look at the verbose installation log, and verify the file is indeed found, and the public property used in condition is set as expected.
0 Kudos
RayKode
Level 6

ElenaN,

Your suggestion works perfectly.
I can’t thank you enough. 🙂

I was wondering, if I could impose on you, a little bit more ?

The end user would like to run my installation program in "silent" mode.

Do you have any suggestions how I might code things, so that my installation program might add this same additional feature, if the installation program is run silently ?

Since there is no dialog, the "AddLocal BL BLSCFOUND", won't be executed.
"AddLocal BL BLSCFOUND" is what I added to the "Update" button in my dialog.


I have an InstallScript CA that runs in the User and Execute sequences, right after CostFinalize.
And this CA, sets the public property named BLSCFOUND. (Based on other things in the CA. And that, is working.)

I've been trying various things, I can't quite figure this out.

Suggestions would be GREATLY appreciated.
0 Kudos
RayKode
Level 6

In case there is an interest, this issue has been resolved.

The solution was to set my public property "BLSCFOUND", via the System search facility.

Then, set the feature condition (to a value of "100") based on the presence of the PUBLIC property.

I "WAS" performing the system search via an InstallScript CA.
Which is okay.
But apparently, I had my CA incorrectly placed.

Using the System search ensures that setting of my public property, takes place early enough to be evaluated.

Thanks once again for everyone’s help.

You’re the greatest.
0 Kudos