[Wine-patches] [PATCH 2/2] msi: Remove a folder for selected component (eterbug #948).

Alexander Morozov amorozov на etersoft.ru
Ср Ноя 18 13:54:20 MSK 2009


----------- следующая часть -----------
From 04f32fff9d4daa65a2f55387e8a8621a4d64218e Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 17 Nov 2009 12:43:45 +0300
Subject: [PATCH 2/2] msi: Remove a folder for selected component (eterbug #948).

---
 dlls/msi/action.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index b63e8d4..7ff7656 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1302,9 +1302,11 @@ static UINT ITERATE_RemoveFolders(MSIRECORD *row, LPVOID param)
 {
     MSIPACKAGE *package = param;
     LPCWSTR dir;
+    LPCWSTR component;
     LPWSTR full_path;
     MSIRECORD *uirow;
     MSIFOLDER *folder;
+    MSICOMPONENT *comp;
 
     dir = MSI_RecordGetString(row, 1);
     if (!dir)
@@ -1313,6 +1315,20 @@ static UINT ITERATE_RemoveFolders(MSIRECORD *row, LPVOID param)
         return ERROR_SUCCESS;
     }
 
+    component = MSI_RecordGetString(row, 2);
+    if (!component)
+    {
+        ERR("Unable to get component id\n");
+        return ERROR_SUCCESS;
+    }
+
+    comp = get_loaded_component(package, component);
+    if (!comp)
+        return ERROR_SUCCESS;
+
+    if (comp->Action != INSTALLSTATE_ABSENT && comp->Action != INSTALLSTATE_UNKNOWN)
+        return ERROR_SUCCESS;
+
     full_path = resolve_folder(package, dir, FALSE, FALSE, TRUE, &folder);
     if (!full_path)
     {
@@ -1359,20 +1375,10 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
 static UINT ACTION_RemoveFolders( MSIPACKAGE *package )
 {
     static const WCHAR ExecSeqQuery[] =
-        {'S','E','L','E','C','T',' ',
-         '`','D','i','r','e','c','t','o','r','y','_','`',
-         ' ','F','R','O','M',' ',
+        {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
          '`','C','r','e','a','t','e','F','o','l','d','e','r','`',0 };
     UINT rc;
     MSIQUERY *view;
-    MSICOMPONENT *comp;
-
-    /* for now we remove folders only if all components should be removed */
-    LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
-    {
-        if (comp->Action != INSTALLSTATE_ABSENT && comp->Action != INSTALLSTATE_UNKNOWN)
-            return ERROR_SUCCESS;
-    }
 
     rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view );
     if (rc != ERROR_SUCCESS)
-- 
1.6.4.4



Подробная информация о списке рассылки Wine-patches