msi: If a feature's action is INSTALLSTATE_UNKNOWN, MsiEvaluateCondition should return MSICONDITION_FALSE.

This commit is contained in:
James Hawkins 2008-02-27 17:47:03 -06:00 committed by Alexandre Julliard
parent eb836b718f
commit 5e2bc5b3fe
2 changed files with 12 additions and 1 deletions

View File

@ -317,7 +317,11 @@ value_i:
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
MSI_GetFeatureStateW(cond->package, $2, &install, &action );
$$ = action;
if (action == INSTALLSTATE_UNKNOWN)
$$ = MSICONDITION_FALSE;
else
$$ = action;
msi_free( $2 );
}
| COND_EXCLAM identifier

View File

@ -986,6 +986,9 @@ static void test_condition(void)
r = MsiEvaluateCondition(hpkg, "0");
ok( r == MSICONDITION_FALSE, "wrong return val\n");
r = MsiEvaluateCondition(hpkg, "-1");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
r = MsiEvaluateCondition(hpkg, "0 = 0");
ok( r == MSICONDITION_TRUE, "wrong return val\n");
@ -1622,6 +1625,10 @@ static void test_condition(void)
r = MsiEvaluateCondition(hpkg, "X !=\"\" and (X =\"5.0\" or X =\"5.1\" or X =\"6.0\")");
ok( r == MSICONDITION_ERROR, "wrong return val (%d)\n", r);
/* feature doesn't exist */
r = MsiEvaluateCondition(hpkg, "&nofeature");
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
MsiCloseHandle( hpkg );
DeleteFile(msifile);
}