PDA

View Full Version : Feature conditions depending on other features



knoepdan
06-30-2009, 11:03 AM
Hi

In my Basic MSI project (InstallShield 2010) I would like to make a feature depend on other features but i cannot structure the features hierarchically. I have several language features (English, Spanish, French) and one feature called "common". Now if one language feature is selected by the user, the "common" feature needs to be installed as well. (The feature common is hidden in the "select-feature"-Dialog).

Fiddling with feature and component conditions has brougth no success (using conditional statements like: &German = 3 OR !German=3 )

Does anyone have an idea or solution for this?

Greetings




PS: i have seen similar threads for older versions but i havent found a satisfactory solution there.

ericpaul
07-01-2009, 02:06 AM
Hello knoepdan,

another location where you might want to influence the features to be installed, is in the dialog itself by adjusting its behavior.
Just select the Next button control and add events such as AddLocal and/or Remove to add or remove certain features based on the condition (like your example: &German = 3 OR !German=3)
The advantage is that you have the logic in one place.

I hope this helps you finding a suitable solution for your problem.

knoepdan
07-03-2009, 07:22 AM
Hi Paul

I havent tried your suggestions as i have a rather simple solution that works for me. I used InstallScript but i guess a VB or C++ is also possible:

Select a feature (make it installed):
MsiSetFeatureState(hMSI, "featureName", INSTALLSTATE_LOCAL);

Deselect a feature (dont installe)
MsiSetFeatureState(hMSI, "featureName", INSTALLSTATE_ABSENT);


I guess i should have come up with that myself but i am still a newbie