diff options
Diffstat (limited to 'src/burn/engine/apply.cpp')
-rw-r--r-- | src/burn/engine/apply.cpp | 157 |
1 files changed, 74 insertions, 83 deletions
diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index f3b05cf8..6908e955 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp | |||
@@ -390,7 +390,7 @@ extern "C" void ApplyReset( | |||
390 | __in BURN_PACKAGES* pPackages | 390 | __in BURN_PACKAGES* pPackages |
391 | ) | 391 | ) |
392 | { | 392 | { |
393 | UserExperienceExecuteReset(pUX); | 393 | BootstrapperApplicationExecuteReset(pUX); |
394 | 394 | ||
395 | for (DWORD i = 0; i < pPackages->cPackages; ++i) | 395 | for (DWORD i = 0; i < pPackages->cPackages; ++i) |
396 | { | 396 | { |
@@ -444,7 +444,7 @@ extern "C" HRESULT ApplyRegister( | |||
444 | 444 | ||
445 | CalculateKeepRegistration(pEngineState, FALSE, ®istrationType, &qwEstimatedSize); | 445 | CalculateKeepRegistration(pEngineState, FALSE, ®istrationType, &qwEstimatedSize); |
446 | 446 | ||
447 | hr = UserExperienceOnRegisterBegin(&pEngineState->userExperience, ®istrationType); | 447 | hr = BACallbackOnRegisterBegin(&pEngineState->userExperience, ®istrationType); |
448 | ExitOnRootFailure(hr, "BA aborted register begin."); | 448 | ExitOnRootFailure(hr, "BA aborted register begin."); |
449 | 449 | ||
450 | hr = CacheCalculateBundleWorkingPath(pEngineState->plan.pCache, pEngineState->registration.sczExecutableName, &sczEngineWorkingPath); | 450 | hr = CacheCalculateBundleWorkingPath(pEngineState->plan.pCache, pEngineState->registration.sczExecutableName, &sczEngineWorkingPath); |
@@ -474,7 +474,7 @@ extern "C" HRESULT ApplyRegister( | |||
474 | } | 474 | } |
475 | 475 | ||
476 | LExit: | 476 | LExit: |
477 | UserExperienceOnRegisterComplete(&pEngineState->userExperience, hr); | 477 | BACallbackOnRegisterComplete(&pEngineState->userExperience, hr); |
478 | ReleaseStr(sczEngineWorkingPath); | 478 | ReleaseStr(sczEngineWorkingPath); |
479 | 479 | ||
480 | return hr; | 480 | return hr; |
@@ -518,7 +518,7 @@ extern "C" HRESULT ApplyUnregister( | |||
518 | 518 | ||
519 | registrationType = defaultRegistrationType; | 519 | registrationType = defaultRegistrationType; |
520 | 520 | ||
521 | UserExperienceOnUnregisterBegin(&pEngineState->userExperience, ®istrationType); | 521 | BACallbackOnUnregisterBegin(&pEngineState->userExperience, ®istrationType); |
522 | 522 | ||
523 | // Barring the special cases, if it was determined that we should keep the registration then | 523 | // Barring the special cases, if it was determined that we should keep the registration then |
524 | // do that, otherwise the resume mode is NONE and registration will be removed. | 524 | // do that, otherwise the resume mode is NONE and registration will be removed. |
@@ -560,7 +560,7 @@ extern "C" HRESULT ApplyUnregister( | |||
560 | pEngineState->resumeMode = resumeMode; | 560 | pEngineState->resumeMode = resumeMode; |
561 | 561 | ||
562 | LExit: | 562 | LExit: |
563 | UserExperienceOnUnregisterComplete(&pEngineState->userExperience, hr); | 563 | BACallbackOnUnregisterComplete(&pEngineState->userExperience, hr); |
564 | 564 | ||
565 | return hr; | 565 | return hr; |
566 | } | 566 | } |
@@ -579,7 +579,7 @@ extern "C" HRESULT ApplyCache( | |||
579 | BURN_CACHE_CONTEXT cacheContext = { }; | 579 | BURN_CACHE_CONTEXT cacheContext = { }; |
580 | BURN_PACKAGE* pPackage = NULL; | 580 | BURN_PACKAGE* pPackage = NULL; |
581 | 581 | ||
582 | hr = UserExperienceOnCacheBegin(pUX); | 582 | hr = BACallbackOnCacheBegin(pUX); |
583 | ExitOnRootFailure(hr, "BA aborted cache."); | 583 | ExitOnRootFailure(hr, "BA aborted cache."); |
584 | 584 | ||
585 | hr = CacheEnsureAcquisitionFolder(pPlan->pCache); | 585 | hr = CacheEnsureAcquisitionFolder(pPlan->pCache); |
@@ -681,7 +681,7 @@ LExit: | |||
681 | ReleaseMem(cacheContext.rgSearchPaths); | 681 | ReleaseMem(cacheContext.rgSearchPaths); |
682 | ReleaseStr(cacheContext.sczLocalAcquisitionSourcePath); | 682 | ReleaseStr(cacheContext.sczLocalAcquisitionSourcePath); |
683 | 683 | ||
684 | UserExperienceOnCacheComplete(pUX, hr); | 684 | BACallbackOnCacheComplete(pUX, hr); |
685 | return hr; | 685 | return hr; |
686 | } | 686 | } |
687 | 687 | ||
@@ -716,7 +716,7 @@ extern "C" HRESULT ApplyExecute( | |||
716 | *pfSuspend = FALSE; | 716 | *pfSuspend = FALSE; |
717 | 717 | ||
718 | // Send execute begin to BA. | 718 | // Send execute begin to BA. |
719 | hr = UserExperienceOnExecuteBegin(&pEngineState->userExperience, pEngineState->plan.cExecutePackagesTotal); | 719 | hr = BACallbackOnExecuteBegin(&pEngineState->userExperience, pEngineState->plan.cExecutePackagesTotal); |
720 | ExitOnRootFailure(hr, "BA aborted execute begin."); | 720 | ExitOnRootFailure(hr, "BA aborted execute begin."); |
721 | 721 | ||
722 | // Do execute actions. | 722 | // Do execute actions. |
@@ -840,7 +840,7 @@ extern "C" HRESULT ApplyExecute( | |||
840 | 840 | ||
841 | LExit: | 841 | LExit: |
842 | // Send execute complete to BA. | 842 | // Send execute complete to BA. |
843 | UserExperienceOnExecuteComplete(&pEngineState->userExperience, hr); | 843 | BACallbackOnExecuteComplete(&pEngineState->userExperience, hr); |
844 | 844 | ||
845 | return hr; | 845 | return hr; |
846 | } | 846 | } |
@@ -983,7 +983,7 @@ static HRESULT ApplyCachePackage( | |||
983 | { | 983 | { |
984 | fCanceledBegin = FALSE; | 984 | fCanceledBegin = FALSE; |
985 | 985 | ||
986 | hr = UserExperienceOnCachePackageBegin(pContext->pUX, pPackage->sczId, pPackage->payloads.cItems, pPackage->payloads.qwTotalSize, fVital); | 986 | hr = BACallbackOnCachePackageBegin(pContext->pUX, pPackage->sczId, pPackage->payloads.cItems, pPackage->payloads.qwTotalSize, fVital); |
987 | if (FAILED(hr)) | 987 | if (FAILED(hr)) |
988 | { | 988 | { |
989 | fCanceledBegin = TRUE; | 989 | fCanceledBegin = TRUE; |
@@ -1004,7 +1004,7 @@ static HRESULT ApplyCachePackage( | |||
1004 | 1004 | ||
1005 | pPackage->hrCacheResult = hr; | 1005 | pPackage->hrCacheResult = hr; |
1006 | cachePackageCompleteAction = SUCCEEDED(hr) || (pPackage->fVital && fVital) || fCanceledBegin ? BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_NONE : BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_IGNORE; | 1006 | cachePackageCompleteAction = SUCCEEDED(hr) || (pPackage->fVital && fVital) || fCanceledBegin ? BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_NONE : BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_IGNORE; |
1007 | UserExperienceOnCachePackageComplete(pContext->pUX, pPackage->sczId, hr, &cachePackageCompleteAction); | 1007 | BACallbackOnCachePackageComplete(pContext->pUX, pPackage->sczId, hr, &cachePackageCompleteAction); |
1008 | 1008 | ||
1009 | if (SUCCEEDED(hr)) | 1009 | if (SUCCEEDED(hr)) |
1010 | { | 1010 | { |
@@ -1248,7 +1248,7 @@ static HRESULT ApplyProcessPayload( | |||
1248 | } | 1248 | } |
1249 | else if (pPackage && !pPackage->fAcquireOptionalSource && !fVital) | 1249 | else if (pPackage && !pPackage->fAcquireOptionalSource && !fVital) |
1250 | { | 1250 | { |
1251 | HRESULT hrResponse = UserExperienceOnCachePackageNonVitalValidationFailure(pContext->pUX, pPackage->sczId, hr, &action); | 1251 | HRESULT hrResponse = BACallbackOnCachePackageNonVitalValidationFailure(pContext->pUX, pPackage->sczId, hr, &action); |
1252 | ExitOnRootFailure(hrResponse, "BA aborted cache package non-vital failure."); | 1252 | ExitOnRootFailure(hrResponse, "BA aborted cache package non-vital failure."); |
1253 | 1253 | ||
1254 | if (BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_ACQUIRE != action) | 1254 | if (BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION_ACQUIRE != action) |
@@ -1369,10 +1369,10 @@ static HRESULT ExtractContainer( | |||
1369 | hr = PreparePayloadDestinationPath(pExtract->sczUnverifiedPath); | 1369 | hr = PreparePayloadDestinationPath(pExtract->sczUnverifiedPath); |
1370 | ExitOnFailure(hr, "Failed to prepare payload destination path: %ls", pExtract->sczUnverifiedPath); | 1370 | ExitOnFailure(hr, "Failed to prepare payload destination path: %ls", pExtract->sczUnverifiedPath); |
1371 | 1371 | ||
1372 | hr = UserExperienceOnCachePayloadExtractBegin(pContext->pUX, pContainer->sczId, pExtract->sczKey); | 1372 | hr = BACallbackOnCachePayloadExtractBegin(pContext->pUX, pContainer->sczId, pExtract->sczKey); |
1373 | if (FAILED(hr)) | 1373 | if (FAILED(hr)) |
1374 | { | 1374 | { |
1375 | UserExperienceOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); | 1375 | BACallbackOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); |
1376 | ExitOnRootFailure(hr, "BA aborted cache payload extract begin."); | 1376 | ExitOnRootFailure(hr, "BA aborted cache payload extract begin."); |
1377 | } | 1377 | } |
1378 | 1378 | ||
@@ -1386,7 +1386,7 @@ static HRESULT ExtractContainer( | |||
1386 | hr = CompleteCacheProgress(&progress, pExtract->qwFileSize); | 1386 | hr = CompleteCacheProgress(&progress, pExtract->qwFileSize); |
1387 | } | 1387 | } |
1388 | 1388 | ||
1389 | UserExperienceOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); | 1389 | BACallbackOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); |
1390 | ExitOnFailure(hr, "Failed to extract payload: %ls from container: %ls", sczStreamName, pContainer->sczId); | 1390 | ExitOnFailure(hr, "Failed to extract payload: %ls from container: %ls", sczStreamName, pContainer->sczId); |
1391 | 1391 | ||
1392 | fExtracted = TRUE; | 1392 | fExtracted = TRUE; |
@@ -1433,17 +1433,8 @@ static HRESULT LayoutBundle( | |||
1433 | 1433 | ||
1434 | progress.pCacheContext = pContext; | 1434 | progress.pCacheContext = pContext; |
1435 | 1435 | ||
1436 | hr = VariableGetString(pContext->pVariables, BURN_BUNDLE_SOURCE_PROCESS_PATH, &sczBundlePath); | 1436 | hr = PathForCurrentProcess(&sczBundlePath, NULL); |
1437 | if (FAILED(hr)) | 1437 | ExitOnFailure(hr, "Failed to get path to bundle to layout."); |
1438 | { | ||
1439 | if (E_NOTFOUND != hr) | ||
1440 | { | ||
1441 | ExitOnFailure(hr, "Failed to get path to bundle source process path to layout."); | ||
1442 | } | ||
1443 | |||
1444 | hr = PathForCurrentProcess(&sczBundlePath, NULL); | ||
1445 | ExitOnFailure(hr, "Failed to get path to bundle to layout."); | ||
1446 | } | ||
1447 | 1438 | ||
1448 | hr = PathConcatRelativeToFullyQualifiedBase(pContext->wzLayoutDirectory, wzExecutableName, &sczDestinationPath); | 1439 | hr = PathConcatRelativeToFullyQualifiedBase(pContext->wzLayoutDirectory, wzExecutableName, &sczDestinationPath); |
1449 | ExitOnFailure(hr, "Failed to concat layout path for bundle."); | 1440 | ExitOnFailure(hr, "Failed to concat layout path for bundle."); |
@@ -1454,17 +1445,17 @@ static HRESULT LayoutBundle( | |||
1454 | 1445 | ||
1455 | if (fPathEqual && FileExistsEx(sczDestinationPath, NULL)) | 1446 | if (fPathEqual && FileExistsEx(sczDestinationPath, NULL)) |
1456 | { | 1447 | { |
1457 | hr = UserExperienceOnCacheContainerOrPayloadVerifyBegin(pContext->pUX, NULL, NULL); | 1448 | hr = BACallbackOnCacheContainerOrPayloadVerifyBegin(pContext->pUX, NULL, NULL); |
1458 | if (FAILED(hr)) | 1449 | if (FAILED(hr)) |
1459 | { | 1450 | { |
1460 | UserExperienceOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, NULL, NULL, hr); | 1451 | BACallbackOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, NULL, NULL, hr); |
1461 | ExitOnRootFailure(hr, "BA aborted cache payload verify begin."); | 1452 | ExitOnRootFailure(hr, "BA aborted cache payload verify begin."); |
1462 | } | 1453 | } |
1463 | 1454 | ||
1464 | progress.type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; | 1455 | progress.type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; |
1465 | hr = CompleteCacheProgress(&progress, qwBundleSize); | 1456 | hr = CompleteCacheProgress(&progress, qwBundleSize); |
1466 | 1457 | ||
1467 | UserExperienceOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, NULL, NULL, hr); | 1458 | BACallbackOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, NULL, NULL, hr); |
1468 | 1459 | ||
1469 | ExitFunction(); | 1460 | ExitFunction(); |
1470 | } | 1461 | } |
@@ -1481,7 +1472,7 @@ static HRESULT LayoutBundle( | |||
1481 | progress.fCancel = FALSE; | 1472 | progress.fCancel = FALSE; |
1482 | fCanceledBegin = FALSE; | 1473 | fCanceledBegin = FALSE; |
1483 | 1474 | ||
1484 | hr = UserExperienceOnCacheAcquireBegin(pContext->pUX, NULL, NULL, &sczBundlePath, &sczBundleDownloadUrl, NULL, &cacheOperation); | 1475 | hr = BACallbackOnCacheAcquireBegin(pContext->pUX, NULL, NULL, &sczBundlePath, &sczBundleDownloadUrl, NULL, &cacheOperation); |
1485 | 1476 | ||
1486 | if (FAILED(hr)) | 1477 | if (FAILED(hr)) |
1487 | { | 1478 | { |
@@ -1499,7 +1490,7 @@ static HRESULT LayoutBundle( | |||
1499 | } | 1490 | } |
1500 | } | 1491 | } |
1501 | 1492 | ||
1502 | UserExperienceOnCacheAcquireComplete(pContext->pUX, NULL, NULL, hr, &fRetryAcquire); | 1493 | BACallbackOnCacheAcquireComplete(pContext->pUX, NULL, NULL, hr, &fRetryAcquire); |
1503 | if (fRetryAcquire) | 1494 | if (fRetryAcquire) |
1504 | { | 1495 | { |
1505 | continue; | 1496 | continue; |
@@ -1517,7 +1508,7 @@ static HRESULT LayoutBundle( | |||
1517 | { | 1508 | { |
1518 | fCanceledBegin = FALSE; | 1509 | fCanceledBegin = FALSE; |
1519 | 1510 | ||
1520 | hr = UserExperienceOnCacheVerifyBegin(pContext->pUX, NULL, NULL); | 1511 | hr = BACallbackOnCacheVerifyBegin(pContext->pUX, NULL, NULL); |
1521 | 1512 | ||
1522 | if (FAILED(hr)) | 1513 | if (FAILED(hr)) |
1523 | { | 1514 | { |
@@ -1529,7 +1520,7 @@ static HRESULT LayoutBundle( | |||
1529 | } | 1520 | } |
1530 | 1521 | ||
1531 | BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action = BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_NONE; | 1522 | BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action = BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_NONE; |
1532 | UserExperienceOnCacheVerifyComplete(pContext->pUX, NULL, NULL, hr, &action); | 1523 | BACallbackOnCacheVerifyComplete(pContext->pUX, NULL, NULL, hr, &action); |
1533 | if (BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYVERIFICATION == action) | 1524 | if (BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYVERIFICATION == action) |
1534 | { | 1525 | { |
1535 | hr = S_FALSE; // retry verify. | 1526 | hr = S_FALSE; // retry verify. |
@@ -1646,7 +1637,7 @@ static HRESULT AcquireContainerOrPayload( | |||
1646 | *pfRetry = FALSE; | 1637 | *pfRetry = FALSE; |
1647 | pProgress->fCancel = FALSE; | 1638 | pProgress->fCancel = FALSE; |
1648 | 1639 | ||
1649 | hr = UserExperienceOnCacheAcquireBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId, pwzSourcePath, pwzDownloadUrl, wzPayloadContainerId, &cacheOperation); | 1640 | hr = BACallbackOnCacheAcquireBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId, pwzSourcePath, pwzDownloadUrl, wzPayloadContainerId, &cacheOperation); |
1650 | ExitOnRootFailure(hr, "BA aborted cache acquire begin."); | 1641 | ExitOnRootFailure(hr, "BA aborted cache acquire begin."); |
1651 | 1642 | ||
1652 | // Skip the Resolving event and probing local paths if the BA already knew it wanted to download or extract. | 1643 | // Skip the Resolving event and probing local paths if the BA already knew it wanted to download or extract. |
@@ -1746,7 +1737,7 @@ static HRESULT AcquireContainerOrPayload( | |||
1746 | } | 1737 | } |
1747 | 1738 | ||
1748 | // Let the BA have a chance to override the source. | 1739 | // Let the BA have a chance to override the source. |
1749 | hr = UserExperienceOnCacheAcquireResolving(pContext->pUX, wzPackageOrContainerId, wzPayloadId, pContext->rgSearchPaths, pContext->cSearchPaths, fFoundLocal, &dwChosenSearchPath, pwzDownloadUrl, wzPayloadContainerId, &resolveOperation); | 1740 | hr = BACallbackOnCacheAcquireResolving(pContext->pUX, wzPackageOrContainerId, wzPayloadId, pContext->rgSearchPaths, pContext->cSearchPaths, fFoundLocal, &dwChosenSearchPath, pwzDownloadUrl, wzPayloadContainerId, &resolveOperation); |
1750 | ExitOnRootFailure(hr, "BA aborted cache acquire resolving."); | 1741 | ExitOnRootFailure(hr, "BA aborted cache acquire resolving."); |
1751 | 1742 | ||
1752 | switch (resolveOperation) | 1743 | switch (resolveOperation) |
@@ -1816,7 +1807,7 @@ LExit: | |||
1816 | } | 1807 | } |
1817 | pPayload->pContainer->fExtracted = TRUE; | 1808 | pPayload->pContainer->fExtracted = TRUE; |
1818 | } | 1809 | } |
1819 | UserExperienceOnCacheAcquireComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr, pfRetry); | 1810 | BACallbackOnCacheAcquireComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr, pfRetry); |
1820 | 1811 | ||
1821 | pContext->cSearchPathsMax = max(pContext->cSearchPaths, pContext->cSearchPathsMax); | 1812 | pContext->cSearchPathsMax = max(pContext->cSearchPaths, pContext->cSearchPathsMax); |
1822 | 1813 | ||
@@ -1891,7 +1882,7 @@ static HRESULT LayoutOrCacheContainerOrPayload( | |||
1891 | { | 1882 | { |
1892 | fCanceledBegin = FALSE; | 1883 | fCanceledBegin = FALSE; |
1893 | 1884 | ||
1894 | hr = UserExperienceOnCacheVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId); | 1885 | hr = BACallbackOnCacheVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId); |
1895 | 1886 | ||
1896 | if (FAILED(hr)) | 1887 | if (FAILED(hr)) |
1897 | { | 1888 | { |
@@ -1926,7 +1917,7 @@ static HRESULT LayoutOrCacheContainerOrPayload( | |||
1926 | } | 1917 | } |
1927 | 1918 | ||
1928 | BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action = FAILED(hr) && !fCanceledBegin && cTryAgainAttempts < BURN_CACHE_MAX_RECOMMENDED_VERIFY_TRYAGAIN_ATTEMPTS ? BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYACQUISITION : BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_NONE; | 1919 | BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action = FAILED(hr) && !fCanceledBegin && cTryAgainAttempts < BURN_CACHE_MAX_RECOMMENDED_VERIFY_TRYAGAIN_ATTEMPTS ? BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYACQUISITION : BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_NONE; |
1929 | UserExperienceOnCacheVerifyComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr, &action); | 1920 | BACallbackOnCacheVerifyComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr, &action); |
1930 | if (BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYVERIFICATION == action) | 1921 | if (BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION_RETRYVERIFICATION == action) |
1931 | { | 1922 | { |
1932 | hr = S_FALSE; // retry verify. | 1923 | hr = S_FALSE; // retry verify. |
@@ -2098,8 +2089,8 @@ static HRESULT WINAPI AuthenticationRequired( | |||
2098 | 2089 | ||
2099 | APPLY_AUTHENTICATION_REQUIRED_DATA* authenticationData = reinterpret_cast<APPLY_AUTHENTICATION_REQUIRED_DATA*>(pData); | 2090 | APPLY_AUTHENTICATION_REQUIRED_DATA* authenticationData = reinterpret_cast<APPLY_AUTHENTICATION_REQUIRED_DATA*>(pData); |
2100 | 2091 | ||
2101 | UserExperienceOnError(authenticationData->pUX, errorType, authenticationData->wzPackageOrContainerId, ERROR_ACCESS_DENIED, sczError, MB_RETRYCANCEL, 0, NULL, &nResult); // ignore return value; | 2092 | BACallbackOnError(authenticationData->pUX, errorType, authenticationData->wzPackageOrContainerId, ERROR_ACCESS_DENIED, sczError, MB_RETRYCANCEL, 0, NULL, &nResult); // ignore return value; |
2102 | nResult = UserExperienceCheckExecuteResult(authenticationData->pUX, FALSE, BURN_MB_RETRYTRYAGAIN, nResult); | 2093 | nResult = BootstrapperApplicationCheckExecuteResult(authenticationData->pUX, FALSE, BURN_MB_RETRYTRYAGAIN, nResult); |
2103 | if (IDTRYAGAIN == nResult && authenticationData->pUX->hwndApply) | 2094 | if (IDTRYAGAIN == nResult && authenticationData->pUX->hwndApply) |
2104 | { | 2095 | { |
2105 | er = ::InternetErrorDlg(authenticationData->pUX->hwndApply, hUrl, ERROR_INTERNET_INCORRECT_PASSWORD, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA, NULL); | 2096 | er = ::InternetErrorDlg(authenticationData->pUX->hwndApply, hUrl, ERROR_INTERNET_INCORRECT_PASSWORD, FLAGS_ERROR_UI_FILTER_FOR_ERRORS | FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | FLAGS_ERROR_UI_FLAGS_GENERATE_DATA, NULL); |
@@ -2150,7 +2141,7 @@ static HRESULT CALLBACK CacheMessageHandler( | |||
2150 | { | 2141 | { |
2151 | case BURN_CACHE_STEP_HASH_TO_SKIP_ACQUIRE: | 2142 | case BURN_CACHE_STEP_HASH_TO_SKIP_ACQUIRE: |
2152 | pProgress->type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; | 2143 | pProgress->type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; |
2153 | hr = UserExperienceOnCacheContainerOrPayloadVerifyBegin(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId); | 2144 | hr = BACallbackOnCacheContainerOrPayloadVerifyBegin(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId); |
2154 | break; | 2145 | break; |
2155 | case BURN_CACHE_STEP_HASH_TO_SKIP_VERIFY: | 2146 | case BURN_CACHE_STEP_HASH_TO_SKIP_VERIFY: |
2156 | pProgress->type = BURN_CACHE_PROGRESS_TYPE_PAYLOAD_VERIFY; | 2147 | pProgress->type = BURN_CACHE_PROGRESS_TYPE_PAYLOAD_VERIFY; |
@@ -2173,7 +2164,7 @@ static HRESULT CALLBACK CacheMessageHandler( | |||
2173 | switch (pProgress->type) | 2164 | switch (pProgress->type) |
2174 | { | 2165 | { |
2175 | case BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY: | 2166 | case BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY: |
2176 | hr = UserExperienceOnCacheContainerOrPayloadVerifyComplete(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, hr); | 2167 | hr = BACallbackOnCacheContainerOrPayloadVerifyComplete(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, hr); |
2177 | break; | 2168 | break; |
2178 | } | 2169 | } |
2179 | case BURN_CACHE_MESSAGE_FAILURE: | 2170 | case BURN_CACHE_MESSAGE_FAILURE: |
@@ -2321,31 +2312,31 @@ static DWORD CALLBACK CacheProgressRoutine( | |||
2321 | switch (pProgress->type) | 2312 | switch (pProgress->type) |
2322 | { | 2313 | { |
2323 | case BURN_CACHE_PROGRESS_TYPE_ACQUIRE: | 2314 | case BURN_CACHE_PROGRESS_TYPE_ACQUIRE: |
2324 | hr = UserExperienceOnCacheAcquireProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); | 2315 | hr = BACallbackOnCacheAcquireProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); |
2325 | ExitOnRootFailure(hr, "BA aborted acquire of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); | 2316 | ExitOnRootFailure(hr, "BA aborted acquire of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); |
2326 | break; | 2317 | break; |
2327 | case BURN_CACHE_PROGRESS_TYPE_PAYLOAD_VERIFY: | 2318 | case BURN_CACHE_PROGRESS_TYPE_PAYLOAD_VERIFY: |
2328 | hr = UserExperienceOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_HASH); | 2319 | hr = BACallbackOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_HASH); |
2329 | ExitOnRootFailure(hr, "BA aborted payload verify step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); | 2320 | ExitOnRootFailure(hr, "BA aborted payload verify step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); |
2330 | break; | 2321 | break; |
2331 | case BURN_CACHE_PROGRESS_TYPE_STAGE: | 2322 | case BURN_CACHE_PROGRESS_TYPE_STAGE: |
2332 | hr = UserExperienceOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_STAGE); | 2323 | hr = BACallbackOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_STAGE); |
2333 | ExitOnRootFailure(hr, "BA aborted stage step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); | 2324 | ExitOnRootFailure(hr, "BA aborted stage step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); |
2334 | break; | 2325 | break; |
2335 | case BURN_CACHE_PROGRESS_TYPE_HASH: | 2326 | case BURN_CACHE_PROGRESS_TYPE_HASH: |
2336 | hr = UserExperienceOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_HASH); | 2327 | hr = BACallbackOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_HASH); |
2337 | ExitOnRootFailure(hr, "BA aborted hash step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); | 2328 | ExitOnRootFailure(hr, "BA aborted hash step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); |
2338 | break; | 2329 | break; |
2339 | case BURN_CACHE_PROGRESS_TYPE_FINALIZE: | 2330 | case BURN_CACHE_PROGRESS_TYPE_FINALIZE: |
2340 | hr = UserExperienceOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_FINALIZE); | 2331 | hr = BACallbackOnCacheVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage, BOOTSTRAPPER_CACHE_VERIFY_STEP_FINALIZE); |
2341 | ExitOnRootFailure(hr, "BA aborted finalize step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); | 2332 | ExitOnRootFailure(hr, "BA aborted finalize step during verify of %hs: %ls", pProgress->pContainer ? "container" : "payload", pProgress->pContainer ? wzPackageOrContainerId : wzPayloadId); |
2342 | break; | 2333 | break; |
2343 | case BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY: | 2334 | case BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY: |
2344 | hr = UserExperienceOnCacheContainerOrPayloadVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); | 2335 | hr = BACallbackOnCacheContainerOrPayloadVerifyProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); |
2345 | ExitOnRootFailure(hr, "BA aborted container or payload verify: %ls", wzPayloadId); | 2336 | ExitOnRootFailure(hr, "BA aborted container or payload verify: %ls", wzPayloadId); |
2346 | break; | 2337 | break; |
2347 | case BURN_CACHE_PROGRESS_TYPE_EXTRACT: | 2338 | case BURN_CACHE_PROGRESS_TYPE_EXTRACT: |
2348 | hr = UserExperienceOnCachePayloadExtractProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); | 2339 | hr = BACallbackOnCachePayloadExtractProgress(pProgress->pCacheContext->pUX, wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); |
2349 | ExitOnRootFailure(hr, "BA aborted extract container: %ls, payload: %ls", wzPackageOrContainerId, wzPayloadId); | 2340 | ExitOnRootFailure(hr, "BA aborted extract container: %ls, payload: %ls", wzPackageOrContainerId, wzPayloadId); |
2350 | break; | 2341 | break; |
2351 | } | 2342 | } |
@@ -2752,14 +2743,14 @@ static HRESULT ExecuteRelatedBundle( | |||
2752 | fBeginCalled = TRUE; | 2743 | fBeginCalled = TRUE; |
2753 | 2744 | ||
2754 | // Send package execute begin to BA. | 2745 | // Send package execute begin to BA. |
2755 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->relatedBundle.action, INSTALLUILEVEL_NOCHANGE, FALSE); | 2746 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->relatedBundle.action, INSTALLUILEVEL_NOCHANGE, FALSE); |
2756 | ExitOnRootFailure(hr, "BA aborted execute related bundle begin."); | 2747 | ExitOnRootFailure(hr, "BA aborted execute related bundle begin."); |
2757 | 2748 | ||
2758 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 2749 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
2759 | message.dwUIHint = MB_OKCANCEL; | 2750 | message.dwUIHint = MB_OKCANCEL; |
2760 | message.progress.dwPercentage = fRollback ? 100 : 0; | 2751 | message.progress.dwPercentage = fRollback ? 100 : 0; |
2761 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2752 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2762 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2753 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2763 | ExitOnRootFailure(hr, "BA aborted related bundle progress."); | 2754 | ExitOnRootFailure(hr, "BA aborted related bundle progress."); |
2764 | 2755 | ||
2765 | // Execute package. | 2756 | // Execute package. |
@@ -2778,7 +2769,7 @@ static HRESULT ExecuteRelatedBundle( | |||
2778 | message.dwUIHint = MB_OKCANCEL; | 2769 | message.dwUIHint = MB_OKCANCEL; |
2779 | message.progress.dwPercentage = fRollback ? 0 : 100; | 2770 | message.progress.dwPercentage = fRollback ? 0 : 100; |
2780 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2771 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2781 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2772 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2782 | ExitOnRootFailure(hr, "BA aborted related bundle progress."); | 2773 | ExitOnRootFailure(hr, "BA aborted related bundle progress."); |
2783 | 2774 | ||
2784 | pContext->cExecutedPackages += fRollback ? -1 : 1; | 2775 | pContext->cExecutedPackages += fRollback ? -1 : 1; |
@@ -2877,14 +2868,14 @@ static HRESULT ExecuteBundlePackage( | |||
2877 | fBeginCalled = TRUE; | 2868 | fBeginCalled = TRUE; |
2878 | 2869 | ||
2879 | // Send package execute begin to BA. | 2870 | // Send package execute begin to BA. |
2880 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->bundlePackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); | 2871 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->bundlePackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); |
2881 | ExitOnRootFailure(hr, "BA aborted execute BUNDLE package begin."); | 2872 | ExitOnRootFailure(hr, "BA aborted execute BUNDLE package begin."); |
2882 | 2873 | ||
2883 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 2874 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
2884 | message.dwUIHint = MB_OKCANCEL; | 2875 | message.dwUIHint = MB_OKCANCEL; |
2885 | message.progress.dwPercentage = fRollback ? 100 : 0; | 2876 | message.progress.dwPercentage = fRollback ? 100 : 0; |
2886 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2877 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2887 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2878 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2888 | ExitOnRootFailure(hr, "BA aborted BUNDLE progress."); | 2879 | ExitOnRootFailure(hr, "BA aborted BUNDLE progress."); |
2889 | 2880 | ||
2890 | fExecuted = TRUE; | 2881 | fExecuted = TRUE; |
@@ -2905,7 +2896,7 @@ static HRESULT ExecuteBundlePackage( | |||
2905 | message.dwUIHint = MB_OKCANCEL; | 2896 | message.dwUIHint = MB_OKCANCEL; |
2906 | message.progress.dwPercentage = fRollback ? 0 : 100; | 2897 | message.progress.dwPercentage = fRollback ? 0 : 100; |
2907 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2898 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2908 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2899 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2909 | ExitOnRootFailure(hr, "BA aborted BUNDLE progress."); | 2900 | ExitOnRootFailure(hr, "BA aborted BUNDLE progress."); |
2910 | 2901 | ||
2911 | pContext->cExecutedPackages += fRollback ? -1 : 1; | 2902 | pContext->cExecutedPackages += fRollback ? -1 : 1; |
@@ -2957,14 +2948,14 @@ static HRESULT ExecuteExePackage( | |||
2957 | fBeginCalled = TRUE; | 2948 | fBeginCalled = TRUE; |
2958 | 2949 | ||
2959 | // Send package execute begin to BA. | 2950 | // Send package execute begin to BA. |
2960 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->exePackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); | 2951 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->exePackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); |
2961 | ExitOnRootFailure(hr, "BA aborted execute EXE package begin."); | 2952 | ExitOnRootFailure(hr, "BA aborted execute EXE package begin."); |
2962 | 2953 | ||
2963 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 2954 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
2964 | message.dwUIHint = MB_OKCANCEL; | 2955 | message.dwUIHint = MB_OKCANCEL; |
2965 | message.progress.dwPercentage = fRollback ? 100 : 0; | 2956 | message.progress.dwPercentage = fRollback ? 100 : 0; |
2966 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2957 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2967 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2958 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2968 | ExitOnRootFailure(hr, "BA aborted EXE progress."); | 2959 | ExitOnRootFailure(hr, "BA aborted EXE progress."); |
2969 | 2960 | ||
2970 | fExecuted = TRUE; | 2961 | fExecuted = TRUE; |
@@ -2985,7 +2976,7 @@ static HRESULT ExecuteExePackage( | |||
2985 | message.dwUIHint = MB_OKCANCEL; | 2976 | message.dwUIHint = MB_OKCANCEL; |
2986 | message.progress.dwPercentage = fRollback ? 0 : 100; | 2977 | message.progress.dwPercentage = fRollback ? 0 : 100; |
2987 | nResult = GenericExecuteMessageHandler(&message, pContext); | 2978 | nResult = GenericExecuteMessageHandler(&message, pContext); |
2988 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 2979 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
2989 | ExitOnRootFailure(hr, "BA aborted EXE progress."); | 2980 | ExitOnRootFailure(hr, "BA aborted EXE progress."); |
2990 | 2981 | ||
2991 | pContext->cExecutedPackages += fRollback ? -1 : 1; | 2982 | pContext->cExecutedPackages += fRollback ? -1 : 1; |
@@ -3036,7 +3027,7 @@ static HRESULT ExecuteMsiPackage( | |||
3036 | fBeginCalled = TRUE; | 3027 | fBeginCalled = TRUE; |
3037 | 3028 | ||
3038 | // Send package execute begin to BA. | 3029 | // Send package execute begin to BA. |
3039 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->msiPackage.action, pExecuteAction->msiPackage.uiLevel, pExecuteAction->msiPackage.fDisableExternalUiHandler); | 3030 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->msiPackage.action, pExecuteAction->msiPackage.uiLevel, pExecuteAction->msiPackage.fDisableExternalUiHandler); |
3040 | ExitOnRootFailure(hr, "BA aborted execute MSI package begin."); | 3031 | ExitOnRootFailure(hr, "BA aborted execute MSI package begin."); |
3041 | 3032 | ||
3042 | fExecuted = TRUE; | 3033 | fExecuted = TRUE; |
@@ -3101,7 +3092,7 @@ static HRESULT ExecuteMspPackage( | |||
3101 | fBeginCalled = TRUE; | 3092 | fBeginCalled = TRUE; |
3102 | 3093 | ||
3103 | // Send package execute begin to BA. | 3094 | // Send package execute begin to BA. |
3104 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->mspTarget.action, pExecuteAction->mspTarget.uiLevel, pExecuteAction->mspTarget.fDisableExternalUiHandler); | 3095 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->mspTarget.action, pExecuteAction->mspTarget.uiLevel, pExecuteAction->mspTarget.fDisableExternalUiHandler); |
3105 | ExitOnRootFailure(hr, "BA aborted execute MSP package begin."); | 3096 | ExitOnRootFailure(hr, "BA aborted execute MSP package begin."); |
3106 | 3097 | ||
3107 | // Now send all the patches that target this product code. | 3098 | // Now send all the patches that target this product code. |
@@ -3109,7 +3100,7 @@ static HRESULT ExecuteMspPackage( | |||
3109 | { | 3100 | { |
3110 | BURN_PACKAGE* pMspPackage = pExecuteAction->mspTarget.rgOrderedPatches[i].pPackage; | 3101 | BURN_PACKAGE* pMspPackage = pExecuteAction->mspTarget.rgOrderedPatches[i].pPackage; |
3111 | 3102 | ||
3112 | hr = UserExperienceOnExecutePatchTarget(&pEngineState->userExperience, pMspPackage->sczId, pExecuteAction->mspTarget.sczTargetProductCode); | 3103 | hr = BACallbackOnExecutePatchTarget(&pEngineState->userExperience, pMspPackage->sczId, pExecuteAction->mspTarget.sczTargetProductCode); |
3113 | ExitOnRootFailure(hr, "BA aborted execute MSP target."); | 3104 | ExitOnRootFailure(hr, "BA aborted execute MSP target."); |
3114 | } | 3105 | } |
3115 | 3106 | ||
@@ -3177,14 +3168,14 @@ static HRESULT ExecuteMsuPackage( | |||
3177 | fBeginCalled = TRUE; | 3168 | fBeginCalled = TRUE; |
3178 | 3169 | ||
3179 | // Send package execute begin to BA. | 3170 | // Send package execute begin to BA. |
3180 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->msuPackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); | 3171 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pPackage->sczId, !fRollback, pExecuteAction->msuPackage.action, INSTALLUILEVEL_NOCHANGE, FALSE); |
3181 | ExitOnRootFailure(hr, "BA aborted execute MSU package begin."); | 3172 | ExitOnRootFailure(hr, "BA aborted execute MSU package begin."); |
3182 | 3173 | ||
3183 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 3174 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
3184 | message.dwUIHint = MB_OKCANCEL; | 3175 | message.dwUIHint = MB_OKCANCEL; |
3185 | message.progress.dwPercentage = fRollback ? 100 : 0; | 3176 | message.progress.dwPercentage = fRollback ? 100 : 0; |
3186 | nResult = GenericExecuteMessageHandler(&message, pContext); | 3177 | nResult = GenericExecuteMessageHandler(&message, pContext); |
3187 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 3178 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
3188 | ExitOnRootFailure(hr, "BA aborted MSU progress."); | 3179 | ExitOnRootFailure(hr, "BA aborted MSU progress."); |
3189 | 3180 | ||
3190 | fExecuted = TRUE; | 3181 | fExecuted = TRUE; |
@@ -3205,7 +3196,7 @@ static HRESULT ExecuteMsuPackage( | |||
3205 | message.dwUIHint = MB_OKCANCEL; | 3196 | message.dwUIHint = MB_OKCANCEL; |
3206 | message.progress.dwPercentage = fRollback ? 0 : 100; | 3197 | message.progress.dwPercentage = fRollback ? 0 : 100; |
3207 | nResult = GenericExecuteMessageHandler(&message, pContext); | 3198 | nResult = GenericExecuteMessageHandler(&message, pContext); |
3208 | hr = UserExperienceInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); | 3199 | hr = BootstrapperApplicationInterpretExecuteResult(&pEngineState->userExperience, fRollback, message.dwUIHint, nResult); |
3209 | ExitOnRootFailure(hr, "BA aborted MSU progress."); | 3200 | ExitOnRootFailure(hr, "BA aborted MSU progress."); |
3210 | 3201 | ||
3211 | pContext->cExecutedPackages += fRollback ? -1 : 1; | 3202 | pContext->cExecutedPackages += fRollback ? -1 : 1; |
@@ -3351,7 +3342,7 @@ static HRESULT ExecuteMsiBeginTransaction( | |||
3351 | } | 3342 | } |
3352 | 3343 | ||
3353 | fBeginCalled = TRUE; | 3344 | fBeginCalled = TRUE; |
3354 | hr = UserExperienceOnBeginMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); | 3345 | hr = BACallbackOnBeginMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); |
3355 | ExitOnRootFailure(hr, "BA aborted execute begin MSI transaction."); | 3346 | ExitOnRootFailure(hr, "BA aborted execute begin MSI transaction."); |
3356 | 3347 | ||
3357 | if (pEngineState->plan.fPerMachine) | 3348 | if (pEngineState->plan.fPerMachine) |
@@ -3374,7 +3365,7 @@ static HRESULT ExecuteMsiBeginTransaction( | |||
3374 | LExit: | 3365 | LExit: |
3375 | if (fBeginCalled) | 3366 | if (fBeginCalled) |
3376 | { | 3367 | { |
3377 | UserExperienceOnBeginMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); | 3368 | BACallbackOnBeginMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); |
3378 | } | 3369 | } |
3379 | 3370 | ||
3380 | return hr; | 3371 | return hr; |
@@ -3397,7 +3388,7 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
3397 | } | 3388 | } |
3398 | 3389 | ||
3399 | fCommitBeginCalled = TRUE; | 3390 | fCommitBeginCalled = TRUE; |
3400 | hr = UserExperienceOnCommitMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); | 3391 | hr = BACallbackOnCommitMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); |
3401 | ExitOnRootFailure(hr, "BA aborted execute commit MSI transaction."); | 3392 | ExitOnRootFailure(hr, "BA aborted execute commit MSI transaction."); |
3402 | 3393 | ||
3403 | if (pEngineState->plan.fPerMachine) | 3394 | if (pEngineState->plan.fPerMachine) |
@@ -3418,7 +3409,7 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
3418 | LExit: | 3409 | LExit: |
3419 | if (fCommitBeginCalled) | 3410 | if (fCommitBeginCalled) |
3420 | { | 3411 | { |
3421 | UserExperienceOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); | 3412 | BACallbackOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
3422 | 3413 | ||
3423 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | 3414 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) |
3424 | { | 3415 | { |
@@ -3446,7 +3437,7 @@ static HRESULT ExecuteMsiRollbackTransaction( | |||
3446 | } | 3437 | } |
3447 | 3438 | ||
3448 | fRollbackBeginCalled = TRUE; | 3439 | fRollbackBeginCalled = TRUE; |
3449 | UserExperienceOnRollbackMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); | 3440 | BACallbackOnRollbackMsiTransactionBegin(&pEngineState->userExperience, pRollbackBoundary->sczId); |
3450 | 3441 | ||
3451 | if (pEngineState->plan.fPerMachine) | 3442 | if (pEngineState->plan.fPerMachine) |
3452 | { | 3443 | { |
@@ -3465,7 +3456,7 @@ LExit: | |||
3465 | 3456 | ||
3466 | if (fRollbackBeginCalled) | 3457 | if (fRollbackBeginCalled) |
3467 | { | 3458 | { |
3468 | UserExperienceOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); | 3459 | BACallbackOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
3469 | 3460 | ||
3470 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | 3461 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) |
3471 | { | 3462 | { |
@@ -3531,7 +3522,7 @@ static HRESULT ExecuteUninstallMsiCompatiblePackage( | |||
3531 | fBeginCalled = TRUE; | 3522 | fBeginCalled = TRUE; |
3532 | 3523 | ||
3533 | // Send package execute begin to BA. | 3524 | // Send package execute begin to BA. |
3534 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pContext->wzExecutingPackageId, !fRollback, action, uiLevel, fDisableExternalUiHandler); | 3525 | hr = BACallbackOnExecutePackageBegin(&pEngineState->userExperience, pContext->wzExecutingPackageId, !fRollback, action, uiLevel, fDisableExternalUiHandler); |
3535 | ExitOnRootFailure(hr, "BA aborted execute MSI compatible package begin."); | 3526 | ExitOnRootFailure(hr, "BA aborted execute MSI compatible package begin."); |
3536 | 3527 | ||
3537 | // execute package | 3528 | // execute package |
@@ -3622,14 +3613,14 @@ static int GenericExecuteMessageHandler( | |||
3622 | case GENERIC_EXECUTE_MESSAGE_PROGRESS: | 3613 | case GENERIC_EXECUTE_MESSAGE_PROGRESS: |
3623 | { | 3614 | { |
3624 | DWORD dwOverallProgress = pContext->cExecutePackagesTotal ? (pContext->cExecutedPackages * 100 + pMessage->progress.dwPercentage) / (pContext->cExecutePackagesTotal) : 0; | 3615 | DWORD dwOverallProgress = pContext->cExecutePackagesTotal ? (pContext->cExecutedPackages * 100 + pMessage->progress.dwPercentage) / (pContext->cExecutePackagesTotal) : 0; |
3625 | UserExperienceOnExecuteProgress(pContext->pUX, pContext->wzExecutingPackageId, pMessage->progress.dwPercentage, dwOverallProgress, &nResult); // ignore return value. | 3616 | BACallbackOnExecuteProgress(pContext->pUX, pContext->wzExecutingPackageId, pMessage->progress.dwPercentage, dwOverallProgress, &nResult); // ignore return value. |
3626 | } | 3617 | } |
3627 | break; | 3618 | break; |
3628 | 3619 | ||
3629 | case GENERIC_EXECUTE_MESSAGE_PROCESS_CANCEL: | 3620 | case GENERIC_EXECUTE_MESSAGE_PROCESS_CANCEL: |
3630 | { | 3621 | { |
3631 | BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION action = BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION_ABANDON; | 3622 | BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION action = BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION_ABANDON; |
3632 | UserExperienceOnExecuteProcessCancel(pContext->pUX, pContext->wzExecutingPackageId, pMessage->processCancel.dwProcessId, &action); // ignore return value. | 3623 | BACallbackOnExecuteProcessCancel(pContext->pUX, pContext->wzExecutingPackageId, pMessage->processCancel.dwProcessId, &action); // ignore return value. |
3633 | nResult = BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION_WAIT == action ? IDRETRY : IDIGNORE; | 3624 | nResult = BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION_WAIT == action ? IDRETRY : IDIGNORE; |
3634 | } | 3625 | } |
3635 | break; | 3626 | break; |
@@ -3643,18 +3634,18 @@ static int GenericExecuteMessageHandler( | |||
3643 | break; | 3634 | break; |
3644 | 3635 | ||
3645 | case GENERIC_EXECUTE_MESSAGE_ERROR: | 3636 | case GENERIC_EXECUTE_MESSAGE_ERROR: |
3646 | UserExperienceOnError(pContext->pUX, BOOTSTRAPPER_ERROR_TYPE_EXE_PACKAGE, pContext->wzExecutingPackageId, pMessage->error.dwErrorCode, pMessage->error.wzMessage, pMessage->dwUIHint, 0, NULL, &nResult); // ignore return value. | 3637 | BACallbackOnError(pContext->pUX, BOOTSTRAPPER_ERROR_TYPE_EXE_PACKAGE, pContext->wzExecutingPackageId, pMessage->error.dwErrorCode, pMessage->error.wzMessage, pMessage->dwUIHint, 0, NULL, &nResult); // ignore return value. |
3647 | break; | 3638 | break; |
3648 | 3639 | ||
3649 | case GENERIC_EXECUTE_MESSAGE_NETFX_FILES_IN_USE: | 3640 | case GENERIC_EXECUTE_MESSAGE_NETFX_FILES_IN_USE: |
3650 | UserExperienceOnExecuteFilesInUse(pContext->pUX, pContext->wzExecutingPackageId, pMessage->filesInUse.cFiles, pMessage->filesInUse.rgwzFiles, BOOTSTRAPPER_FILES_IN_USE_TYPE_NETFX, &nResult); // ignore return value. | 3641 | BACallbackOnExecuteFilesInUse(pContext->pUX, pContext->wzExecutingPackageId, pMessage->filesInUse.cFiles, pMessage->filesInUse.rgwzFiles, BOOTSTRAPPER_FILES_IN_USE_TYPE_NETFX, &nResult); // ignore return value. |
3651 | fPassthrough = TRUE; | 3642 | fPassthrough = TRUE; |
3652 | break; | 3643 | break; |
3653 | } | 3644 | } |
3654 | 3645 | ||
3655 | if (!fPassthrough) | 3646 | if (!fPassthrough) |
3656 | { | 3647 | { |
3657 | nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult); | 3648 | nResult = BootstrapperApplicationCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult); |
3658 | } | 3649 | } |
3659 | 3650 | ||
3660 | return nResult; | 3651 | return nResult; |
@@ -3676,32 +3667,32 @@ static int MsiExecuteMessageHandler( | |||
3676 | case WIU_MSI_EXECUTE_MESSAGE_PROGRESS: | 3667 | case WIU_MSI_EXECUTE_MESSAGE_PROGRESS: |
3677 | { | 3668 | { |
3678 | DWORD dwOverallProgress = pContext->cExecutePackagesTotal ? (pContext->cExecutedPackages * 100 + pMessage->progress.dwPercentage) / (pContext->cExecutePackagesTotal) : 0; | 3669 | DWORD dwOverallProgress = pContext->cExecutePackagesTotal ? (pContext->cExecutedPackages * 100 + pMessage->progress.dwPercentage) / (pContext->cExecutePackagesTotal) : 0; |
3679 | UserExperienceOnExecuteProgress(pContext->pUX, pContext->wzExecutingPackageId, pMessage->progress.dwPercentage, dwOverallProgress, &nResult); // ignore return value. | 3670 | BACallbackOnExecuteProgress(pContext->pUX, pContext->wzExecutingPackageId, pMessage->progress.dwPercentage, dwOverallProgress, &nResult); // ignore return value. |
3680 | } | 3671 | } |
3681 | break; | 3672 | break; |
3682 | 3673 | ||
3683 | case WIU_MSI_EXECUTE_MESSAGE_ERROR: | 3674 | case WIU_MSI_EXECUTE_MESSAGE_ERROR: |
3684 | nResult = pMessage->nResultRecommendation; | 3675 | nResult = pMessage->nResultRecommendation; |
3685 | UserExperienceOnError(pContext->pUX, BOOTSTRAPPER_ERROR_TYPE_WINDOWS_INSTALLER, pContext->wzExecutingPackageId, pMessage->error.dwErrorCode, pMessage->error.wzMessage, pMessage->dwUIHint, pMessage->cData, pMessage->rgwzData, &nResult); // ignore return value. | 3676 | BACallbackOnError(pContext->pUX, BOOTSTRAPPER_ERROR_TYPE_WINDOWS_INSTALLER, pContext->wzExecutingPackageId, pMessage->error.dwErrorCode, pMessage->error.wzMessage, pMessage->dwUIHint, pMessage->cData, pMessage->rgwzData, &nResult); // ignore return value. |
3686 | break; | 3677 | break; |
3687 | 3678 | ||
3688 | case WIU_MSI_EXECUTE_MESSAGE_MSI_MESSAGE: | 3679 | case WIU_MSI_EXECUTE_MESSAGE_MSI_MESSAGE: |
3689 | nResult = pMessage->nResultRecommendation; | 3680 | nResult = pMessage->nResultRecommendation; |
3690 | UserExperienceOnExecuteMsiMessage(pContext->pUX, pContext->wzExecutingPackageId, pMessage->msiMessage.mt, pMessage->dwUIHint, pMessage->msiMessage.wzMessage, pMessage->cData, pMessage->rgwzData, &nResult); // ignore return value. | 3681 | BACallbackOnExecuteMsiMessage(pContext->pUX, pContext->wzExecutingPackageId, pMessage->msiMessage.mt, pMessage->dwUIHint, pMessage->msiMessage.wzMessage, pMessage->cData, pMessage->rgwzData, &nResult); // ignore return value. |
3691 | break; | 3682 | break; |
3692 | 3683 | ||
3693 | case WIU_MSI_EXECUTE_MESSAGE_MSI_RM_FILES_IN_USE: | 3684 | case WIU_MSI_EXECUTE_MESSAGE_MSI_RM_FILES_IN_USE: |
3694 | fRestartManager = TRUE; | 3685 | fRestartManager = TRUE; |
3695 | __fallthrough; | 3686 | __fallthrough; |
3696 | case WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE: | 3687 | case WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE: |
3697 | UserExperienceOnExecuteFilesInUse(pContext->pUX, pContext->wzExecutingPackageId, pMessage->msiFilesInUse.cFiles, pMessage->msiFilesInUse.rgwzFiles, fRestartManager ? BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI_RM : BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI, &nResult); // ignore return value. | 3688 | BACallbackOnExecuteFilesInUse(pContext->pUX, pContext->wzExecutingPackageId, pMessage->msiFilesInUse.cFiles, pMessage->msiFilesInUse.rgwzFiles, fRestartManager ? BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI_RM : BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI, &nResult); // ignore return value. |
3698 | fPassthrough = TRUE; | 3689 | fPassthrough = TRUE; |
3699 | break; | 3690 | break; |
3700 | } | 3691 | } |
3701 | 3692 | ||
3702 | if (!fPassthrough) | 3693 | if (!fPassthrough) |
3703 | { | 3694 | { |
3704 | nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult); | 3695 | nResult = BootstrapperApplicationCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult); |
3705 | } | 3696 | } |
3706 | 3697 | ||
3707 | return nResult; | 3698 | return nResult; |
@@ -3724,7 +3715,7 @@ static HRESULT ReportOverallProgressTicks( | |||
3724 | dwProgress = cOverallProgressTicksTotal ? (pApplyContext->cOverallProgressTicks * 100 / cOverallProgressTicksTotal) : 0; | 3715 | dwProgress = cOverallProgressTicksTotal ? (pApplyContext->cOverallProgressTicks * 100 / cOverallProgressTicksTotal) : 0; |
3725 | 3716 | ||
3726 | // TODO: consider sending different progress numbers in the future. | 3717 | // TODO: consider sending different progress numbers in the future. |
3727 | hr = UserExperienceOnProgress(pUX, fRollback, dwProgress, dwProgress); | 3718 | hr = BACallbackOnProgress(pUX, fRollback, dwProgress, dwProgress); |
3728 | 3719 | ||
3729 | ::LeaveCriticalSection(&pApplyContext->csApply); | 3720 | ::LeaveCriticalSection(&pApplyContext->csApply); |
3730 | 3721 | ||
@@ -3755,7 +3746,7 @@ static HRESULT ExecutePackageComplete( | |||
3755 | } | 3746 | } |
3756 | 3747 | ||
3757 | // Send package execute complete to BA. | 3748 | // Send package execute complete to BA. |
3758 | UserExperienceOnExecutePackageComplete(pUX, wzPackageId, hr, *pRestart, &executePackageCompleteAction); | 3749 | BACallbackOnExecutePackageComplete(pUX, wzPackageId, hr, *pRestart, &executePackageCompleteAction); |
3759 | if (BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION_RESTART == executePackageCompleteAction) | 3750 | if (BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION_RESTART == executePackageCompleteAction) |
3760 | { | 3751 | { |
3761 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | 3752 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; |