[MSI 3/4] disable checks in MsiSetTargetPath

Andrey Turkin pancha at mail.nnov.ru
Mon Jun 19 11:41:53 CDT 2006


Native does not require that given path's parent folder exists. It seems
that native does not tries touch anything on drive at all during
MsiSetTargetPath. This patch makes Wine's implementation to resemble
native more closely.

ChangeLog:
Disable some path validity checks in MsiSetTargetPath
-------------- next part --------------
--- wine-0.9.15-orig/dlls/msi/install.c	2006-06-19 19:45:25.000000000 +0400
+++ wine-0.9.15/dlls/msi/install.c	2006-06-19 20:06:43.000000000 +0400
@@ -336,24 +336,14 @@
 
     attrib = GetFileAttributesW(szFolderPath);
     if ( attrib != INVALID_FILE_ATTRIBUTES &&
-          (!(attrib & FILE_ATTRIBUTE_DIRECTORY) ||
-           attrib & FILE_ATTRIBUTE_OFFLINE ||
-           attrib & FILE_ATTRIBUTE_READONLY))
+          (attrib & FILE_ATTRIBUTE_OFFLINE ||
+           attrib & FILE_ATTRIBUTE_READONLY)) /* actually native MSI tests writeability by making temporary files at each drive */
         return ERROR_FUNCTION_FAILED;
 
     path = resolve_folder(package,szFolder,FALSE,FALSE,&folder);
     if (!path)
         return ERROR_DIRECTORY;
 
-    if (attrib == INVALID_FILE_ATTRIBUTES)
-    {
-        if (!CreateDirectoryW(szFolderPath,NULL))
-        {
-            msi_free( path );
-            return ERROR_FUNCTION_FAILED;
-        }
-        RemoveDirectoryW(szFolderPath);
-    }
 
     msi_free(folder->Property);
     folder->Property = build_directory_name(2, szFolderPath, NULL);
--- wine-0.9.15-orig/dlls/msi/tests/package.c	2006-06-19 20:04:22.000000000 +0400
+++ wine-0.9.15/dlls/msi/tests/package.c	2006-06-19 20:07:35.000000000 +0400
@@ -484,13 +484,10 @@
 
         sprintf( tempdir, "%ssubdir\\", buffer );
         r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer );
-        todo_wine {
         ok( r == ERROR_SUCCESS, "MsiSetTargetPath on file returned %d\n", r );
-        }
+
         r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
-        todo_wine {
         ok( r == ERROR_SUCCESS, "MsiSetTargetPath on 'subdir' of file returned %d\n", r );
-        }
 
         DeleteFile( buffer );
 
@@ -508,9 +505,7 @@
         ok ( r == 0xFFFFFFFF, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r );
 
         r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir );
-        todo_wine {
         ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r );
-        }
     } else {
         trace("GetTempFileName failed, cannot do some tests\n");
     }


More information about the wine-patches mailing list