James Hawkins : msi: Update the files target paths as well,
because a parent directory might have been changed.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jul 13 10:12:23 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 094915ae2c12f1b3122462890bcda20b8cb70f7c
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=094915ae2c12f1b3122462890bcda20b8cb70f7c
Author: James Hawkins <truiken at gmail.com>
Date: Wed Jul 12 15:43:30 2006 -0700
msi: Update the files target paths as well, because a parent directory might have been changed.
---
dlls/msi/install.c | 16 ++++++++++++++++
dlls/msi/tests/package.c | 7 ++-----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index 5eaf10b..a09782d 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -331,6 +331,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *pack
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 *pack
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);
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 338b3fb..7db243a 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -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 );
}
More information about the wine-cvs
mailing list