Hans Leidekker : msi: Fix the registry actions to revert components to the installed state during rollback .
Alexandre Julliard
julliard at winehq.org
Tue May 24 12:53:46 CDT 2011
Module: wine
Branch: master
Commit: 50dd7b498a94bab3761885940d5888cbef5f0434
URL: http://source.winehq.org/git/wine.git/?a=commit;h=50dd7b498a94bab3761885940d5888cbef5f0434
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue May 24 10:51:00 2011 +0200
msi: Fix the registry actions to revert components to the installed state during rollback.
---
dlls/msi/action.c | 50 ++++++++++++++------------------------------------
1 files changed, 14 insertions(+), 36 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 54bdc87..27a9903 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -2582,20 +2582,13 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
if (!comp)
return ERROR_SUCCESS;
- if (!comp->Enabled)
+ comp->Action = msi_get_component_action( package, comp );
+ if (comp->Action != INSTALLSTATE_LOCAL)
{
- TRACE("component is disabled\n");
+ TRACE("component not scheduled for installation %s\n", debugstr_w(component));
return ERROR_SUCCESS;
}
- if (comp->ActionRequest != INSTALLSTATE_LOCAL)
- {
- TRACE("Component not scheduled for installation: %s\n", debugstr_w(component));
- comp->Action = comp->Installed;
- return ERROR_SUCCESS;
- }
- comp->Action = INSTALLSTATE_LOCAL;
-
name = MSI_RecordGetString(row, 4);
if( MSI_RecordIsNull(row,5) && name )
{
@@ -2758,19 +2751,12 @@ static UINT ITERATE_RemoveRegistryValuesOnUninstall( MSIRECORD *row, LPVOID para
if (!comp)
return ERROR_SUCCESS;
- if (!comp->Enabled)
- {
- TRACE("component is disabled\n");
- return ERROR_SUCCESS;
- }
-
- if (comp->ActionRequest != INSTALLSTATE_ABSENT)
+ comp->Action = msi_get_component_action( package, comp );
+ if (comp->Action != INSTALLSTATE_ABSENT)
{
- TRACE("Component not scheduled for removal: %s\n", debugstr_w(component));
- comp->Action = comp->Installed;
+ TRACE("component not scheduled for removal %s\n", debugstr_w(component));
return ERROR_SUCCESS;
}
- comp->Action = INSTALLSTATE_ABSENT;
name = MSI_RecordGetString( row, 4 );
if (MSI_RecordIsNull( row, 5 ) && name )
@@ -2835,19 +2821,12 @@ static UINT ITERATE_RemoveRegistryValuesOnInstall( MSIRECORD *row, LPVOID param
if (!comp)
return ERROR_SUCCESS;
- if (!comp->Enabled)
- {
- TRACE("component is disabled\n");
- return ERROR_SUCCESS;
- }
-
- if (comp->ActionRequest != INSTALLSTATE_LOCAL)
+ comp->Action = msi_get_component_action( package, comp );
+ if (comp->Action != INSTALLSTATE_LOCAL)
{
- TRACE("Component not scheduled for installation: %s\n", debugstr_w(component));
- comp->Action = comp->Installed;
+ TRACE("component not scheduled for installation %s\n", debugstr_w(component));
return ERROR_SUCCESS;
}
- comp->Action = INSTALLSTATE_LOCAL;
if ((name = MSI_RecordGetString( row, 4 )))
{
@@ -3252,8 +3231,9 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
comp->RefCount,
comp->ActionRequest);
- if (comp->ActionRequest == INSTALLSTATE_LOCAL ||
- comp->ActionRequest == INSTALLSTATE_SOURCE)
+ comp->Action = msi_get_component_action( package, comp );
+ if (comp->Action == INSTALLSTATE_LOCAL ||
+ comp->Action == INSTALLSTATE_SOURCE)
{
if (package->Context == MSIINSTALLCONTEXT_MACHINE)
rc = MSIREG_OpenUserDataComponentKey(comp->ComponentId, szLocalSid, &hkey, TRUE);
@@ -3273,7 +3253,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
msi_reg_set_val_str(hkey, szPermKey, comp->FullKeypath);
}
- if (comp->ActionRequest == INSTALLSTATE_LOCAL)
+ if (comp->Action == INSTALLSTATE_LOCAL)
msi_reg_set_val_str(hkey, squished_pc, comp->FullKeypath);
else
{
@@ -3313,14 +3293,13 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
}
RegCloseKey(hkey);
}
- else if (comp->ActionRequest == INSTALLSTATE_ABSENT)
+ else if (comp->Action == INSTALLSTATE_ABSENT)
{
if (package->Context == MSIINSTALLCONTEXT_MACHINE)
MSIREG_DeleteUserDataComponentKey(comp->ComponentId, szLocalSid);
else
MSIREG_DeleteUserDataComponentKey(comp->ComponentId, NULL);
}
- comp->Action = comp->ActionRequest;
/* UI stuff */
uirow = MSI_CreateRecord(3);
@@ -3330,7 +3309,6 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
msi_ui_actiondata( package, szProcessComponents, uirow );
msiobj_release( &uirow->hdr );
}
-
return ERROR_SUCCESS;
}
More information about the wine-cvs
mailing list