msi: Reload properties as they may have been changed by a transform.

This commit is contained in:
James Hawkins 2007-07-12 11:36:43 -07:00 committed by Alexandre Julliard
parent cf3f442754
commit 30fc5602de
4 changed files with 27 additions and 19 deletions

View File

@ -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;

View File

@ -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 * );

View File

@ -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);

View File

@ -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);