From: Paul Gofman pgofman@codeweavers.com
--- dlls/msi/files.c | 12 ++++++++++++ dlls/msi/tests/install.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 8dd2b67a792..328b0e47a2d 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -159,10 +159,21 @@ static BOOL apply_filepatch( MSIPACKAGE *package, const WCHAR *patch, const WCHA
BYTE *msi_get_file_version_info( MSIPACKAGE *package, const WCHAR *path ) { + WCHAR tmp_filename[MAX_PATH]; DWORD size; BYTE *buffer = NULL;
+ *tmp_filename = 0; msi_disable_fs_redirection( package ); + if (is_wow64 && is_platform_64bit( package->platform ) && GetModuleHandleW( path )) + { + WCHAR temppath[MAX_PATH]; + + GetTempPathW( ARRAY_SIZE(temppath), temppath ); + if (!GetTempFileNameW( temppath, L"msi", 0, tmp_filename )) goto done; + if (!CopyFileW( path, tmp_filename, FALSE )) goto done; + path = tmp_filename; + } if (!(size = GetFileVersionInfoSizeW( path, NULL ))) goto done; if (!(buffer = malloc( size ))) goto done; if (!GetFileVersionInfoW( path, 0, size, buffer )) @@ -171,6 +182,7 @@ BYTE *msi_get_file_version_info( MSIPACKAGE *package, const WCHAR *path ) buffer = NULL; } done: + if (*tmp_filename) DeleteFileW(tmp_filename); msi_revert_fs_redirection( package ); return buffer; } diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 57ee48c2d7a..4b967d1aa4b 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -6315,7 +6315,7 @@ static void test_wow64(void) sprintf(path, "%s\msitest\cabout\new\five.txt", system_dir); ret = GetFileAttributesExA(path, GetFileExInfoStandard, &attr); ok(ret, "got error %lu.\n", GetLastError()); - todo_wine ok(attr.nFileSizeLow == dll_size, "got %lu, expected %lu.\n", attr.nFileSizeLow, dll_size); + ok(attr.nFileSizeLow == dll_size, "got %lu, expected %lu.\n", attr.nFileSizeLow, dll_size);
ok(delete_pf_dir("msitest\cabout\new\five.txt", TRUE, system_dir), "File not installed\n"); ok(delete_pf_dir("msitest\cabout\new", FALSE, system_dir), "Directory not created\n");