Commit 937b9b2b authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Only override a feature whose action state is INSTALLSTATE_SOURCE.

parent 319cac4c
......@@ -1774,7 +1774,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
}
}
if (component->ForceLocalState)
if (component->ForceLocalState && feature->Action == INSTALLSTATE_SOURCE)
{
feature->Action = INSTALLSTATE_LOCAL;
feature->ActionRequest = INSTALLSTATE_LOCAL;
......
......@@ -1608,6 +1608,14 @@ static void test_states(void)
r = add_feature_entry( hdb, "'three', '', '', '', 2, 1, '', 1" );
ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
/* msidbFeatureAttributesFavorLocal */
r = add_feature_entry( hdb, "'four', '', '', '', 2, 1, '', 0" );
ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
/* disabled */
r = add_feature_entry( hdb, "'five', '', '', '', 2, 0, '', 1" );
ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
/* msidbFeatureAttributesFavorSource:msidbComponentAttributesSourceOnly */
r = add_component_entry( hdb, "'eta', '{DD89003F-0DD4-41B8-81C0-3411A7DA2695}', 'TARGETDIR', 1, '', 'eta_file'" );
ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
......@@ -1642,6 +1650,12 @@ static void test_states(void)
r = add_feature_components_entry( hdb, "'three', 'eta'" );
ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
r = add_feature_components_entry( hdb, "'four', 'eta'" );
ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
r = add_feature_components_entry( hdb, "'five', 'eta'" );
ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
r = create_file_table( hdb );
ok( r == ERROR_SUCCESS, "cannot create File table: %d\n", r );
......@@ -1699,6 +1713,20 @@ static void test_states(void)
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "four", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
ok( action == 0xdeadbee, "Expected 0xdeadbee, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action);
ok( r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r );
ok( state == 0xdeadbee, "Expected 0xdeadbee, got %d\n", state);
......@@ -1795,6 +1823,26 @@ static void test_states(void)
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "four", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
{
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
}
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
{
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
}
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
......@@ -1918,6 +1966,26 @@ static void test_states(void)
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "four", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
{
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
}
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
{
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
}
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
......@@ -2032,6 +2100,20 @@ static void test_states(void)
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "four", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "alpha", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
......
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