Hans Leidekker : msi: Don't resolve child folders if the target path doesn' t change in MsiSetTargetPath.

Alexandre Julliard julliard at winehq.org
Tue May 17 12:53:00 CDT 2011


Module: wine
Branch: master
Commit: f464b7d2e258561f819a2ee1917510a67624ec8b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f464b7d2e258561f819a2ee1917510a67624ec8b

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue May 17 11:10:02 2011 +0200

msi: Don't resolve child folders if the target path doesn't change in MsiSetTargetPath.

---

 dlls/msi/install.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index 3559792..e90c3b1 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -549,17 +549,23 @@ static void set_target_path( MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR
 {
     FolderList *fl;
     MSIFOLDER *child;
+    WCHAR *target_path;
 
-    msi_free( folder->ResolvedTarget );
-    folder->ResolvedTarget = strdupW( path );
-    msi_clean_path( folder->ResolvedTarget );
-    msi_set_property( package->db, folder->Directory, folder->ResolvedTarget );
-
-    LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
+    if (!(target_path = strdupW( path ))) return;
+    msi_clean_path( target_path );
+    if (strcmpW( target_path, folder->ResolvedTarget ))
     {
-        child = fl->folder;
-        msi_resolve_target_folder( package, child->Directory, FALSE );
+        msi_free( folder->ResolvedTarget );
+        folder->ResolvedTarget = target_path;
+        msi_set_property( package->db, folder->Directory, folder->ResolvedTarget );
+
+        LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
+        {
+            child = fl->folder;
+            msi_resolve_target_folder( package, child->Directory, FALSE );
+        }
     }
+    else msi_free( target_path );
 }
 
 UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath )




More information about the wine-cvs mailing list