Fix a regression that wine-mono installer packages in the parent folder of build trees can not be found since 405666b.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51209 Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/appwiz.cpl/Makefile.in | 2 +- dlls/appwiz.cpl/addons.c | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/dlls/appwiz.cpl/Makefile.in b/dlls/appwiz.cpl/Makefile.in index e07149a30c9..44053de8ece 100644 --- a/dlls/appwiz.cpl/Makefile.in +++ b/dlls/appwiz.cpl/Makefile.in @@ -1,5 +1,5 @@ MODULE = appwiz.cpl -IMPORTS = uuid urlmon advpack comctl32 advapi32 shell32 ole32 user32 comdlg32 bcrypt +IMPORTS = uuid urlmon advpack comctl32 advapi32 shell32 ole32 user32 comdlg32 bcrypt kernelbase DELAYIMPORTS = msi
EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index e3004c972f1..4fed70e9bdd 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -33,6 +33,7 @@ #include "commctrl.h" #include "advpub.h" #include "wininet.h" +#include "pathcch.h" #include "shellapi.h" #include "urlmon.h" #include "msi.h" @@ -197,10 +198,11 @@ static enum install_res install_file(const WCHAR *file_name)
static enum install_res install_from_dos_file(const WCHAR *dir, const WCHAR *subdir, const WCHAR *file_name) { - WCHAR *path; + WCHAR *path, *canonical_path; enum install_res ret; int len = lstrlenW( dir ); int size = len + 1; + HRESULT hr;
size += lstrlenW( subdir ) + lstrlenW( file_name ) + 2; if (!(path = heap_alloc( size * sizeof(WCHAR) ))) return INSTALL_FAILED; @@ -213,16 +215,25 @@ static enum install_res install_from_dos_file(const WCHAR *dir, const WCHAR *sub lstrcatW( path, L"\" ); lstrcatW( path, file_name );
- if (GetFileAttributesW( path ) == INVALID_FILE_ATTRIBUTES) + hr = PathAllocCanonicalize( path, PATHCCH_ALLOW_LONG_PATHS, &canonical_path ); + if (FAILED( hr )) { - TRACE( "%s not found\n", debugstr_w(path) ); + ERR( "Failed to canonicalize %s, hr %#x\n", debugstr_w(path), hr ); heap_free( path ); return INSTALL_NEXT; } - - ret = install_file( path ); - heap_free( path ); + + if (GetFileAttributesW( canonical_path ) == INVALID_FILE_ATTRIBUTES) + { + TRACE( "%s not found\n", debugstr_w(canonical_path) ); + LocalFree( canonical_path ); + return INSTALL_NEXT; + } + + ret = install_file( canonical_path ); + + LocalFree( canonical_path ); return ret; }