From e534e7726b315f460cae62320eb7a393480d6af2 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 4 Jan 2006 14:51:25 +0100 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 0a062ba091c..9ccb7164f85 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -569,6 +569,30 @@ static UINT msi_apply_patches( MSIPACKAGE *package ) 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 *package, LPCWSTR szPackagePath, 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 cb6489734c3..575d1218230 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -317,6 +317,8 @@ extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname, /* 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 d023ae4e964..4824d875473 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -647,7 +647,7 @@ MSIHANDLE WINAPI MsiGetLastErrorRecord( void ) 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; -- 2.11.4.GIT