Commit 7c9873e4 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

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

parent f909e1c0
......@@ -861,8 +861,40 @@ static inline void msi_feature_set_state( MSIFEATURE *feature, INSTALLSTATE stat
static inline void msi_component_set_state( MSICOMPONENT *comp, INSTALLSTATE state )
{
comp->ActionRequest = state;
comp->Action = state;
if (state == INSTALLSTATE_ABSENT)
{
switch (comp->Installed)
{
case INSTALLSTATE_LOCAL:
case INSTALLSTATE_SOURCE:
case INSTALLSTATE_DEFAULT:
comp->ActionRequest = state;
comp->Action = state;
break;
default:
comp->ActionRequest = INSTALLSTATE_UNKNOWN;
comp->Action = INSTALLSTATE_UNKNOWN;
}
}
else if (state == INSTALLSTATE_SOURCE)
{
switch (comp->Installed)
{
case INSTALLSTATE_ABSENT:
case INSTALLSTATE_SOURCE:
comp->ActionRequest = state;
comp->Action = state;
break;
default:
comp->ActionRequest = INSTALLSTATE_UNKNOWN;
comp->Action = INSTALLSTATE_UNKNOWN;
}
}
else
{
comp->ActionRequest = state;
comp->Action = state;
}
}
/* actions in other modules */
......
......@@ -2417,7 +2417,10 @@ static void test_formatrecord_tables(void)
MsiRecordSetString( hrec, 1, "[$parietal]" );
r = MsiFormatRecord( hpkg, hrec, buf, &size );
ok( r == ERROR_SUCCESS, "format record failed: %d\n", r);
ok( !lstrcmp( buf, expected ), "Expected '%s', got %s\n", expected, buf);
todo_wine
{
ok( !lstrcmp( buf, expected ), "Expected '%s', got %s\n", expected, buf);
}
sprintf( buf, "%sI am a really long directory\\temporal.txt", root );
DeleteFile( buf );
......
......@@ -3274,10 +3274,7 @@ static void test_publish(void)
r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(pf_exists("msitest\\maximus"), "File deleted\n");
}
ok(pf_exists("msitest\\maximus"), "File deleted\n");
ok(pf_exists("msitest"), "File deleted\n");
state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
......@@ -4248,10 +4245,7 @@ static void test_removefiles(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
ok(!pf_exists("msitest\\helium"), "File not deleted\n");
todo_wine
{
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
}
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
ok(delete_pf("msitest", FALSE), "File deleted\n");
create_pf("msitest", FALSE);
......@@ -4270,10 +4264,7 @@ static void test_removefiles(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
ok(delete_pf("msitest\\helium", TRUE), "File deleted\n");
todo_wine
{
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
}
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
ok(delete_pf("msitest", FALSE), "File deleted\n");
create_pf("msitest", FALSE);
......@@ -4317,10 +4308,7 @@ static void test_removefiles(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
ok(!delete_pf("msitest\\helium", TRUE), "File not deleted\n");
todo_wine
{
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
}
ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
ok(delete_pf("msitest\\firkin", TRUE), "File deleted\n");
ok(delete_pf("msitest\\fortnight", TRUE), "File deleted\n");
......@@ -4329,7 +4317,10 @@ static void test_removefiles(void)
ok(delete_pf("msitest\\attoparsec", TRUE), "File deleted\n");
ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
ok(!delete_pf("msitest\\block", TRUE), "File not deleted\n");
ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
todo_wine
{
ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
}
ok(pf_exists("msitest\\cabout"), "Directory deleted\n");
ok(pf_exists("msitest"), "Directory deleted\n");
......
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