Piotr Caban : msi: Improve feature action value evaluation in conditions.
Alexandre Julliard
julliard at winehq.org
Tue Oct 24 02:40:03 CDT 2017
Module: wine
Branch: master
Commit: b141a145c49f1ad6cb6eef1781e08e8aaaa393ab
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b141a145c49f1ad6cb6eef1781e08e8aaaa393ab
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Oct 20 22:18:25 2017 +0200
msi: Improve feature action value evaluation in conditions.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 fa55825..079bbd9 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 1f04cef..0dafd7c 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");
More information about the wine-cvs
mailing list