msi: Look at the requested action when stopping services, not the action taken.
authorHans Leidekker <hans@codeweavers.com>
Tue, 2 Mar 2010 13:56:26 +0000 (14:56 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 2 Mar 2010 15:11:40 +0000 (16:11 +0100)
dlls/msi/action.c

index 0011bc54e7fe1402fddf2ae7e5000d632b476d06..b99dce24af76f4586196b23e1c91b82a9cfac874 100644 (file)
@@ -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 );