Commit d3cc801d authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

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

parent dbbd5ca7
...@@ -1464,6 +1464,25 @@ static UINT load_file(MSIRECORD *row, LPVOID param) ...@@ -1464,6 +1464,25 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
file->IsCompressed = package->WordCount & MSIWORDCOUNT_COMPRESSED; 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); load_file_hash(package, file);
TRACE("File Loaded (%s)\n",debugstr_w(file->File)); TRACE("File Loaded (%s)\n",debugstr_w(file->File));
......
...@@ -459,26 +459,6 @@ done: ...@@ -459,26 +459,6 @@ done:
return ret; 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 ) void msi_free_media_info( MSIMEDIAINFO *mi )
{ {
msi_free( mi->disk_prompt ); msi_free( mi->disk_prompt );
...@@ -847,13 +827,11 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -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) 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); msi_file_update_ui(package, file, szInstallFiles);
rc = copy_install_file(file); rc = copy_install_file(file);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
......
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