[Wine-patches] [PATCH 1/2] msi: Create folders only for enabled components (eterbug #948).

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


----------- следующая часть -----------
From e2f8dfe31f8d5e0da18a6329b879af79cec1f96b Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Mon, 16 Nov 2009 21:00:17 +0300
Subject: [PATCH 1/2] msi: Create folders only for enabled components (eterbug #948).

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

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 0d78a1c..b63e8d4 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1176,9 +1176,11 @@ static UINT ITERATE_CreateFolders(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)
@@ -1187,6 +1189,20 @@ static UINT ITERATE_CreateFolders(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)
     {
@@ -1320,35 +1336,14 @@ static UINT ITERATE_RemoveFolders(MSIRECORD *row, LPVOID param)
     return ERROR_SUCCESS;
 }
 
-/*
- * Also we cannot enable/disable components either, so for now I am just going 
- * to do all the directories for all the components.
- */
 static UINT ACTION_CreateFolders(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;
-    BOOL create = FALSE;
-
-    /* do not create folders if nothing should be installed */
-    LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
-    {
-        if (comp->Action != INSTALLSTATE_ABSENT && comp->Action != INSTALLSTATE_UNKNOWN)
-        {
-            create = TRUE;
-            break;
-        }
-    }
-    if (!create)
-        return ERROR_SUCCESS;
 
-    /* create all the empty folders specified in the CreateFolder table */
     rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view );
     if (rc != ERROR_SUCCESS)
         return ERROR_SUCCESS;
-- 
1.6.4.4



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