msi: Set the source path for uncompressed files when loading the file.

This commit is contained in:
James Hawkins 2008-06-10 17:35:10 -05:00 committed by Alexandre Julliard
parent dbbd5ca736
commit d3cc801da1
2 changed files with 22 additions and 25 deletions

View File

@ -1464,6 +1464,25 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
file->IsCompressed = package->WordCount & MSIWORDCOUNT_COMPRESSED;
}
if (!file->IsCompressed)
{
LPWSTR p, path;
p = resolve_folder(package, file->Component->Directory,
TRUE, FALSE, TRUE, NULL);
path = build_directory_name(2, p, file->ShortName);
if (file->LongName &&
GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES)
{
msi_free(path);
path = build_directory_name(2, p, file->LongName);
}
file->SourcePath = path;
msi_free(p);
}
load_file_hash(package, file);
TRACE("File Loaded (%s)\n",debugstr_w(file->File));

View File

@ -459,26 +459,6 @@ done:
return ret;
}
static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, LPCWSTR path)
{
if (!file->IsCompressed)
{
LPWSTR p, path;
p = resolve_folder(package, file->Component->Directory, TRUE, FALSE, TRUE, NULL);
path = build_directory_name(2, p, file->ShortName);
if (file->LongName &&
INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
{
msi_free(path);
path = build_directory_name(2, p, file->LongName);
}
file->SourcePath = path;
msi_free(p);
}
else
file->SourcePath = build_directory_name(2, path, file->File);
}
void msi_free_media_info( MSIMEDIAINFO *mi )
{
msi_free( mi->disk_prompt );
@ -847,13 +827,11 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
}
}
set_file_source(package, file, mi->source);
TRACE("file paths %s to %s\n",debugstr_w(file->SourcePath),
debugstr_w(file->TargetPath));
if (!file->IsCompressed)
{
TRACE("file paths %s to %s\n", debugstr_w(file->SourcePath),
debugstr_w(file->TargetPath));
msi_file_update_ui(package, file, szInstallFiles);
rc = copy_install_file(file);
if (rc != ERROR_SUCCESS)