[4/4] msi: Keep assembly caches loaded until the package is destroyed.

Hans Leidekker hans at codeweavers.com
Tue Jun 12 02:25:09 CDT 2012


With this patch set native .NET 2.0 should install again.
See http://bugs.winehq.org/show_bug.cgi?id=30845
---
 dlls/msi/action.c   |    1 -
 dlls/msi/assembly.c |    8 +++++---
 dlls/msi/files.c    |    4 ----
 dlls/msi/package.c  |    7 ++-----
 4 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index b256439..d452c92 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1017,7 +1017,6 @@ UINT msi_load_all_components( MSIPACKAGE *package )
 
     r = MSI_IterateRecords(view, NULL, load_component, package);
     msiobj_release(&view->hdr);
-    msi_destroy_assembly_caches( package );
     return r;
 }
 
diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c
index e7660bd..2f321db 100644
--- a/dlls/msi/assembly.c
+++ b/dlls/msi/assembly.c
@@ -99,9 +99,11 @@ void msi_destroy_assembly_caches( MSIPACKAGE *package )
 {
     UINT i;
 
-    IAssemblyCache_Release( package->cache_sxs );
-    package->cache_sxs = NULL;
-
+    if (package->cache_sxs)
+    {
+        IAssemblyCache_Release( package->cache_sxs );
+        package->cache_sxs = NULL;
+    }
     for (i = 0; i < CLR_VERSION_MAX; i++)
     {
         if (package->cache_net[i])
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index fe72c24..11913ef 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -399,7 +399,6 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
             goto done;
         }
     }
-    msi_init_assembly_caches( package );
     LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
     {
         comp->Action = msi_get_component_action( package, comp );
@@ -414,7 +413,6 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
             }
         }
     }
-    msi_destroy_assembly_caches( package );
 
 done:
     msi_free_media_info(mi);
@@ -1309,7 +1307,6 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
         msiobj_release( &uirow->hdr );
     }
 
-    msi_init_assembly_caches( package );
     LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
     {
         comp->Action = msi_get_component_action( package, comp );
@@ -1328,6 +1325,5 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
             remove_folder( folder );
         }
     }
-    msi_destroy_assembly_caches( package );
     return ERROR_SUCCESS;
 }
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 7c8b1b4..4944065 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -344,9 +344,10 @@ static void free_package_structures( MSIPACKAGE *package )
 
 static void MSI_FreePackage( MSIOBJECTHDR *arg)
 {
-    UINT i;
     MSIPACKAGE *package = (MSIPACKAGE *)arg;
 
+    msi_destroy_assembly_caches( package );
+
     if( package->dialog )
         msi_dialog_destroy( package->dialog );
 
@@ -354,10 +355,6 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg)
     free_package_structures(package);
     CloseHandle( package->log_file );
 
-    for (i = 0; i < CLR_VERSION_MAX; i++)
-        if (package->cache_net[i]) IAssemblyCache_Release( package->cache_net[i] );
-    if (package->cache_sxs) IAssemblyCache_Release( package->cache_sxs );
-
     if (package->delete_on_close) DeleteFileW( package->localfile );
     msi_free( package->localfile );
 }
-- 
1.7.10






More information about the wine-patches mailing list