
shieldpower1.5524901681967166E12 asked a question.
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?
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
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!
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?
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!