From e89f849612a78a0bdef4d0ddd5df8eb7e5d09c30 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 21 Jun 2005 20:21:30 +0000 Subject: [PATCH] Fix situations where TARGETDIR is set to a non \ terminated path. Fixes a few installers. --- dlls/msi/helpers.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index b98d52187d9..e9e12f12214 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -270,13 +270,20 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, { if (!source) { - path = load_dynamic_property(package,cszTargetDir,NULL); - if (!path) + LPWSTR check_path; + check_path = load_dynamic_property(package,cszTargetDir,NULL); + if (!check_path) { - path = load_dynamic_property(package,cszRootDrive,NULL); + check_path = load_dynamic_property(package,cszRootDrive,NULL); if (set_prop) - MSI_SetPropertyW(package,cszTargetDir,path); + MSI_SetPropertyW(package,cszTargetDir,check_path); } + + /* correct misbuilt target dir */ + path = build_directory_name(2, check_path, NULL); + if (strcmpiW(path,check_path)!=0) + MSI_SetPropertyW(package,cszTargetDir,path); + if (folder) { for (i = 0; i < package->loaded_folders; i++) -- 2.11.4.GIT