Mike McCormack : msi: Apply any MSI transforms specified by the TRANSFORMS property.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 4 08:42:06 CST 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Wed Jan  4 14:51:25 2006 +0100

msi: Apply any MSI transforms specified by the TRANSFORMS property.

---

 dlls/msi/action.c   |   25 +++++++++++++++++++++++++
 dlls/msi/msipriv.h  |    2 ++
 dlls/msi/msiquery.c |    2 +-
 3 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 0a062ba..9ccb716 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -569,6 +569,30 @@ static UINT msi_apply_patches( MSIPACKAG
     return r;
 }
 
+static UINT msi_apply_transforms( MSIPACKAGE *package )
+{
+    static const WCHAR szTransforms[] = {
+        'T','R','A','N','S','F','O','R','M','S',0 };
+    LPWSTR xform_list, *xforms;
+    UINT i, r = ERROR_SUCCESS;
+
+    xform_list = msi_dup_property( package, szTransforms );
+    xforms = msi_split_string( xform_list, ';' );
+
+    for( i=0; xforms && xforms[i] && r == ERROR_SUCCESS; i++ )
+    {
+        if (xforms[i][0] == ':')
+            r = msi_apply_substorage_transform( package, package->db, &xforms[i][1] );
+        else
+            r = MSI_DatabaseApplyTransformW( package->db, xforms[i], 0 );
+    }
+
+    msi_free( xforms );
+    msi_free( xform_list );
+
+    return r;
+}
+
 /****************************************************
  * TOP level entry points 
  *****************************************************/
@@ -618,6 +642,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *pac
 
     msi_parse_command_line( package, szCommandLine );
 
+    msi_apply_transforms( package );
     msi_apply_patches( package );
 
     if ( msi_get_property_int(package, szUILevel, 0) >= INSTALLUILEVEL_REDUCED )
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index cb64897..575d121 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -317,6 +317,8 @@ extern UINT read_raw_stream_data( MSIDAT
 
 /* transform functions */
 extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg );
+extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, 
+                 LPCWSTR szTransformFile, int iErrorCond );
 
 /* action internals */
 extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index d023ae4..4824d87 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -647,7 +647,7 @@ MSIHANDLE WINAPI MsiGetLastErrorRecord( 
 
 DEFINE_GUID( CLSID_MsiTransform, 0x000c1082, 0x0000, 0x0000, 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
 
-static UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, 
+UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, 
                  LPCWSTR szTransformFile, int iErrorCond )
 {
     UINT r;




More information about the wine-cvs mailing list