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,20 +5681,13 @@ static UINT ITERATE_StartService(MSIRECORD *rec, 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; - deformat_string(package, MSI_RecordGetString(rec, 2), &name); deformat_string(package, MSI_RecordGetString(rec, 4), &args); event = MSI_RecordGetInteger(rec, 3); @@ -5878,20 +5872,13 @@ static UINT ITERATE_StopService( MSIRECORD *rec, LPVOID param ) if (!comp) return ERROR_SUCCESS; - if (!comp->Enabled) + comp->Action = msi_get_component_action( package, comp ); + if (comp->Action != INSTALLSTATE_ABSENT) { - TRACE("component is disabled\n"); + TRACE("component not scheduled for removal %s\n", debugstr_w(component)); 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; - scm = OpenSCManagerW( NULL, NULL, SC_MANAGER_CONNECT ); if (!scm) { @@ -5961,20 +5948,13 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param ) if (!comp) return ERROR_SUCCESS; - if (!comp->Enabled) + comp->Action = msi_get_component_action( package, comp ); + if (comp->Action != INSTALLSTATE_ABSENT) { - TRACE("component is disabled\n"); + TRACE("component not scheduled for removal %s\n", debugstr_w(component)); 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 );