diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index dac4d9b..ec3a650 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -855,8 +855,42 @@ extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, UINT sc static inline void msi_feature_set_state( MSIFEATURE *feature, INSTALLSTATE state ) { - feature->ActionRequest = state; - feature->Action = state; + if (state == INSTALLSTATE_ABSENT) + { + switch (feature->Installed) + { + case INSTALLSTATE_ABSENT: + feature->ActionRequest = INSTALLSTATE_UNKNOWN; + feature->Action = INSTALLSTATE_UNKNOWN; + break; + default: + feature->ActionRequest = state; + feature->Action = state; + } + } + else if (state == INSTALLSTATE_SOURCE) + { + switch (feature->Installed) + { + case INSTALLSTATE_ABSENT: + case INSTALLSTATE_SOURCE: + feature->ActionRequest = state; + feature->Action = state; + break; + case INSTALLSTATE_LOCAL: + feature->ActionRequest = INSTALLSTATE_LOCAL; + feature->Action = INSTALLSTATE_LOCAL; + break; + default: + feature->ActionRequest = INSTALLSTATE_UNKNOWN; + feature->Action = INSTALLSTATE_UNKNOWN; + } + } + else + { + feature->ActionRequest = state; + feature->Action = state; + } } static inline void msi_component_set_state( MSICOMPONENT *comp, INSTALLSTATE state ) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 88105fd..2036e9d 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -3027,20 +3027,14 @@ static void test_states(void) r = MsiGetFeatureState(hpkg, "six", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - } + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); state = 0xdeadbee; action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "seven", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - } + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); state = 0xdeadbee; action = 0xdeadbee; @@ -3766,20 +3760,14 @@ static void test_states(void) r = MsiGetFeatureState(hpkg, "six", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - } + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); state = 0xdeadbee; action = 0xdeadbee; r = MsiGetFeatureState(hpkg, "seven", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - todo_wine - { - ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); - } + ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); state = 0xdeadbee; action = 0xdeadbee; @@ -5974,7 +5962,10 @@ static void test_featureparents(void) r = MsiGetFeatureState(hpkg, "orion", &state, &action); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state); - ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action); + todo_wine + { + ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action); + } state = 0xdeadbee; action = 0xdeadbee; -- 1.5.4.3