Commit 094915ae authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Update the files target paths as well, because a parent directory might have been changed.

parent 724dd10e
......@@ -331,6 +331,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
LPWSTR path = NULL;
LPWSTR path2 = NULL;
MSIFOLDER *folder;
MSIFILE *file;
TRACE("(%p %s %s)\n",package, debugstr_w(szFolder),debugstr_w(szFolderPath));
......@@ -374,6 +375,21 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
path2 = resolve_folder(package, f->Directory, FALSE, TRUE, NULL);
msi_free(path2);
}
LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{
MSICOMPONENT *comp = file->Component;
LPWSTR p;
if (!comp)
continue;
p = resolve_folder(package, comp->Directory, FALSE, FALSE, NULL);
msi_free(file->TargetPath);
file->TargetPath = build_directory_name(2, p, file->FileName);
msi_free(p);
}
}
msi_free(path);
......
......@@ -499,11 +499,8 @@ static void test_settargetpath(void)
ok( r == ERROR_SUCCESS, "MsiSetTargetPath returned %d\n", r );
query_file_path( hpkg, "[#TestFile]", buffer );
todo_wine
{
ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
"Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
}
ok( !lstrcmp(buffer, "C:\\one\\two\\TestDir\\testfile.txt"),
"Expected C:\\one\\two\\TestDir\\testfile.txt, got %s\n", buffer );
MsiCloseHandle( hpkg );
}
......
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