Commit 3807a917 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Fix the logic to determine the appropriate action of the feature.

parent 63064f7a
......@@ -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 )
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment