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

Problem with feature dependencies

Hello,

i have a installscript installation. Let me describe my problem:

Let's say i have two features, A and B.
A needs B, but B dont need A.

If i select A in the custom installation, then B is selected too. Thats fine. But if i deselect A, B is still selected.
I dont want that. If i deselect A then B should be deselected too. How can i do that?
Labels (1)
0 Kudos
(5) Replies
Alpesh
Flexera Alumni

Hi,

Please refer to this kb article --> http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q208877.

This should help.

Thanks,
Alpesh
0 Kudos
ShieldPower
Level 3

But this seems to be only for a Basic MSI project. I have a InstallScript Project 😞
0 Kudos
Alpesh
Flexera Alumni

Oops, I overlooked that it was a pure InstallScript project.

Anyways, you will have to handle that in the InstallScript code. Use the FeatureSelectItem and FeatureIsItemSelected functions to implement the feature dependency you want. I believe you will have to put this code in the SdFeatureTree dialog code.

I hope this helps.

Thanks!
0 Kudos
ShieldPower
Level 3

I tried it on a Test Project, but it wont work:

Dlg_SdFeatureTree:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
szTitle = "";
szMsg = "";
szFeatures = "";
nLevel = 2;
if (nSetupType = CUSTOM) then
//{{IS_SCRIPT_TAG(Dlg_SdFeatureTree)
nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, szFeatures, nLevel );
//}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
if (nResult = BACK) goto Dlg_SdAskDestPath2;
endif;


FEATURE = FeatureIsItemSelected (MEDIA, "Test\\Test2");
if (FEATURE = 0) then
FeatureSelectItem (MEDIA, "Test\\Test1", FALSE);
endif;

I want that if the SubFeature Test2 isnt selected it should deselect the SubFeature Test1. Whats wrong with this last four lines?
0 Kudos
Alpesh
Flexera Alumni

Hi,

You will have to import the InstallScript .rul file for the SdFeatureTree dialog. And then make your changes there. Look into the InstallShield help article 'Import InstallScript Files Dialog Box'.

Thanks!
0 Kudos