From 0dff7bff9afd6a69340ad99a6f348740b1ea3a25 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 24 Jul 2014 12:35:31 +0200 Subject: [PATCH] msi: Fix feature actions overriding in process_state_property. --- dlls/msi/action.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index feb829690f3..9dc804c371d 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1666,6 +1666,8 @@ static BOOL process_state_property(MSIPACKAGE* package, int level, { LPWSTR override; MSIFEATURE *feature; + BOOL remove = !strcmpW(property, szRemove); + BOOL reinstall = !strcmpW(property, szReinstall); override = msi_dup_property( package->db, property ); if (!override) @@ -1676,15 +1678,15 @@ static BOOL process_state_property(MSIPACKAGE* package, int level, if (strcmpW( property, szRemove ) && !is_feature_selected( feature, level )) continue; - if (!strcmpW(property, szReinstall)) state = feature->Installed; + if (reinstall) + state = (feature->Installed == INSTALLSTATE_ABSENT ? INSTALLSTATE_UNKNOWN : feature->Installed); + else if (remove) + state = (feature->Installed == INSTALLSTATE_ABSENT ? INSTALLSTATE_UNKNOWN : INSTALLSTATE_ABSENT); if (!strcmpiW( override, szAll )) { - if (feature->Installed != state) - { - feature->Action = state; - feature->ActionRequest = state; - } + feature->Action = state; + feature->ActionRequest = state; } else { @@ -1698,11 +1700,8 @@ static BOOL process_state_property(MSIPACKAGE* package, int level, if ((ptr2 && strlenW(feature->Feature) == len && !strncmpW(ptr, feature->Feature, len)) || (!ptr2 && !strcmpW(ptr, feature->Feature))) { - if (feature->Installed != state) - { - feature->Action = state; - feature->ActionRequest = state; - } + feature->Action = state; + feature->ActionRequest = state; break; } if (ptr2)