[2/3] msi: Look for transform files relative to the package directory.

Hans Leidekker hans at codeweavers.com
Tue Nov 30 08:18:17 CST 2010


---
 dlls/msi/action.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 6200d9b..db7455b 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -764,7 +764,27 @@ static UINT msi_apply_transforms( MSIPACKAGE *package )
         if (xforms[i][0] == ':')
             r = msi_apply_substorage_transform( package, package->db, xforms[i] );
         else
-            r = MSI_DatabaseApplyTransformW( package->db, xforms[i], 0 );
+        {
+            WCHAR *transform;
+
+            if (!PathIsRelativeW( xforms[i] )) transform = xforms[i];
+            else
+            {
+                WCHAR *p = strrchrW( package->PackagePath, '\\' );
+                DWORD len = p - package->PackagePath + 1;
+
+                if (!(transform = msi_alloc( (len + strlenW( xforms[i] ) + 1) * sizeof(WCHAR)) ))
+                {
+                    msi_free( xforms );
+                    msi_free( xform_list );
+                    return ERROR_OUTOFMEMORY;
+                }
+                memcpy( transform, package->PackagePath, len * sizeof(WCHAR) );
+                memcpy( transform + len, xforms[i], (strlenW( xforms[i] ) + 1) * sizeof(WCHAR) );
+            }
+            r = MSI_DatabaseApplyTransformW( package->db, transform, 0 );
+            if (transform != xforms[i]) msi_free( transform );
+        }
     }
 
     msi_free( xforms );
-- 
1.7.1







More information about the wine-patches mailing list