Commit a23514ee authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Add support for installing side-by-side assemblies.

parent 3faddc21
......@@ -7,6 +7,7 @@ C_SRCS = \
action.c \
alter.c \
appsearch.c \
assembly.c \
automation.c \
classes.c \
create.c \
......
......@@ -186,6 +186,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
return FALSE;
msi_file_update_ui(package, f, szInstallFiles);
if (!f->Component->assembly)
msi_create_directory(package, f->Component->Directory);
*path = strdupW(f->TargetPath);
......@@ -210,6 +211,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
UINT ACTION_InstallFiles(MSIPACKAGE *package)
{
MSIMEDIAINFO *mi;
MSICOMPONENT *comp;
UINT rc = ERROR_SUCCESS;
MSIFILE *file;
......@@ -234,7 +236,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS)
{
ERR("Failed to ready media for %s\n", debugstr_w(file->File));
break;
goto done;
}
data.mi = mi;
......@@ -247,7 +249,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{
ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
rc = ERROR_INSTALL_FAILURE;
break;
goto done;
}
}
......@@ -255,10 +257,10 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{
LPWSTR source = resolve_file_source(package, file);
TRACE("file paths %s to %s\n", debugstr_w(source),
debugstr_w(file->TargetPath));
TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
msi_file_update_ui(package, file, szInstallFiles);
if (!file->Component->assembly)
msi_create_directory(package, file->Component->Directory);
rc = copy_install_file(package, file, source);
......@@ -268,19 +270,32 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
debugstr_w(file->TargetPath), rc);
rc = ERROR_INSTALL_FAILURE;
msi_free(source);
break;
goto done;
}
msi_free(source);
}
else if (file->state != msifs_installed)
{
ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->TargetPath));
rc = ERROR_INSTALL_FAILURE;
goto done;
}
}
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{
if (comp->Enabled && comp->assembly && !comp->assembly->installed)
{
rc = install_assembly( package, comp );
if (rc != ERROR_SUCCESS)
{
ERR("Failed to install assembly\n");
rc = ERROR_INSTALL_FAILURE;
break;
}
}
}
done:
msi_free_media_info(mi);
return rc;
}
......
......@@ -32,6 +32,7 @@
#include "msidefs.h"
#include "objbase.h"
#include "objidl.h"
#include "fusion.h"
#include "winnls.h"
#include "winver.h"
#include "wine/list.h"
......@@ -332,6 +333,8 @@ typedef struct tagMSIPACKAGE
LPWSTR ActionFormat;
LPWSTR LastAction;
HANDLE log_file;
IAssemblyCache *cache_net;
IAssemblyCache *cache_sxs;
struct list classes;
struct list extensions;
......@@ -402,6 +405,17 @@ typedef struct tagMSIFEATURE
struct list Components;
} MSIFEATURE;
typedef struct tagMSIASSEMBLY
{
LPWSTR feature;
LPWSTR manifest;
LPWSTR application;
DWORD attributes;
LPWSTR display_name;
LPWSTR tempdir;
BOOL installed;
} MSIASSEMBLY;
typedef struct tagMSICOMPONENT
{
struct list entry;
......@@ -420,6 +434,7 @@ typedef struct tagMSICOMPONENT
INT RefCount;
LPWSTR FullKeypath;
LPWSTR AdvertiseString;
MSIASSEMBLY *assembly;
unsigned int anyAbsent:1;
unsigned int hasAdvertiseFeature:1;
......@@ -908,6 +923,7 @@ extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package);
extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package);
extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package);
extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package);
extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package);
/* Helpers */
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
......@@ -942,6 +958,8 @@ extern UINT msi_get_local_package_name(LPWSTR path, LPCWSTR suffix);
extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace);
extern void msi_component_set_state(MSIPACKAGE *, MSICOMPONENT *, INSTALLSTATE);
extern void msi_feature_set_state(MSIPACKAGE *, MSIFEATURE *, INSTALLSTATE);
extern MSIASSEMBLY *load_assembly(MSIPACKAGE *, MSICOMPONENT *);
extern UINT install_assembly(MSIPACKAGE *, MSICOMPONENT *);
/* media */
......@@ -1060,6 +1078,7 @@ static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','
static const WCHAR szWow6432Node[] = {'W','o','w','6','4','3','2','N','o','d','e',0};
static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
/* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
......
......@@ -111,6 +111,14 @@ static void free_extension( MSIEXTENSION *ext )
msi_free( ext );
}
static void free_assembly( MSIASSEMBLY *assembly )
{
msi_free( assembly->display_name );
if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
msi_free( assembly->tempdir );
msi_free( assembly );
}
static void free_package_structures( MSIPACKAGE *package )
{
INT i;
......@@ -154,6 +162,7 @@ static void free_package_structures( MSIPACKAGE *package )
msi_free( comp->Condition );
msi_free( comp->KeyPath );
msi_free( comp->FullKeypath );
if (comp->assembly) free_assembly( comp->assembly );
msi_free( comp );
}
......@@ -296,6 +305,9 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg)
msiobj_release( &package->db->hdr );
free_package_structures(package);
CloseHandle( package->log_file );
if (package->cache_net) IAssemblyCache_Release( package->cache_net );
if (package->cache_sxs) IAssemblyCache_Release( package->cache_sxs );
}
static UINT create_temp_property_table(MSIPACKAGE *package)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment