From d447ae63b3194fdab39c319496dd1f24a1a629e1 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Tue, 5 Apr 2011 14:05:00 +0200 Subject: [PATCH] msi: Honor msidbFeatureAttributesFollowParent. --- dlls/msi/action.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 366d89758c6..3244b6dc7e1 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2232,18 +2232,23 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) } } } - - /* disable child features of unselected parent features */ + /* disable child features of unselected parent or follow parent */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) { FeatureList *fl; - if (is_feature_selected( feature, level )) continue; - LIST_FOR_EACH_ENTRY( fl, &feature->Children, FeatureList, entry ) { - fl->feature->Action = INSTALLSTATE_UNKNOWN; - fl->feature->ActionRequest = INSTALLSTATE_UNKNOWN; + if (!is_feature_selected( feature, level )) + { + fl->feature->Action = INSTALLSTATE_UNKNOWN; + fl->feature->ActionRequest = INSTALLSTATE_UNKNOWN; + } + else if (fl->feature->Attributes & msidbFeatureAttributesFollowParent) + { + fl->feature->Action = feature->Action; + fl->feature->ActionRequest = feature->ActionRequest; + } } } } @@ -2267,6 +2272,21 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package) } } } + LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) + { + FeatureList *fl; + + if (!is_feature_selected( feature, level )) continue; + + LIST_FOR_EACH_ENTRY( fl, &feature->Children, FeatureList, entry ) + { + if (fl->feature->Attributes & msidbFeatureAttributesFollowParent) + { + fl->feature->Action = feature->Action; + fl->feature->ActionRequest = feature->ActionRequest; + } + } + } } /* now we want to set component state based based on feature state */