diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index 62215c51727..7abf2d34757 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -194,12 +194,18 @@ boolean_factor: | symbol_s operator value_i { int num; - $$ = num_from_prop( $1, &num ) && compare_int( num, $2, $3 ); + if (num_from_prop( $1, &num )) + $$ = compare_int( num, $2, $3 ); + else + $$ = ($2 == COND_NE || $2 == COND_INE ); } | value_i operator symbol_s { int num; - $$ = num_from_prop( $3, &num ) && compare_int( $1, $2, num ); + if (num_from_prop( $3, &num )) + $$ = compare_int( $1, $2, num ); + else + $$ = ($2 == COND_NE || $2 == COND_INE ); } | symbol_s operator symbol_s { diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index dce8e57bc17..a1370f7ef08 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -599,6 +599,24 @@ void test_condition(void) r = MsiEvaluateCondition(hpkg, "bandalmael=0"); ok( r == MSICONDITION_FALSE, "wrong return val\n"); + r = MsiEvaluateCondition(hpkg, "bandalmael<>0"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "bandalmael<0"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "bandalmael>0"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "bandalmael>=0"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "bandalmael<=0"); + ok( r == MSICONDITION_FALSE, "wrong return val\n"); + + r = MsiEvaluateCondition(hpkg, "bandalmael~<>0"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); + MsiSetProperty(hpkg, "bandalmael", "0" ); r = MsiEvaluateCondition(hpkg, "bandalmael=0"); ok( r == MSICONDITION_TRUE, "wrong return val\n"); @@ -646,6 +664,8 @@ void test_condition(void) MsiSetProperty(hpkg, "bandalmael", "0.0" ); r = MsiEvaluateCondition(hpkg, "bandalmael=0"); ok( r == MSICONDITION_FALSE, "wrong return val\n"); + r = MsiEvaluateCondition(hpkg, "bandalmael<>0"); + ok( r == MSICONDITION_TRUE, "wrong return val\n"); MsiCloseHandle( hpkg ); }