Commit 42115638 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Use MsiQueryComponent state to determine the component's state.

parent 10a2a5ef
...@@ -1693,19 +1693,26 @@ static UINT ACTION_FileCost(MSIPACKAGE *package) ...@@ -1693,19 +1693,26 @@ static UINT ACTION_FileCost(MSIPACKAGE *package)
static void ACTION_GetComponentInstallStates(MSIPACKAGE *package) static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
{ {
MSICOMPONENT *comp; MSICOMPONENT *comp;
INSTALLSTATE state;
UINT r;
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) state = MsiQueryProductStateW(package->ProductCode);
{
INSTALLSTATE res;
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{
if (!comp->ComponentId) if (!comp->ComponentId)
continue; continue;
res = MsiGetComponentPathW( package->ProductCode, if (state != INSTALLSTATE_LOCAL && state != INSTALLSTATE_DEFAULT)
comp->ComponentId, NULL, NULL); comp->Installed = INSTALLSTATE_ABSENT;
if (res < 0) else
res = INSTALLSTATE_ABSENT; {
comp->Installed = res; r = MsiQueryComponentStateW(package->ProductCode, NULL,
package->Context, comp->ComponentId,
&comp->Installed);
if (r != ERROR_SUCCESS)
comp->Installed = INSTALLSTATE_ABSENT;
}
} }
} }
......
...@@ -3794,7 +3794,10 @@ static void test_states(void) ...@@ -3794,7 +3794,10 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action); r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
todo_wine
{
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
}
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee; state = 0xdeadbee;
...@@ -4592,9 +4595,9 @@ static void test_states(void) ...@@ -4592,9 +4595,9 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action); r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine todo_wine
{ {
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
} }
...@@ -5393,9 +5396,9 @@ static void test_states(void) ...@@ -5393,9 +5396,9 @@ static void test_states(void)
action = 0xdeadbee; action = 0xdeadbee;
r = MsiGetFeatureState(hpkg, "five", &state, &action); r = MsiGetFeatureState(hpkg, "five", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r ); ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine todo_wine
{ {
ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action); ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
} }
......
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