msi: Fix the service actions to revert components to the installed state during rollback.
This commit is contained in:
parent
ad84982d92
commit
7dd95a386e
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue