msi: Remove redundant null checks before MSI_EvaluateCondition.

This commit is contained in:
Mike McCormack 2006-10-27 17:29:02 +09:00 committed by Alexandre Julliard
parent b0499bf71b
commit 9375fd9fd3
1 changed files with 13 additions and 22 deletions

View File

@ -700,12 +700,10 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI)
/* check conditions */ /* check conditions */
cond = MSI_RecordGetString(row,2); cond = MSI_RecordGetString(row,2);
if (cond)
{ /* this is a hack to skip errors in the condition code */
/* this is a hack to skip errors in the condition code */ if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE)
if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE) goto end;
goto end;
}
action = MSI_RecordGetString(row,1); action = MSI_RecordGetString(row,1);
if (!action) if (!action)
@ -743,20 +741,17 @@ static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
if (!action) if (!action)
{ {
ERR("Error is retrieving action name\n"); ERR("Error is retrieving action name\n");
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
/* check conditions */ /* check conditions */
cond = MSI_RecordGetString(row,2); cond = MSI_RecordGetString(row,2);
if (cond)
/* this is a hack to skip errors in the condition code */
if (MSI_EvaluateConditionW(iap->package, cond) == MSICONDITION_FALSE)
{ {
/* this is a hack to skip errors in the condition code */ TRACE("Skipping action: %s (condition is false)\n", debugstr_w(action));
if (MSI_EvaluateConditionW(iap->package, cond) == MSICONDITION_FALSE) return ERROR_SUCCESS;
{
TRACE("Skipping action: %s (condition is false)\n",
debugstr_w(action));
return ERROR_SUCCESS;
}
} }
if (iap->UI) if (iap->UI)
@ -2044,14 +2039,10 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
TRACE("Enabling or Disabling Components\n"); TRACE("Enabling or Disabling Components\n");
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{ {
if (comp->Condition) if (MSI_EvaluateConditionW(package, comp->Condition) == MSICONDITION_FALSE)
{ {
if (MSI_EvaluateConditionW(package, TRACE("Disabling component %s\n", debugstr_w(comp->Component));
comp->Condition) == MSICONDITION_FALSE) comp->Enabled = FALSE;
{
TRACE("Disabling component %s\n", debugstr_w(comp->Component));
comp->Enabled = FALSE;
}
} }
} }