James Hawkins : msi: A file's component' s state does not determine file removal.

Alexandre Julliard julliard at winehq.org
Tue Aug 19 08:46:47 CDT 2008


Module: wine
Branch: master
Commit: a00bdc117805608310e1139ac9ee700773ed0246
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a00bdc117805608310e1139ac9ee700773ed0246

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Mon Aug 18 23:02:24 2008 -0500

msi: A file's component's state does not determine file removal.

---

 dlls/msi/files.c         |    3 --
 dlls/msi/tests/install.c |   62 ++++++++++++++++++++-------------------------
 2 files changed, 28 insertions(+), 37 deletions(-)

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index e69c879..521cdb3 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -444,9 +444,6 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
         MSIRECORD *uirow;
         LPWSTR uipath, p;
 
-        if ( file->Component->Installed == INSTALLSTATE_LOCAL )
-            continue;
-
         if ( file->state == msifs_installed )
             ERR("removing installed file %s\n", debugstr_w(file->TargetPath));
 
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 0580c18..04f9e4b 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -3274,9 +3274,9 @@ static void test_publish(void)
     /* no UnpublishFeatures */
     r = MsiInstallProductA(msifile, "REMOVE=ALL");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!pf_exists("msitest\\maximus"), "File deleted\n");
     todo_wine
     {
-        ok(!pf_exists("msitest\\maximus"), "File deleted\n");
         ok(!pf_exists("msitest"), "File deleted\n");
     }
 
@@ -3352,7 +3352,7 @@ static void test_publish(void)
     /* UnpublishFeatures, only feature removed.  Only works when entire product is removed */
     r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    ok(pf_exists("msitest\\maximus"), "File deleted\n");
+    todo_wine ok(pf_exists("msitest\\maximus"), "File deleted\n");
     ok(pf_exists("msitest"), "File deleted\n");
 
     state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
@@ -3456,9 +3456,9 @@ static void test_publish(void)
     /* UnpublishFeatures, both features removed */
     r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
     todo_wine
     {
-        ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
         ok(!pf_exists("msitest"), "File not deleted\n");
     }
 
@@ -3534,9 +3534,9 @@ static void test_publish(void)
     /* complete uninstall */
     r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
     todo_wine
     {
-        ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
         ok(!pf_exists("msitest"), "File not deleted\n");
     }
 
@@ -3735,9 +3735,9 @@ static void test_publishsourcelist(void)
     /* complete uninstall */
     r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
     todo_wine
     {
-        ok(!pf_exists("msitest\\maximus"), "File not deleted\n");
         ok(!pf_exists("msitest"), "File not deleted\n");
     }
 
@@ -4166,13 +4166,10 @@ static void test_removefiles(void)
 
     r = MsiInstallProductA(msifile, "REMOVE=ALL");
     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");
     ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
-    todo_wine
-    {
-        ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
-        ok(delete_pf("msitest", FALSE), "File deleted\n");
-    }
+    ok(delete_pf("msitest", FALSE), "File deleted\n");
 
     create_pf("msitest", FALSE);
     create_pf("msitest\\hydrogen", TRUE);
@@ -4188,13 +4185,10 @@ static void test_removefiles(void)
 
     r = MsiInstallProductA(msifile, "REMOVE=ALL");
     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");
     ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
-    todo_wine
-    {
-        ok(!pf_exists("msitest\\hydrogen"), "File not deleted\n");
-        ok(delete_pf("msitest", FALSE), "File deleted\n");
-    }
+    ok(delete_pf("msitest", FALSE), "File deleted\n");
 
     create_pf("msitest", FALSE);
     create_pf("msitest\\furlong", TRUE);
@@ -4235,6 +4229,7 @@ static void test_removefiles(void)
 
     r = MsiInstallProductA(msifile, "REMOVE=ALL");
     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");
     ok(delete_pf("msitest\\lithium", TRUE), "File deleted\n");
     ok(delete_pf("msitest\\furlong", TRUE), "File deleted\n");
@@ -4244,7 +4239,6 @@ static void test_removefiles(void)
     ok(delete_pf("msitest\\siriometer", TRUE), "File deleted\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not deleted\n");
         ok(!delete_pf("msitest\\becquerel", TRUE), "File not deleted\n");
         ok(!delete_pf("msitest\\dioptre", TRUE), "File not deleted\n");
         ok(!delete_pf("msitest\\storeys", TRUE), "File not deleted\n");
@@ -5082,11 +5076,11 @@ static void test_MsiConfigureProductEx(void)
                                INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
                                "PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 
@@ -5110,11 +5104,11 @@ static void test_MsiConfigureProductEx(void)
                                INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
                                "PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 
@@ -5140,11 +5134,11 @@ static void test_MsiConfigureProductEx(void)
                                INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
                                "PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 
@@ -5190,11 +5184,11 @@ static void test_MsiConfigureProductEx(void)
                                INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
                                "PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 
@@ -5254,11 +5248,11 @@ static void test_MsiConfigureProductEx(void)
                                INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
                                "PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 
@@ -5295,12 +5289,12 @@ static void test_missingcomponent(void)
 
     r = MsiInstallProductA(msifile, "REMOVE=ALL INSTALLLEVEL=10 PROPVAR=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+    ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
+    ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
     ok(!pf_exists("msitest\\beryllium"), "File installed\n");
     todo_wine
     {
-        ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
-        ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
         ok(!delete_pf("msitest", FALSE), "File not removed\n");
     }
 




More information about the wine-cvs mailing list