Commit 20ef12a7 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Don't mark global assembly files as installed when they are extracted.

parent 00680136
...@@ -2169,13 +2169,18 @@ WCHAR *msi_build_directory_name( DWORD count, ... ) ...@@ -2169,13 +2169,18 @@ WCHAR *msi_build_directory_name( DWORD count, ... )
return dir; return dir;
} }
static void set_target_path( MSIPACKAGE *package, MSIFILE *file ) BOOL msi_is_global_assembly( MSICOMPONENT *comp )
{ {
MSIASSEMBLY *assembly = file->Component->assembly; return comp->assembly && !comp->assembly->application;
}
static void set_target_path( MSIPACKAGE *package, MSIFILE *file )
{
msi_free( file->TargetPath ); msi_free( file->TargetPath );
if (assembly && !assembly->application) if (msi_is_global_assembly( file->Component ))
{ {
MSIASSEMBLY *assembly = file->Component->assembly;
if (!assembly->tempdir) assembly->tempdir = get_temp_dir(); if (!assembly->tempdir) assembly->tempdir = get_temp_dir();
file->TargetPath = msi_build_directory_name( 2, assembly->tempdir, file->FileName ); file->TargetPath = msi_build_directory_name( 2, assembly->tempdir, file->FileName );
msi_track_tempfile( package, file->TargetPath ); msi_track_tempfile( package, file->TargetPath );
......
...@@ -80,7 +80,7 @@ static msi_file_state calculate_install_state( MSIPACKAGE *package, MSIFILE *fil ...@@ -80,7 +80,7 @@ static msi_file_state calculate_install_state( MSIPACKAGE *package, MSIFILE *fil
TRACE("skipping %s (not part of patch)\n", debugstr_w(file->File)); TRACE("skipping %s (not part of patch)\n", debugstr_w(file->File));
return msifs_skipped; return msifs_skipped;
} }
if ((comp->assembly && !comp->assembly->application && !comp->assembly->installed) || if ((msi_is_global_assembly( comp ) && !comp->assembly->installed) ||
GetFileAttributesW( file->TargetPath ) == INVALID_FILE_ATTRIBUTES) GetFileAttributesW( file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
{ {
TRACE("installing %s (missing)\n", debugstr_w(file->File)); TRACE("installing %s (missing)\n", debugstr_w(file->File));
...@@ -291,7 +291,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, ...@@ -291,7 +291,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
if (f->disk_id != disk_id || (f->state != msifs_missing && f->state != msifs_overwrite)) if (f->disk_id != disk_id || (f->state != msifs_missing && f->state != msifs_overwrite))
return FALSE; return FALSE;
if (!f->Component->assembly || f->Component->assembly->application) if (!msi_is_global_assembly( f->Component ))
{ {
msi_create_directory(package, f->Component->Directory); msi_create_directory(package, f->Component->Directory);
} }
...@@ -300,7 +300,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, ...@@ -300,7 +300,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
} }
else if (action == MSICABEXTRACT_FILEEXTRACTED) else if (action == MSICABEXTRACT_FILEEXTRACTED)
{ {
f->state = msifs_installed; if (!msi_is_global_assembly( f->Component )) f->state = msifs_installed;
f = NULL; f = NULL;
} }
...@@ -393,22 +393,22 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -393,22 +393,22 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath)); TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
if (!file->Component->assembly || file->Component->assembly->application) if (!msi_is_global_assembly( file->Component ))
{ {
msi_create_directory(package, file->Component->Directory); msi_create_directory(package, file->Component->Directory);
} }
rc = copy_install_file(package, file, source); rc = copy_install_file(package, file, source);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
ERR("Failed to copy %s to %s (%d)\n", debugstr_w(source), ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
debugstr_w(file->TargetPath), rc);
rc = ERROR_INSTALL_FAILURE; rc = ERROR_INSTALL_FAILURE;
msi_free(source); msi_free(source);
goto done; goto done;
} }
msi_free(source); msi_free(source);
} }
else if (file->state != msifs_installed && !(file->Attributes & msidbFileAttributesPatchAdded)) else if (!msi_is_global_assembly( file->Component ) &&
file->state != msifs_installed && !(file->Attributes & msidbFileAttributesPatchAdded))
{ {
ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->File)); ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->File));
rc = ERROR_INSTALL_FAILURE; rc = ERROR_INSTALL_FAILURE;
...@@ -419,7 +419,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -419,7 +419,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{ {
MSICOMPONENT *comp = file->Component; MSICOMPONENT *comp = file->Component;
if (!comp->assembly || (file->state != msifs_missing && file->state != msifs_overwrite)) if (!msi_is_global_assembly( comp ) || (file->state != msifs_missing && file->state != msifs_overwrite))
continue; continue;
rc = msi_install_assembly( package, comp ); rc = msi_install_assembly( package, comp );
...@@ -429,6 +429,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -429,6 +429,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
rc = ERROR_INSTALL_FAILURE; rc = ERROR_INSTALL_FAILURE;
break; break;
} }
file->state = msifs_installed;
} }
done: done:
......
...@@ -588,7 +588,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder ...@@ -588,7 +588,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder
const WCHAR *dir; const WCHAR *dir;
MSICOMPONENT *comp = file->Component; MSICOMPONENT *comp = file->Component;
if (!comp->Enabled || (comp->assembly && !comp->assembly->application)) continue; if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
dir = msi_get_target_folder( package, comp->Directory ); dir = msi_get_target_folder( package, comp->Directory );
msi_free( file->TargetPath ); msi_free( file->TargetPath );
......
...@@ -2048,7 +2048,7 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i ...@@ -2048,7 +2048,7 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
GetWindowsDirectoryW( path, MAX_PATH ); GetWindowsDirectoryW( path, MAX_PATH );
if (component && component[0]) if (component && component[0])
{ {
if (comp->assembly && !comp->assembly->application) *temp = comp->Cost; if (msi_is_global_assembly( comp )) *temp = comp->Cost;
if (!comp->Enabled || !comp->KeyPath) if (!comp->Enabled || !comp->KeyPath)
{ {
*cost = 0; *cost = 0;
......
...@@ -1045,6 +1045,7 @@ extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; ...@@ -1045,6 +1045,7 @@ extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
extern BOOL msi_is_global_assembly(MSICOMPONENT *) DECLSPEC_HIDDEN;
extern WCHAR *msi_font_version_from_file(const WCHAR *) DECLSPEC_HIDDEN; extern WCHAR *msi_font_version_from_file(const WCHAR *) DECLSPEC_HIDDEN;
extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN; extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN;
extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN; extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN;
......
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