summaryrefslogtreecommitdiff
path: root/src/burn/engine/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/core.cpp')
-rw-r--r--src/burn/engine/core.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index 9d5364a4..ca4d607b 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -315,26 +315,19 @@ extern "C" HRESULT CoreDetect(
315 DetectReset(&pEngineState->registration, &pEngineState->packages); 315 DetectReset(&pEngineState->registration, &pEngineState->packages);
316 PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); 316 PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads);
317 317
318 // Detect if bundle installed state has changed since start up. This 318 // Detect if bundle installed state has changed since start up.
319 // only happens if Apply() changed the state of bundle (installed or 319 // This only happens if Apply() changed the state of bundle (installed, in progress, or uninstalled).
320 // uninstalled). In that case, Detect() can be used here to reset 320 // In that case, Detect() can be used here to reset the installed state.
321 // the installed state. 321 // Of course, there's also cases outside of this bundle's control,
322 // like other processes messing with its registration.
322 hr = RegistrationDetectInstalled(&pEngineState->registration); 323 hr = RegistrationDetectInstalled(&pEngineState->registration);
323 ExitOnFailure(hr, "Failed to detect bundle install state."); 324 ExitOnFailure(hr, "Failed to detect bundle install state.");
324 325
325 if (pEngineState->registration.fInstalled) 326 hr = RegistrationSetDynamicVariables(&pEngineState->registration, &pEngineState->variables);
326 { 327 ExitOnFailure(hr, "Failed to reset the dynamic registration variables during detect.");
327 hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_INSTALLED, 1, TRUE);
328 ExitOnFailure(hr, "Failed to set the bundle installed built-in variable.");
329 }
330 else
331 {
332 hr = VariableSetString(&pEngineState->variables, BURN_BUNDLE_INSTALLED, NULL, TRUE, FALSE);
333 ExitOnFailure(hr, "Failed to unset the bundle installed built-in variable.");
334 }
335 328
336 fDetectBegan = TRUE; 329 fDetectBegan = TRUE;
337 hr = UserExperienceOnDetectBegin(&pEngineState->userExperience, pEngineState->registration.fCached, pEngineState->registration.fInstalled, pEngineState->packages.cPackages); 330 hr = UserExperienceOnDetectBegin(&pEngineState->userExperience, pEngineState->registration.fCached, pEngineState->registration.detectedRegistrationType, pEngineState->packages.cPackages);
338 ExitOnRootFailure(hr, "UX aborted detect begin."); 331 ExitOnRootFailure(hr, "UX aborted detect begin.");
339 332
340 pEngineState->userExperience.hwndDetect = hwndParent; 333 pEngineState->userExperience.hwndDetect = hwndParent;
@@ -444,7 +437,7 @@ LExit:
444 437
445 pEngineState->userExperience.hwndDetect = NULL; 438 pEngineState->userExperience.hwndDetect = NULL;
446 439
447 LogId(REPORT_STANDARD, MSG_DETECT_COMPLETE, hr, !fDetectBegan ? "(failed)" : LoggingBoolToString(pEngineState->registration.fInstalled), !fDetectBegan ? "(failed)" : LoggingBoolToString(pEngineState->registration.fCached), FAILED(hr) ? "(failed)" : LoggingBoolToString(pEngineState->registration.fEligibleForCleanup)); 440 LogId(REPORT_STANDARD, MSG_DETECT_COMPLETE, hr, !fDetectBegan ? "(failed)" : LoggingRegistrationTypeToString(pEngineState->registration.detectedRegistrationType), !fDetectBegan ? "(failed)" : LoggingBoolToString(pEngineState->registration.fCached), FAILED(hr) ? "(failed)" : LoggingBoolToString(pEngineState->registration.fEligibleForCleanup));
448 441
449 return hr; 442 return hr;
450} 443}
@@ -489,7 +482,7 @@ extern "C" HRESULT CorePlan(
489 pEngineState->plan.wzBundleId = pEngineState->registration.sczId; 482 pEngineState->plan.wzBundleId = pEngineState->registration.sczId;
490 pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; 483 pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId;
491 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action; 484 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action;
492 pEngineState->plan.fBundleAlreadyRegistered = pEngineState->registration.fInstalled; 485 pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType;
493 486
494 hr = PlanSetVariables(action, &pEngineState->variables); 487 hr = PlanSetVariables(action, &pEngineState->variables);
495 ExitOnFailure(hr, "Failed to update action."); 488 ExitOnFailure(hr, "Failed to update action.");