[04/11] msi: Look at the requested action when stopping services, not the action taken.

Hans Leidekker hans at codeweavers.com
Tue Mar 2 07:56:26 CST 2010


---
 dlls/msi/action.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 0011bc5..b99dce2 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -5173,6 +5173,7 @@ static UINT ITERATE_StopService( MSIRECORD *rec, LPVOID param )
 {
     MSIPACKAGE *package = param;
     MSICOMPONENT *comp;
+    LPCWSTR component;
     LPWSTR name;
     DWORD event;
 
@@ -5180,9 +5181,18 @@ static UINT ITERATE_StopService( MSIRECORD *rec, LPVOID param )
     if (!(event & msidbServiceControlEventStop))
         return ERROR_SUCCESS;
 
-    comp = get_loaded_component( package, MSI_RecordGetString( rec, 6 ) );
-    if (!comp || comp->Action == INSTALLSTATE_UNKNOWN || comp->Action == INSTALLSTATE_ABSENT)
+    component = MSI_RecordGetString( rec, 6 );
+    comp = get_loaded_component( package, component );
+    if (!comp)
+        return ERROR_SUCCESS;
+
+    if (comp->ActionRequest != INSTALLSTATE_ABSENT)
+    {
+        TRACE("Component not scheduled for removal: %s\n", debugstr_w(component));
+        comp->Action = comp->Installed;
         return ERROR_SUCCESS;
+    }
+    comp->Action = INSTALLSTATE_ABSENT;
 
     deformat_string( package, MSI_RecordGetString( rec, 2 ), &name );
     stop_service( name );
-- 
1.6.3.3





More information about the wine-patches mailing list