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

This commit is contained in:
James Hawkins 2006-07-12 15:43:30 -07:00 committed by Alexandre Julliard
parent 724dd10ee8
commit 094915ae2c
2 changed files with 18 additions and 5 deletions

View File

@ -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);

View File

@ -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 );
}