From b141a145c49f1ad6cb6eef1781e08e8aaaa393ab Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 20 Oct 2017 22:18:25 +0200 Subject: [PATCH] msi: Improve feature action value evaluation in conditions. Signed-off-by: Piotr Caban Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/cond.y | 9 ++++++--- dlls/msi/tests/package.c | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index fa5582566e4..079bbd9703e 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -318,11 +318,14 @@ value_i: | COND_AMPER identifier { COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; + INSTALLSTATE install, action; - MSI_GetFeatureStateW(cond->package, $2, &install, &action ); - if (action == INSTALLSTATE_UNKNOWN) + if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS) + { + FIXME("condition may be evaluated incorrectly\n"); + /* we should return empty string in this case */ $$ = MSICONDITION_FALSE; + } else $$ = action; diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 1f04cef8503..0dafd7c6816 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -2069,6 +2069,8 @@ static void test_condition(void) /* feature doesn't exist */ r = MsiEvaluateConditionA(hpkg, "&nofeature"); ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r); + r = MsiEvaluateConditionA(hpkg, "&nofeature=\"\""); + todo_wine ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r); MsiSetPropertyA(hpkg, "A", "2"); MsiSetPropertyA(hpkg, "X", "50");