James Hawkins : msi: If a feature's action is INSTALLSTATE_UNKNOWN, MsiEvaluateCondition should return MSICONDITION_FALSE.
Module: wine Branch: master Commit: 5e2bc5b3fedbb32b6c9b7bdb4a4efcd07f88a524 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5e2bc5b3fedbb32b6c9b7bdb4a... Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Wed Feb 27 17:47:03 2008 -0600 msi: If a feature's action is INSTALLSTATE_UNKNOWN, MsiEvaluateCondition should return MSICONDITION_FALSE. --- dlls/msi/cond.y | 6 +++++- dlls/msi/tests/package.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index 9f1a74c..062af07 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -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 diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 3d50a8f..540de8b 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -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); }
participants (1)
-
Alexandre Julliard