Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46638 Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msi/action.c | 13 ++++++------- dlls/msi/assembly.c | 5 +++++ 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 9407d36520..d95960590c 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -995,13 +995,6 @@ UINT msi_load_all_components( MSIPACKAGE *package ) if (r != ERROR_SUCCESS) return r;
- if (!msi_init_assembly_caches( package )) - { - ERR("can't initialize assembly caches\n"); - msiobj_release( &view->hdr ); - return ERROR_FUNCTION_FAILED; - } - r = MSI_IterateRecords(view, NULL, load_component, package); msiobj_release(&view->hdr); return r; @@ -8094,6 +8087,12 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
TRACE("Performing action (%s)\n", debugstr_w(action));
+ if (!msi_init_assembly_caches( package )) + { + ERR("can't initialize assembly caches\n"); + return ERROR_FUNCTION_FAILED; + } + package->action_progress_increment = 0; rc = ACTION_HandleStandardAction(package, action);
diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c index f46ff02eeb..cb406111c9 100644 --- a/dlls/msi/assembly.c +++ b/dlls/msi/assembly.c @@ -41,6 +41,7 @@ static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, LPCWSTR, D static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, LPVOID );
static HMODULE hfusion10, hfusion11, hfusion20, hfusion40, hmscoree, hsxs; +static BOOL assembly_caches_initialized;
static BOOL init_function_pointers( void ) { @@ -91,12 +92,16 @@ static BOOL init_function_pointers( void )
BOOL msi_init_assembly_caches( MSIPACKAGE *package ) { + if (assembly_caches_initialized) return TRUE; if (!init_function_pointers()) return FALSE; + if (pCreateAssemblyCacheSxs( &package->cache_sxs, 0 ) != S_OK) return FALSE; if (pCreateAssemblyCacheNet10) pCreateAssemblyCacheNet10( &package->cache_net[CLR_VERSION_V10], 0 ); if (pCreateAssemblyCacheNet11) pCreateAssemblyCacheNet11( &package->cache_net[CLR_VERSION_V11], 0 ); if (pCreateAssemblyCacheNet20) pCreateAssemblyCacheNet20( &package->cache_net[CLR_VERSION_V20], 0 ); if (pCreateAssemblyCacheNet40) pCreateAssemblyCacheNet40( &package->cache_net[CLR_VERSION_V40], 0 ); + + assembly_caches_initialized = TRUE; return TRUE; }