Module: wine Branch: master Commit: 30fc5602def216483177150160bd45c90fb20d64 URL: http://source.winehq.org/git/wine.git/?a=commit;h=30fc5602def216483177150160...
Author: James Hawkins truiken@gmail.com Date: Thu Jul 12 11:36:43 2007 -0700
msi: Reload properties as they may have been changed by a transform.
---
dlls/msi/action.c | 3 +++ dlls/msi/msipriv.h | 1 + dlls/msi/package.c | 35 +++++++++++++++++++++-------------- dlls/msi/tests/install.c | 7 ++----- 4 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 37ad1ab..10443c6 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -674,6 +674,9 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, msi_apply_transforms( package ); msi_apply_patches( package );
+ /* properties may have been added by a transform */ + msi_clone_properties( package ); + if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) >= INSTALLUILEVEL_REDUCED ) { package->script->InWhatSequence |= SEQUENCE_UI; diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 79bda64..3253a5d 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -688,6 +688,7 @@ extern UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ); extern LPCWSTR msi_download_file( LPCWSTR szUrl, LPWSTR filename ); extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR); extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR); +extern UINT msi_clone_properties(MSIPACKAGE *);
/* for deformating */ extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, DWORD * ); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 31bfb7e..2fb7fbe 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -60,10 +60,11 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg) ACTION_free_package_structures(package); }
-static UINT clone_properties(MSIPACKAGE *package) +static UINT create_temp_property_table(MSIPACKAGE *package) { - MSIQUERY * view = NULL; + MSIQUERY *view = NULL; UINT rc; + static const WCHAR CreateSql[] = { 'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','_','P','r','o', 'p','e','r','t','y','`',' ','(',' ','`','_','P','r','o','p','e','r','t', @@ -73,6 +74,22 @@ static UINT clone_properties(MSIPACKAGE *package) 'U','L','L',' ','T','E','M','P','O','R','A','R','Y',' ','P','R','I','M', 'A','R','Y',' ','K','E','Y',' ','`','_','P','r','o','p','e','r','t','y', '`',')',0}; + + rc = MSI_DatabaseOpenViewW(package->db, CreateSql, &view); + if (rc != ERROR_SUCCESS) + return rc; + + rc = MSI_ViewExecute(view, 0); + MSI_ViewClose(view); + msiobj_release(&view->hdr); + return rc; +} + +UINT msi_clone_properties(MSIPACKAGE *package) +{ + MSIQUERY *view = NULL; + UINT rc; + static const WCHAR Query[] = { 'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ','`','P','r','o','p','e','r','t','y','`',0}; @@ -83,17 +100,6 @@ static UINT clone_properties(MSIPACKAGE *package) '`','V','a','l','u','e','`',')',' ', 'V','A','L','U','E','S',' ','(','?',',','?',')',0};
- /* create the temporary properties table */ - rc = MSI_DatabaseOpenViewW(package->db, CreateSql, &view); - if (rc != ERROR_SUCCESS) - return rc; - - rc = MSI_ViewExecute(view, 0); - MSI_ViewClose(view); - msiobj_release(&view->hdr); - if (rc != ERROR_SUCCESS) - return rc; - /* clone the existing properties */ rc = MSI_DatabaseOpenViewW(package->db, Query, &view); if (rc != ERROR_SUCCESS) @@ -735,7 +741,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) package->PackagePath = strdupW( db->path ); package->BaseURL = strdupW( base_url );
- clone_properties( package ); + create_temp_property_table( package ); + msi_clone_properties( package ); set_installer_properties(package); sprintfW(uilevel,szpi,gUILevel); MSI_SetPropertyW(package, szLevel, uilevel); diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 61b5855..341f02d 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2453,11 +2453,8 @@ static void test_transformprop(void)
r = MsiInstallProductA(msifile, "TRANSFORMS=winetest.mst"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - todo_wine - { - ok(delete_pf("msitest\augustus", TRUE), "File not installed\n"); - ok(delete_pf("msitest", FALSE), "File not installed\n"); - } + ok(delete_pf("msitest\augustus", TRUE), "File not installed\n"); + ok(delete_pf("msitest", FALSE), "File not installed\n");
/* Delete the files in the temp (current) folder */ DeleteFile(msifile);