[Wine-patches] [eterhack] msi: Fix a regression in installing CryptoPro CSP 3.6 (eterbug #5348).

Alexander Morozov amorozov на etersoft.ru
Ср Июл 20 18:19:28 MSD 2011


----------- следующая часть -----------
From 8ebcaa12262a037066534762f659723f9985354d Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 20 Jul 2011 18:05:19 +0400
Subject: [eterhack] msi: Fix a regression in installing CryptoPro CSP 3.6
 (eterbug #5348).

---
 dlls/msi/action.c  |   71 ----------------------------------------------------
 dlls/msi/files.c   |   31 ++++++++++++++++++++++
 dlls/msi/msipriv.h |    2 -
 3 files changed, 31 insertions(+), 73 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index c566a3f..4ffdea7 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1475,77 +1475,6 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
     return ERROR_SUCCESS;
 }
 
-/* FIXME: probably should merge this with the above function */
-static UINT msi_create_directory( MSIPACKAGE* package, LPCWSTR dir )
-{
-    UINT rc = ERROR_SUCCESS;
-    MSIFOLDER *folder;
-    LPWSTR install_path;
-
-    install_path = msi_get_target_folder(package, dir);
-    if (!install_path)
-        return ERROR_FUNCTION_FAILED; 
-
-    /* create the path */
-    if (folder->State == 0)
-    {
-        create_full_pathW(install_path);
-        folder->State = 2;
-    }
-    msi_free(install_path);
-
-    return rc;
-}
-
-UINT msi_create_component_directories( MSIPACKAGE *package )
-{
-    MSICOMPONENT *comp;
-
-    /* create all the folders required by the components are going to install */
-    LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
-    {
-        if (comp->ActionRequest != INSTALLSTATE_LOCAL)
-            continue;
-        msi_create_directory( package, comp->Directory );
-    }
-
-    return ERROR_SUCCESS;
-}
-
-static UINT msi_remove_directory( MSIPACKAGE* package, LPCWSTR dir )
-{
-    UINT rc = ERROR_SUCCESS;
-    MSIFOLDER *folder;
-    LPWSTR install_path;
-
-    install_path = msi_get_target_folder(package, dir);
-    if (!install_path)
-        return ERROR_FUNCTION_FAILED;
-
-    if (folder->State != 3 && RemoveDirectoryW(install_path))
-    {
-        folder->State = 0;
-        msi_remove_directory(package, folder->Parent);
-    }
-    msi_free(install_path);
-
-    return rc;
-}
-
-UINT msi_remove_component_directories( MSIPACKAGE *package )
-{
-    MSICOMPONENT *comp;
-
-    LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
-    {
-        if (comp->ActionRequest != INSTALLSTATE_LOCAL)
-            continue;
-        msi_remove_directory( package, comp->Directory );
-    }
-
-    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.
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 55cd793..76d2301 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -246,6 +246,37 @@ static UINT msi_create_directory( MSIPACKAGE *package, const WCHAR *dir )
     return ERROR_SUCCESS;
 }
 
+static UINT msi_remove_directory( MSIPACKAGE* package, LPCWSTR dir )
+{
+    MSIFOLDER *folder;
+    const WCHAR *install_path;
+
+    install_path = msi_get_target_folder( package, dir );
+    if (!install_path) return ERROR_FUNCTION_FAILED;
+
+    folder = get_loaded_folder( package, dir );
+    if (folder->State != 3 && RemoveDirectoryW( install_path ))
+    {
+        folder->State = 0;
+        msi_remove_directory( package, folder->Parent );
+    }
+    return ERROR_SUCCESS;
+}
+
+static UINT msi_remove_component_directories( MSIPACKAGE *package )
+{
+    MSICOMPONENT *comp;
+
+    LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
+    {
+        if (comp->ActionRequest != INSTALLSTATE_LOCAL)
+            continue;
+        msi_remove_directory( package, comp->Directory );
+    }
+
+    return ERROR_SUCCESS;
+}
+
 static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
                             LPWSTR *path, DWORD *attrs, PVOID user)
 {
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index a0cf921..11b9d5b 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -996,8 +996,6 @@ extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *featur
 extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR) DECLSPEC_HIDDEN;
 extern BOOL check_unique_action(const MSIPACKAGE *, LPCWSTR) DECLSPEC_HIDDEN;
 extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... ) DECLSPEC_HIDDEN;
-extern UINT msi_create_component_directories( MSIPACKAGE *package );
-extern UINT msi_remove_component_directories( MSIPACKAGE *package );
 extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
                         MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value) DECLSPEC_HIDDEN;
 extern UINT msi_get_local_package_name(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN;
-- 
1.7.5.4



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