msi: Improve feature action value evaluation in conditions.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-10-20 22:18:25 +02:00 committed by Alexandre Julliard
parent 41365ce72c
commit b141a145c4
2 changed files with 8 additions and 3 deletions

View File

@ -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;

View File

@ -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");