From 7dd95a386eb499ee7d5b5042eda1f08d4424e880 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Tue, 24 May 2011 10:51:33 +0200 Subject: [PATCH] msi: Fix the service actions to revert components to the installed state during rollback. --- dlls/msi/action.c | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 8e4f2e15899..9a55afcce69 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5517,9 +5517,10 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) WARN("service component not found\n"); goto done; } - if (!component->Enabled) + component->Action = msi_get_component_action( package, component ); + if (component->Action != INSTALLSTATE_LOCAL) { - TRACE("service component disabled\n"); + TRACE("component not scheduled for installation %s\n", debugstr_w(comp)); goto done; } hscm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, GENERIC_WRITE); @@ -5680,19 +5681,12 @@ static UINT ITERATE_StartService(MSIRECORD *rec, 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; deformat_string(package, MSI_RecordGetString(rec, 2), &name); deformat_string(package, MSI_RecordGetString(rec, 4), &args); @@ -5878,19 +5872,12 @@ static UINT ITERATE_StopService( MSIRECORD *rec, LPVOID param ) 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; scm = OpenSCManagerW( NULL, NULL, SC_MANAGER_CONNECT ); if (!scm) @@ -5961,19 +5948,12 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param ) 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; deformat_string( package, MSI_RecordGetString(rec, 2), &name ); stop_service( name ); -- 2.11.4.GIT