msi: Update the files target paths as well, because a parent directory might have been changed.
This commit is contained in:
parent
724dd10ee8
commit
094915ae2c
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue