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

This commit is contained in:
Hans Leidekker 2015-04-01 12:32:44 +02:00 committed by Alexandre Julliard
parent 006801366e
commit 20ef12a762
5 changed files with 20 additions and 13 deletions

View File

@ -2169,13 +2169,18 @@ WCHAR *msi_build_directory_name( DWORD count, ... )
return dir;
}
BOOL msi_is_global_assembly( MSICOMPONENT *comp )
{
return comp->assembly && !comp->assembly->application;
}
static void set_target_path( MSIPACKAGE *package, MSIFILE *file )
{
MSIASSEMBLY *assembly = file->Component->assembly;
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();
file->TargetPath = msi_build_directory_name( 2, assembly->tempdir, file->FileName );
msi_track_tempfile( package, file->TargetPath );

View File

@ -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));
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)
{
TRACE("installing %s (missing)\n", debugstr_w(file->File));
@ -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))
return FALSE;
if (!f->Component->assembly || f->Component->assembly->application)
if (!msi_is_global_assembly( f->Component ))
{
msi_create_directory(package, f->Component->Directory);
}
@ -300,7 +300,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
}
else if (action == MSICABEXTRACT_FILEEXTRACTED)
{
f->state = msifs_installed;
if (!msi_is_global_assembly( f->Component )) f->state = msifs_installed;
f = NULL;
}
@ -393,22 +393,22 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
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);
}
rc = copy_install_file(package, file, source);
if (rc != ERROR_SUCCESS)
{
ERR("Failed to copy %s to %s (%d)\n", debugstr_w(source),
debugstr_w(file->TargetPath), rc);
ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
rc = ERROR_INSTALL_FAILURE;
msi_free(source);
goto done;
}
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));
rc = ERROR_INSTALL_FAILURE;
@ -419,7 +419,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{
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;
rc = msi_install_assembly( package, comp );
@ -429,6 +429,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
rc = ERROR_INSTALL_FAILURE;
break;
}
file->state = msifs_installed;
}
done:

View File

@ -588,7 +588,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder
const WCHAR *dir;
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 );
msi_free( file->TargetPath );

View File

@ -2048,7 +2048,7 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
GetWindowsDirectoryW( path, MAX_PATH );
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)
{
*cost = 0;

View File

@ -1045,6 +1045,7 @@ extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
extern BOOL msi_init_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_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN;
extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN;