msi: correct incorrect TARGETDIR

Aric Stewart aric at codeweavers.com
Tue Jun 21 13:30:12 CDT 2005


Fix situations where TARGETDIR is set to a non \ terminated path.
Fixes a few installers.
-------------- next part --------------
Index: dlls/msi/helpers.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/helpers.c,v
retrieving revision 1.1
diff -u -r1.1 helpers.c
--- dlls/msi/helpers.c	15 Jun 2005 19:12:42 -0000	1.1
+++ dlls/msi/helpers.c	21 Jun 2005 18:29:06 -0000
@@ -270,13 +270,20 @@
     {
         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 miss-built 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++)


More information about the wine-patches mailing list