diff options
| author | Nir Bar <nir.bar@panel-sw.co.il> | 2022-12-06 13:22:41 +0200 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-12-12 21:50:39 -0600 |
| commit | 50e24e9cf2084b6cb67b5d8fc509163061408bb6 (patch) | |
| tree | 05c9df57480eb6308c3462c13847b43288f9dbb4 /src/burn/engine | |
| parent | c54f3083489827a1e57c6fd7f3d76f62ddc6e85e (diff) | |
| download | wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.tar.gz wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.tar.bz2 wix-50e24e9cf2084b6cb67b5d8fc509163061408bb6.zip | |
Use MSI transaction end result to detect whether reboot is needed
Diffstat (limited to 'src/burn/engine')
| -rw-r--r-- | src/burn/engine/apply.cpp | 48 | ||||
| -rw-r--r-- | src/burn/engine/elevation.cpp | 80 | ||||
| -rw-r--r-- | src/burn/engine/elevation.h | 10 | ||||
| -rw-r--r-- | src/burn/engine/msiengine.cpp | 42 | ||||
| -rw-r--r-- | src/burn/engine/msiengine.h | 6 | ||||
| -rw-r--r-- | src/burn/engine/userexperience.cpp | 38 | ||||
| -rw-r--r-- | src/burn/engine/userexperience.h | 12 |
7 files changed, 167 insertions, 69 deletions
diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 8fbaa76e..9a1a7bf9 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp | |||
| @@ -300,12 +300,14 @@ static HRESULT ExecuteMsiBeginTransaction( | |||
| 300 | static HRESULT ExecuteMsiCommitTransaction( | 300 | static HRESULT ExecuteMsiCommitTransaction( |
| 301 | __in BURN_ENGINE_STATE* pEngineState, | 301 | __in BURN_ENGINE_STATE* pEngineState, |
| 302 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 302 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 303 | __in BURN_EXECUTE_CONTEXT* pContext | 303 | __in BURN_EXECUTE_CONTEXT* pContext, |
| 304 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 304 | ); | 305 | ); |
| 305 | static HRESULT ExecuteMsiRollbackTransaction( | 306 | static HRESULT ExecuteMsiRollbackTransaction( |
| 306 | __in BURN_ENGINE_STATE* pEngineState, | 307 | __in BURN_ENGINE_STATE* pEngineState, |
| 307 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 308 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 308 | __in BURN_EXECUTE_CONTEXT* pContext | 309 | __in BURN_EXECUTE_CONTEXT* pContext, |
| 310 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 309 | ); | 311 | ); |
| 310 | static void ResetTransactionRegistrationState( | 312 | static void ResetTransactionRegistrationState( |
| 311 | __in BURN_ENGINE_STATE* pEngineState, | 313 | __in BURN_ENGINE_STATE* pEngineState, |
| @@ -645,7 +647,7 @@ extern "C" HRESULT ApplyCache( | |||
| 645 | Assert(pPlan->sczLayoutDirectory); | 647 | Assert(pPlan->sczLayoutDirectory); |
| 646 | hr = ApplyLayoutContainer(&cacheContext, pCacheAction->container.pContainer); | 648 | hr = ApplyLayoutContainer(&cacheContext, pCacheAction->container.pContainer); |
| 647 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout container"); | 649 | ExitOnFailure(hr, "Failed cache action: %ls", L"layout container"); |
| 648 | 650 | ||
| 649 | break; | 651 | break; |
| 650 | 652 | ||
| 651 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: | 653 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: |
| @@ -793,7 +795,7 @@ extern "C" HRESULT ApplyExecute( | |||
| 793 | 795 | ||
| 794 | if (pCheckpoint && pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) | 796 | if (pCheckpoint && pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) |
| 795 | { | 797 | { |
| 796 | hrRollback = ExecuteMsiCommitTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context); | 798 | hrRollback = ExecuteMsiCommitTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context, pRestart); |
| 797 | IgnoreRollbackError(hrRollback, "Failed commit transaction from disable rollback"); | 799 | IgnoreRollbackError(hrRollback, "Failed commit transaction from disable rollback"); |
| 798 | } | 800 | } |
| 799 | 801 | ||
| @@ -806,7 +808,7 @@ extern "C" HRESULT ApplyExecute( | |||
| 806 | // If inside a MSI transaction, roll it back. | 808 | // If inside a MSI transaction, roll it back. |
| 807 | if (pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) | 809 | if (pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) |
| 808 | { | 810 | { |
| 809 | hrRollback = ExecuteMsiRollbackTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context); | 811 | hrRollback = ExecuteMsiRollbackTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context, pRestart); |
| 810 | IgnoreRollbackError(hrRollback, "Failed rolling back transaction"); | 812 | IgnoreRollbackError(hrRollback, "Failed rolling back transaction"); |
| 811 | } | 813 | } |
| 812 | 814 | ||
| @@ -2058,13 +2060,13 @@ static HRESULT DownloadPayload( | |||
| 2058 | cacheCallback.pfnProgress = CacheProgressRoutine; | 2060 | cacheCallback.pfnProgress = CacheProgressRoutine; |
| 2059 | cacheCallback.pfnCancel = NULL; // TODO: set this | 2061 | cacheCallback.pfnCancel = NULL; // TODO: set this |
| 2060 | cacheCallback.pv = pProgress; | 2062 | cacheCallback.pv = pProgress; |
| 2061 | 2063 | ||
| 2062 | authenticationData.pUX = pProgress->pCacheContext->pUX; | 2064 | authenticationData.pUX = pProgress->pCacheContext->pUX; |
| 2063 | authenticationData.wzPackageOrContainerId = wzPackageOrContainerId; | 2065 | authenticationData.wzPackageOrContainerId = wzPackageOrContainerId; |
| 2064 | authenticationData.wzPayloadId = wzPayloadId; | 2066 | authenticationData.wzPayloadId = wzPayloadId; |
| 2065 | authenticationCallback.pv = static_cast<LPVOID>(&authenticationData); | 2067 | authenticationCallback.pv = static_cast<LPVOID>(&authenticationData); |
| 2066 | authenticationCallback.pfnAuthenticate = &AuthenticationRequired; | 2068 | authenticationCallback.pfnAuthenticate = &AuthenticationRequired; |
| 2067 | 2069 | ||
| 2068 | hr = DownloadUrl(pDownloadSource, qwDownloadSize, wzDestinationPath, &cacheCallback, &authenticationCallback); | 2070 | hr = DownloadUrl(pDownloadSource, qwDownloadSize, wzDestinationPath, &cacheCallback, &authenticationCallback); |
| 2069 | ExitOnFailure(hr, "Failed attempt to download URL: '%ls' to: '%ls'", pDownloadSource->sczUrl, wzDestinationPath); | 2071 | ExitOnFailure(hr, "Failed attempt to download URL: '%ls' to: '%ls'", pDownloadSource->sczUrl, wzDestinationPath); |
| 2070 | 2072 | ||
| @@ -2526,7 +2528,7 @@ static HRESULT DoExecuteAction( | |||
| 2526 | break; | 2528 | break; |
| 2527 | 2529 | ||
| 2528 | case BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION: | 2530 | case BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION: |
| 2529 | hr = ExecuteMsiCommitTransaction(pEngineState, pExecuteAction->msiTransaction.pRollbackBoundary, pContext); | 2531 | hr = ExecuteMsiCommitTransaction(pEngineState, pExecuteAction->msiTransaction.pRollbackBoundary, pContext, &restart); |
| 2530 | ExitOnFailure(hr, "Failed to execute commit MSI transaction action."); | 2532 | ExitOnFailure(hr, "Failed to execute commit MSI transaction action."); |
| 2531 | break; | 2533 | break; |
| 2532 | 2534 | ||
| @@ -3381,11 +3383,13 @@ LExit: | |||
| 3381 | static HRESULT ExecuteMsiCommitTransaction( | 3383 | static HRESULT ExecuteMsiCommitTransaction( |
| 3382 | __in BURN_ENGINE_STATE* pEngineState, | 3384 | __in BURN_ENGINE_STATE* pEngineState, |
| 3383 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 3385 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 3384 | __in BURN_EXECUTE_CONTEXT* /*pContext*/ | 3386 | __in BURN_EXECUTE_CONTEXT* pContext, |
| 3387 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 3385 | ) | 3388 | ) |
| 3386 | { | 3389 | { |
| 3387 | HRESULT hr = S_OK; | 3390 | HRESULT hr = S_OK; |
| 3388 | BOOL fCommitBeginCalled = FALSE; | 3391 | BOOL fCommitBeginCalled = FALSE; |
| 3392 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action = BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_NONE; | ||
| 3389 | 3393 | ||
| 3390 | if (!pRollbackBoundary->fActiveTransaction) | 3394 | if (!pRollbackBoundary->fActiveTransaction) |
| 3391 | { | 3395 | { |
| @@ -3398,12 +3402,12 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
| 3398 | 3402 | ||
| 3399 | if (pEngineState->plan.fPerMachine) | 3403 | if (pEngineState->plan.fPerMachine) |
| 3400 | { | 3404 | { |
| 3401 | hr = ElevationMsiCommitTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary); | 3405 | hr = ElevationMsiCommitTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary, MsiExecuteMessageHandler, pContext, pRestart); |
| 3402 | ExitOnFailure(hr, "Failed to commit an elevated MSI transaction."); | 3406 | ExitOnFailure(hr, "Failed to commit an elevated MSI transaction."); |
| 3403 | } | 3407 | } |
| 3404 | else | 3408 | else |
| 3405 | { | 3409 | { |
| 3406 | hr = MsiEngineCommitTransaction(pRollbackBoundary); | 3410 | hr = MsiEngineCommitTransaction(pRollbackBoundary, pRestart); |
| 3407 | } | 3411 | } |
| 3408 | 3412 | ||
| 3409 | // Assume that MsiEndTransaction can only be called once for each MsiBeginTransaction. | 3413 | // Assume that MsiEndTransaction can only be called once for each MsiBeginTransaction. |
| @@ -3414,7 +3418,12 @@ static HRESULT ExecuteMsiCommitTransaction( | |||
| 3414 | LExit: | 3418 | LExit: |
| 3415 | if (fCommitBeginCalled) | 3419 | if (fCommitBeginCalled) |
| 3416 | { | 3420 | { |
| 3417 | UserExperienceOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); | 3421 | UserExperienceOnCommitMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
| 3422 | |||
| 3423 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | ||
| 3424 | { | ||
| 3425 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
| 3426 | } | ||
| 3418 | } | 3427 | } |
| 3419 | 3428 | ||
| 3420 | return hr; | 3429 | return hr; |
| @@ -3423,11 +3432,13 @@ LExit: | |||
| 3423 | static HRESULT ExecuteMsiRollbackTransaction( | 3432 | static HRESULT ExecuteMsiRollbackTransaction( |
| 3424 | __in BURN_ENGINE_STATE* pEngineState, | 3433 | __in BURN_ENGINE_STATE* pEngineState, |
| 3425 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 3434 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 3426 | __in BURN_EXECUTE_CONTEXT* /*pContext*/ | 3435 | __in BURN_EXECUTE_CONTEXT* pContext, |
| 3436 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 3427 | ) | 3437 | ) |
| 3428 | { | 3438 | { |
| 3429 | HRESULT hr = S_OK; | 3439 | HRESULT hr = S_OK; |
| 3430 | BOOL fRollbackBeginCalled = FALSE; | 3440 | BOOL fRollbackBeginCalled = FALSE; |
| 3441 | BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action = BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_NONE; | ||
| 3431 | 3442 | ||
| 3432 | if (!pRollbackBoundary->fActiveTransaction) | 3443 | if (!pRollbackBoundary->fActiveTransaction) |
| 3433 | { | 3444 | { |
| @@ -3439,12 +3450,12 @@ static HRESULT ExecuteMsiRollbackTransaction( | |||
| 3439 | 3450 | ||
| 3440 | if (pEngineState->plan.fPerMachine) | 3451 | if (pEngineState->plan.fPerMachine) |
| 3441 | { | 3452 | { |
| 3442 | hr = ElevationMsiRollbackTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary); | 3453 | hr = ElevationMsiRollbackTransaction(pEngineState->companionConnection.hPipe, pRollbackBoundary, MsiExecuteMessageHandler, pContext, pRestart); |
| 3443 | ExitOnFailure(hr, "Failed to rollback an elevated MSI transaction."); | 3454 | ExitOnFailure(hr, "Failed to rollback an elevated MSI transaction."); |
| 3444 | } | 3455 | } |
| 3445 | else | 3456 | else |
| 3446 | { | 3457 | { |
| 3447 | hr = MsiEngineRollbackTransaction(pRollbackBoundary); | 3458 | hr = MsiEngineRollbackTransaction(pRollbackBoundary, pRestart); |
| 3448 | } | 3459 | } |
| 3449 | 3460 | ||
| 3450 | LExit: | 3461 | LExit: |
| @@ -3454,7 +3465,12 @@ LExit: | |||
| 3454 | 3465 | ||
| 3455 | if (fRollbackBeginCalled) | 3466 | if (fRollbackBeginCalled) |
| 3456 | { | 3467 | { |
| 3457 | UserExperienceOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr); | 3468 | UserExperienceOnRollbackMsiTransactionComplete(&pEngineState->userExperience, pRollbackBoundary->sczId, hr, *pRestart, &action); |
| 3469 | |||
| 3470 | if (action == BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION_RESTART) | ||
| 3471 | { | ||
| 3472 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
| 3473 | } | ||
| 3458 | } | 3474 | } |
| 3459 | 3475 | ||
| 3460 | return hr; | 3476 | return hr; |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 154c407d..63a76c2c 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
| @@ -371,12 +371,14 @@ static HRESULT OnMsiBeginTransaction( | |||
| 371 | static HRESULT OnMsiCommitTransaction( | 371 | static HRESULT OnMsiCommitTransaction( |
| 372 | __in BURN_PACKAGES* pPackages, | 372 | __in BURN_PACKAGES* pPackages, |
| 373 | __in BYTE* pbData, | 373 | __in BYTE* pbData, |
| 374 | __in SIZE_T cbData | 374 | __in SIZE_T cbData, |
| 375 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 375 | ); | 376 | ); |
| 376 | static HRESULT OnMsiRollbackTransaction( | 377 | static HRESULT OnMsiRollbackTransaction( |
| 377 | __in BURN_PACKAGES* pPackages, | 378 | __in BURN_PACKAGES* pPackages, |
| 378 | __in BYTE* pbData, | 379 | __in BYTE* pbData, |
| 379 | __in SIZE_T cbData | 380 | __in SIZE_T cbData, |
| 381 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 380 | ); | 382 | ); |
| 381 | static HRESULT ElevatedOnPauseAUBegin( | 383 | static HRESULT ElevatedOnPauseAUBegin( |
| 382 | __in HANDLE hPipe | 384 | __in HANDLE hPipe |
| @@ -496,7 +498,7 @@ extern "C" HRESULT ElevationApplyInitialize( | |||
| 496 | 498 | ||
| 497 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)!pPlan->pInternalCommand->fDisableSystemRestore); | 499 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)!pPlan->pInternalCommand->fDisableSystemRestore); |
| 498 | ExitOnFailure(hr, "Failed to write system restore point action to message buffer."); | 500 | ExitOnFailure(hr, "Failed to write system restore point action to message buffer."); |
| 499 | 501 | ||
| 500 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 502 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
| 501 | ExitOnFailure(hr, "Failed to write variables."); | 503 | ExitOnFailure(hr, "Failed to write variables."); |
| 502 | 504 | ||
| @@ -544,7 +546,7 @@ LExit: | |||
| 544 | } | 546 | } |
| 545 | 547 | ||
| 546 | /******************************************************************* | 548 | /******************************************************************* |
| 547 | ElevationSessionBegin - | 549 | ElevationSessionBegin - |
| 548 | 550 | ||
| 549 | *******************************************************************/ | 551 | *******************************************************************/ |
| 550 | extern "C" HRESULT ElevationSessionBegin( | 552 | extern "C" HRESULT ElevationSessionBegin( |
| @@ -602,7 +604,7 @@ LExit: | |||
| 602 | } | 604 | } |
| 603 | 605 | ||
| 604 | /******************************************************************* | 606 | /******************************************************************* |
| 605 | ElevationSessionEnd - | 607 | ElevationSessionEnd - |
| 606 | 608 | ||
| 607 | *******************************************************************/ | 609 | *******************************************************************/ |
| 608 | extern "C" HRESULT ElevationSessionEnd( | 610 | extern "C" HRESULT ElevationSessionEnd( |
| @@ -648,7 +650,7 @@ LExit: | |||
| 648 | } | 650 | } |
| 649 | 651 | ||
| 650 | /******************************************************************* | 652 | /******************************************************************* |
| 651 | ElevationSaveState - | 653 | ElevationSaveState - |
| 652 | 654 | ||
| 653 | *******************************************************************/ | 655 | *******************************************************************/ |
| 654 | HRESULT ElevationSaveState( | 656 | HRESULT ElevationSaveState( |
| @@ -697,7 +699,7 @@ LExit: | |||
| 697 | } | 699 | } |
| 698 | 700 | ||
| 699 | /******************************************************************* | 701 | /******************************************************************* |
| 700 | ElevationCacheCompletePayload - | 702 | ElevationCacheCompletePayload - |
| 701 | 703 | ||
| 702 | *******************************************************************/ | 704 | *******************************************************************/ |
| 703 | extern "C" HRESULT ElevationCacheCompletePayload( | 705 | extern "C" HRESULT ElevationCacheCompletePayload( |
| @@ -785,7 +787,7 @@ LExit: | |||
| 785 | } | 787 | } |
| 786 | 788 | ||
| 787 | /******************************************************************* | 789 | /******************************************************************* |
| 788 | ElevationCacheCleanup - | 790 | ElevationCacheCleanup - |
| 789 | 791 | ||
| 790 | *******************************************************************/ | 792 | *******************************************************************/ |
| 791 | extern "C" HRESULT ElevationCacheCleanup( | 793 | extern "C" HRESULT ElevationCacheCleanup( |
| @@ -838,7 +840,7 @@ LExit: | |||
| 838 | } | 840 | } |
| 839 | 841 | ||
| 840 | /******************************************************************* | 842 | /******************************************************************* |
| 841 | ElevationExecuteRelatedBundle - | 843 | ElevationExecuteRelatedBundle - |
| 842 | 844 | ||
| 843 | *******************************************************************/ | 845 | *******************************************************************/ |
| 844 | extern "C" HRESULT ElevationExecuteRelatedBundle( | 846 | extern "C" HRESULT ElevationExecuteRelatedBundle( |
| @@ -899,7 +901,7 @@ LExit: | |||
| 899 | } | 901 | } |
| 900 | 902 | ||
| 901 | /******************************************************************* | 903 | /******************************************************************* |
| 902 | ElevationExecuteBundlePackage - | 904 | ElevationExecuteBundlePackage - |
| 903 | 905 | ||
| 904 | *******************************************************************/ | 906 | *******************************************************************/ |
| 905 | extern "C" HRESULT ElevationExecuteBundlePackage( | 907 | extern "C" HRESULT ElevationExecuteBundlePackage( |
| @@ -963,7 +965,7 @@ LExit: | |||
| 963 | } | 965 | } |
| 964 | 966 | ||
| 965 | /******************************************************************* | 967 | /******************************************************************* |
| 966 | ElevationExecuteExePackage - | 968 | ElevationExecuteExePackage - |
| 967 | 969 | ||
| 968 | *******************************************************************/ | 970 | *******************************************************************/ |
| 969 | extern "C" HRESULT ElevationExecuteExePackage( | 971 | extern "C" HRESULT ElevationExecuteExePackage( |
| @@ -1047,12 +1049,16 @@ LExit: | |||
| 1047 | 1049 | ||
| 1048 | extern "C" HRESULT ElevationMsiCommitTransaction( | 1050 | extern "C" HRESULT ElevationMsiCommitTransaction( |
| 1049 | __in HANDLE hPipe, | 1051 | __in HANDLE hPipe, |
| 1050 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1052 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 1053 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
| 1054 | __in LPVOID pvContext, | ||
| 1055 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 1051 | ) | 1056 | ) |
| 1052 | { | 1057 | { |
| 1053 | HRESULT hr = S_OK; | 1058 | HRESULT hr = S_OK; |
| 1054 | BYTE* pbData = NULL; | 1059 | BYTE* pbData = NULL; |
| 1055 | SIZE_T cbData = 0; | 1060 | SIZE_T cbData = 0; |
| 1061 | BURN_ELEVATION_MSI_MESSAGE_CONTEXT context = { }; | ||
| 1056 | DWORD dwResult = ERROR_SUCCESS; | 1062 | DWORD dwResult = ERROR_SUCCESS; |
| 1057 | 1063 | ||
| 1058 | // serialize message data | 1064 | // serialize message data |
| @@ -1062,10 +1068,15 @@ extern "C" HRESULT ElevationMsiCommitTransaction( | |||
| 1062 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); | 1068 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); |
| 1063 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); | 1069 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); |
| 1064 | 1070 | ||
| 1065 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); | 1071 | // send message |
| 1072 | context.pfnMessageHandler = pfnMessageHandler; | ||
| 1073 | context.pvContext = pvContext; | ||
| 1074 | |||
| 1075 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); | ||
| 1066 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION message to per-machine process."); | 1076 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION message to per-machine process."); |
| 1067 | 1077 | ||
| 1068 | hr = static_cast<HRESULT>(dwResult); | 1078 | hr = static_cast<HRESULT>(dwResult); |
| 1079 | *pRestart = context.restart; | ||
| 1069 | 1080 | ||
| 1070 | LExit: | 1081 | LExit: |
| 1071 | ReleaseBuffer(pbData); | 1082 | ReleaseBuffer(pbData); |
| @@ -1075,12 +1086,16 @@ LExit: | |||
| 1075 | 1086 | ||
| 1076 | extern "C" HRESULT ElevationMsiRollbackTransaction( | 1087 | extern "C" HRESULT ElevationMsiRollbackTransaction( |
| 1077 | __in HANDLE hPipe, | 1088 | __in HANDLE hPipe, |
| 1078 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1089 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 1090 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
| 1091 | __in LPVOID pvContext, | ||
| 1092 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 1079 | ) | 1093 | ) |
| 1080 | { | 1094 | { |
| 1081 | HRESULT hr = S_OK; | 1095 | HRESULT hr = S_OK; |
| 1082 | BYTE* pbData = NULL; | 1096 | BYTE* pbData = NULL; |
| 1083 | SIZE_T cbData = 0; | 1097 | SIZE_T cbData = 0; |
| 1098 | BURN_ELEVATION_MSI_MESSAGE_CONTEXT context = { }; | ||
| 1084 | DWORD dwResult = ERROR_SUCCESS; | 1099 | DWORD dwResult = ERROR_SUCCESS; |
| 1085 | 1100 | ||
| 1086 | // serialize message data | 1101 | // serialize message data |
| @@ -1090,10 +1105,15 @@ extern "C" HRESULT ElevationMsiRollbackTransaction( | |||
| 1090 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); | 1105 | hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); |
| 1091 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); | 1106 | ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); |
| 1092 | 1107 | ||
| 1093 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); | 1108 | // send message |
| 1109 | context.pfnMessageHandler = pfnMessageHandler; | ||
| 1110 | context.pvContext = pvContext; | ||
| 1111 | |||
| 1112 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); | ||
| 1094 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION message to per-machine process."); | 1113 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION message to per-machine process."); |
| 1095 | 1114 | ||
| 1096 | hr = static_cast<HRESULT>(dwResult); | 1115 | hr = static_cast<HRESULT>(dwResult); |
| 1116 | *pRestart = context.restart; | ||
| 1097 | 1117 | ||
| 1098 | LExit: | 1118 | LExit: |
| 1099 | ReleaseBuffer(pbData); | 1119 | ReleaseBuffer(pbData); |
| @@ -1104,7 +1124,7 @@ LExit: | |||
| 1104 | 1124 | ||
| 1105 | 1125 | ||
| 1106 | /******************************************************************* | 1126 | /******************************************************************* |
| 1107 | ElevationExecuteMsiPackage - | 1127 | ElevationExecuteMsiPackage - |
| 1108 | 1128 | ||
| 1109 | *******************************************************************/ | 1129 | *******************************************************************/ |
| 1110 | extern "C" HRESULT ElevationExecuteMsiPackage( | 1130 | extern "C" HRESULT ElevationExecuteMsiPackage( |
| @@ -1189,7 +1209,7 @@ LExit: | |||
| 1189 | } | 1209 | } |
| 1190 | 1210 | ||
| 1191 | /******************************************************************* | 1211 | /******************************************************************* |
| 1192 | ElevationExecuteMspPackage - | 1212 | ElevationExecuteMspPackage - |
| 1193 | 1213 | ||
| 1194 | *******************************************************************/ | 1214 | *******************************************************************/ |
| 1195 | extern "C" HRESULT ElevationExecuteMspPackage( | 1215 | extern "C" HRESULT ElevationExecuteMspPackage( |
| @@ -1269,7 +1289,7 @@ LExit: | |||
| 1269 | } | 1289 | } |
| 1270 | 1290 | ||
| 1271 | /******************************************************************* | 1291 | /******************************************************************* |
| 1272 | ElevationExecuteMsuPackage - | 1292 | ElevationExecuteMsuPackage - |
| 1273 | 1293 | ||
| 1274 | *******************************************************************/ | 1294 | *******************************************************************/ |
| 1275 | extern "C" HRESULT ElevationExecuteMsuPackage( | 1295 | extern "C" HRESULT ElevationExecuteMsuPackage( |
| @@ -1480,7 +1500,7 @@ LExit: | |||
| 1480 | } | 1500 | } |
| 1481 | 1501 | ||
| 1482 | /******************************************************************* | 1502 | /******************************************************************* |
| 1483 | ElevationCleanPackage - | 1503 | ElevationCleanPackage - |
| 1484 | 1504 | ||
| 1485 | *******************************************************************/ | 1505 | *******************************************************************/ |
| 1486 | extern "C" HRESULT ElevationCleanPackage( | 1506 | extern "C" HRESULT ElevationCleanPackage( |
| @@ -1545,7 +1565,7 @@ LExit: | |||
| 1545 | } | 1565 | } |
| 1546 | 1566 | ||
| 1547 | /******************************************************************* | 1567 | /******************************************************************* |
| 1548 | ElevationChildPumpMessages - | 1568 | ElevationChildPumpMessages - |
| 1549 | 1569 | ||
| 1550 | *******************************************************************/ | 1570 | *******************************************************************/ |
| 1551 | extern "C" HRESULT ElevationChildPumpMessages( | 1571 | extern "C" HRESULT ElevationChildPumpMessages( |
| @@ -1875,7 +1895,7 @@ static HRESULT ProcessGenericExecuteMessages( | |||
| 1875 | 1895 | ||
| 1876 | hr = BuffReadNumber((BYTE*)pMsg->pvData, pMsg->cbData, &iData, &message.dwUIHint); | 1896 | hr = BuffReadNumber((BYTE*)pMsg->pvData, pMsg->cbData, &iData, &message.dwUIHint); |
| 1877 | ExitOnFailure(hr, "Failed to allowed results."); | 1897 | ExitOnFailure(hr, "Failed to allowed results."); |
| 1878 | 1898 | ||
| 1879 | // Process the message. | 1899 | // Process the message. |
| 1880 | switch (pMsg->dwMessage) | 1900 | switch (pMsg->dwMessage) |
| 1881 | { | 1901 | { |
| @@ -2052,7 +2072,7 @@ static HRESULT ProcessMsiPackageMessages( | |||
| 2052 | ExitOnRootFailure(hr, "Invalid package message."); | 2072 | ExitOnRootFailure(hr, "Invalid package message."); |
| 2053 | break; | 2073 | break; |
| 2054 | } | 2074 | } |
| 2055 | 2075 | ||
| 2056 | // send message | 2076 | // send message |
| 2057 | *pdwResult = (DWORD)pContext->pfnMessageHandler(&message, pContext->pvContext); | 2077 | *pdwResult = (DWORD)pContext->pfnMessageHandler(&message, pContext->pvContext); |
| 2058 | 2078 | ||
| @@ -2154,11 +2174,13 @@ static HRESULT ProcessElevatedChildMessage( | |||
| 2154 | break; | 2174 | break; |
| 2155 | 2175 | ||
| 2156 | case BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION: | 2176 | case BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION: |
| 2157 | hrResult = OnMsiCommitTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2177 | hrResult = OnMsiCommitTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData, &restart); |
| 2178 | fSendRestart = TRUE; | ||
| 2158 | break; | 2179 | break; |
| 2159 | 2180 | ||
| 2160 | case BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION: | 2181 | case BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION: |
| 2161 | hrResult = OnMsiRollbackTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2182 | hrResult = OnMsiRollbackTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData, &restart); |
| 2183 | fSendRestart = TRUE; | ||
| 2162 | break; | 2184 | break; |
| 2163 | 2185 | ||
| 2164 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE: | 2186 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE: |
| @@ -3922,7 +3944,8 @@ LExit: | |||
| 3922 | static HRESULT OnMsiCommitTransaction( | 3944 | static HRESULT OnMsiCommitTransaction( |
| 3923 | __in BURN_PACKAGES* pPackages, | 3945 | __in BURN_PACKAGES* pPackages, |
| 3924 | __in BYTE* pbData, | 3946 | __in BYTE* pbData, |
| 3925 | __in SIZE_T cbData | 3947 | __in SIZE_T cbData, |
| 3948 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 3926 | ) | 3949 | ) |
| 3927 | { | 3950 | { |
| 3928 | HRESULT hr = S_OK; | 3951 | HRESULT hr = S_OK; |
| @@ -3946,7 +3969,7 @@ static HRESULT OnMsiCommitTransaction( | |||
| 3946 | pRollbackBoundary->sczLogPath = sczLogPath; | 3969 | pRollbackBoundary->sczLogPath = sczLogPath; |
| 3947 | } | 3970 | } |
| 3948 | 3971 | ||
| 3949 | hr = MsiEngineCommitTransaction(pRollbackBoundary); | 3972 | hr = MsiEngineCommitTransaction(pRollbackBoundary, pRestart); |
| 3950 | 3973 | ||
| 3951 | LExit: | 3974 | LExit: |
| 3952 | ReleaseStr(sczId); | 3975 | ReleaseStr(sczId); |
| @@ -3963,7 +3986,8 @@ LExit: | |||
| 3963 | static HRESULT OnMsiRollbackTransaction( | 3986 | static HRESULT OnMsiRollbackTransaction( |
| 3964 | __in BURN_PACKAGES* pPackages, | 3987 | __in BURN_PACKAGES* pPackages, |
| 3965 | __in BYTE* pbData, | 3988 | __in BYTE* pbData, |
| 3966 | __in SIZE_T cbData | 3989 | __in SIZE_T cbData, |
| 3990 | __out BOOTSTRAPPER_APPLY_RESTART *pRestart | ||
| 3967 | ) | 3991 | ) |
| 3968 | { | 3992 | { |
| 3969 | HRESULT hr = S_OK; | 3993 | HRESULT hr = S_OK; |
| @@ -3987,7 +4011,7 @@ static HRESULT OnMsiRollbackTransaction( | |||
| 3987 | pRollbackBoundary->sczLogPath = sczLogPath; | 4011 | pRollbackBoundary->sczLogPath = sczLogPath; |
| 3988 | } | 4012 | } |
| 3989 | 4013 | ||
| 3990 | hr = MsiEngineRollbackTransaction(pRollbackBoundary); | 4014 | hr = MsiEngineRollbackTransaction(pRollbackBoundary, pRestart); |
| 3991 | 4015 | ||
| 3992 | LExit: | 4016 | LExit: |
| 3993 | ReleaseStr(sczId); | 4017 | ReleaseStr(sczId); |
diff --git a/src/burn/engine/elevation.h b/src/burn/engine/elevation.h index 810287a3..02019977 100644 --- a/src/burn/engine/elevation.h +++ b/src/burn/engine/elevation.h | |||
| @@ -191,11 +191,17 @@ HRESULT ElevationMsiBeginTransaction( | |||
| 191 | ); | 191 | ); |
| 192 | HRESULT ElevationMsiCommitTransaction( | 192 | HRESULT ElevationMsiCommitTransaction( |
| 193 | __in HANDLE hPipe, | 193 | __in HANDLE hPipe, |
| 194 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 194 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 195 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
| 196 | __in LPVOID pvContext, | ||
| 197 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 195 | ); | 198 | ); |
| 196 | HRESULT ElevationMsiRollbackTransaction( | 199 | HRESULT ElevationMsiRollbackTransaction( |
| 197 | __in HANDLE hPipe, | 200 | __in HANDLE hPipe, |
| 198 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 201 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 202 | __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler, | ||
| 203 | __in LPVOID pvContext, | ||
| 204 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 199 | ); | 205 | ); |
| 200 | 206 | ||
| 201 | #ifdef __cplusplus | 207 | #ifdef __cplusplus |
diff --git a/src/burn/engine/msiengine.cpp b/src/burn/engine/msiengine.cpp index 2c1b0d4f..fec995e0 100644 --- a/src/burn/engine/msiengine.cpp +++ b/src/burn/engine/msiengine.cpp | |||
| @@ -1139,33 +1139,65 @@ LExit: | |||
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| 1141 | extern "C" HRESULT MsiEngineCommitTransaction( | 1141 | extern "C" HRESULT MsiEngineCommitTransaction( |
| 1142 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1142 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 1143 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 1143 | ) | 1144 | ) |
| 1144 | { | 1145 | { |
| 1145 | HRESULT hr = S_OK; | 1146 | HRESULT hr = S_OK; |
| 1147 | WIU_RESTART restart = WIU_RESTART_NONE; | ||
| 1146 | 1148 | ||
| 1147 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_COMMIT, pRollbackBoundary->sczId); | 1149 | LogId(REPORT_STANDARD, MSG_MSI_TRANSACTION_COMMIT, pRollbackBoundary->sczId); |
| 1148 | 1150 | ||
| 1149 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath); | 1151 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_COMMIT, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath, &restart); |
| 1150 | ExitOnFailure(hr, "Failed to commit the MSI transaction"); | 1152 | ExitOnFailure(hr, "Failed to commit the MSI transaction"); |
| 1151 | 1153 | ||
| 1152 | LExit: | 1154 | LExit: |
| 1155 | switch (restart) | ||
| 1156 | { | ||
| 1157 | case WIU_RESTART_NONE: | ||
| 1158 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
| 1159 | break; | ||
| 1160 | |||
| 1161 | case WIU_RESTART_REQUIRED: | ||
| 1162 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_REQUIRED; | ||
| 1163 | break; | ||
| 1164 | |||
| 1165 | case WIU_RESTART_INITIATED: | ||
| 1166 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
| 1167 | break; | ||
| 1168 | } | ||
| 1153 | 1169 | ||
| 1154 | return hr; | 1170 | return hr; |
| 1155 | } | 1171 | } |
| 1156 | 1172 | ||
| 1157 | extern "C" HRESULT MsiEngineRollbackTransaction( | 1173 | extern "C" HRESULT MsiEngineRollbackTransaction( |
| 1158 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1174 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 1175 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 1159 | ) | 1176 | ) |
| 1160 | { | 1177 | { |
| 1161 | HRESULT hr = S_OK; | 1178 | HRESULT hr = S_OK; |
| 1179 | WIU_RESTART restart = WIU_RESTART_NONE; | ||
| 1162 | 1180 | ||
| 1163 | LogId(REPORT_WARNING, MSG_MSI_TRANSACTION_ROLLBACK, pRollbackBoundary->sczId); | 1181 | LogId(REPORT_WARNING, MSG_MSI_TRANSACTION_ROLLBACK, pRollbackBoundary->sczId); |
| 1164 | 1182 | ||
| 1165 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_ROLLBACK, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath); | 1183 | hr = WiuEndTransaction(MSITRANSACTIONSTATE_ROLLBACK, WIU_LOG_DEFAULT | INSTALLLOGMODE_VERBOSE, pRollbackBoundary->sczLogPath, &restart); |
| 1166 | ExitOnFailure(hr, "Failed to rollback the MSI transaction"); | 1184 | ExitOnFailure(hr, "Failed to rollback the MSI transaction"); |
| 1167 | 1185 | ||
| 1168 | LExit: | 1186 | LExit: |
| 1187 | switch (restart) | ||
| 1188 | { | ||
| 1189 | case WIU_RESTART_NONE: | ||
| 1190 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
| 1191 | break; | ||
| 1192 | |||
| 1193 | case WIU_RESTART_REQUIRED: | ||
| 1194 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_REQUIRED; | ||
| 1195 | break; | ||
| 1196 | |||
| 1197 | case WIU_RESTART_INITIATED: | ||
| 1198 | *pRestart = BOOTSTRAPPER_APPLY_RESTART_INITIATED; | ||
| 1199 | break; | ||
| 1200 | } | ||
| 1169 | 1201 | ||
| 1170 | return hr; | 1202 | return hr; |
| 1171 | } | 1203 | } |
| @@ -1246,7 +1278,7 @@ extern "C" HRESULT MsiEngineExecutePackage( | |||
| 1246 | 1278 | ||
| 1247 | // Best effort to set the execute package action variable. | 1279 | // Best effort to set the execute package action variable. |
| 1248 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); | 1280 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); |
| 1249 | 1281 | ||
| 1250 | // Wire up the external UI handler and logging. | 1282 | // Wire up the external UI handler and logging. |
| 1251 | if (pExecuteAction->msiPackage.fDisableExternalUiHandler) | 1283 | if (pExecuteAction->msiPackage.fDisableExternalUiHandler) |
| 1252 | { | 1284 | { |
diff --git a/src/burn/engine/msiengine.h b/src/burn/engine/msiengine.h index bc356fab..862c4f6a 100644 --- a/src/burn/engine/msiengine.h +++ b/src/burn/engine/msiengine.h | |||
| @@ -60,10 +60,12 @@ HRESULT MsiEngineBeginTransaction( | |||
| 60 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 60 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary |
| 61 | ); | 61 | ); |
| 62 | HRESULT MsiEngineCommitTransaction( | 62 | HRESULT MsiEngineCommitTransaction( |
| 63 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 63 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 64 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 64 | ); | 65 | ); |
| 65 | HRESULT MsiEngineRollbackTransaction( | 66 | HRESULT MsiEngineRollbackTransaction( |
| 66 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 67 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| 68 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | ||
| 67 | ); | 69 | ); |
| 68 | HRESULT MsiEngineExecutePackage( | 70 | HRESULT MsiEngineExecutePackage( |
| 69 | __in_opt HWND hwndParent, | 71 | __in_opt HWND hwndParent, |
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp index 28429394..372ca901 100644 --- a/src/burn/engine/userexperience.cpp +++ b/src/burn/engine/userexperience.cpp | |||
| @@ -35,7 +35,7 @@ static HRESULT SendBAMessageFromInactiveEngine( | |||
| 35 | // function definitions | 35 | // function definitions |
| 36 | 36 | ||
| 37 | /******************************************************************* | 37 | /******************************************************************* |
| 38 | UserExperienceParseFromXml - | 38 | UserExperienceParseFromXml - |
| 39 | 39 | ||
| 40 | *******************************************************************/ | 40 | *******************************************************************/ |
| 41 | extern "C" HRESULT UserExperienceParseFromXml( | 41 | extern "C" HRESULT UserExperienceParseFromXml( |
| @@ -72,7 +72,7 @@ LExit: | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /******************************************************************* | 74 | /******************************************************************* |
| 75 | UserExperienceUninitialize - | 75 | UserExperienceUninitialize - |
| 76 | 76 | ||
| 77 | *******************************************************************/ | 77 | *******************************************************************/ |
| 78 | extern "C" void UserExperienceUninitialize( | 78 | extern "C" void UserExperienceUninitialize( |
| @@ -87,7 +87,7 @@ extern "C" void UserExperienceUninitialize( | |||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | /******************************************************************* | 89 | /******************************************************************* |
| 90 | UserExperienceLoad - | 90 | UserExperienceLoad - |
| 91 | 91 | ||
| 92 | *******************************************************************/ | 92 | *******************************************************************/ |
| 93 | extern "C" HRESULT UserExperienceLoad( | 93 | extern "C" HRESULT UserExperienceLoad( |
| @@ -129,7 +129,7 @@ LExit: | |||
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /******************************************************************* | 131 | /******************************************************************* |
| 132 | UserExperienceUnload - | 132 | UserExperienceUnload - |
| 133 | 133 | ||
| 134 | *******************************************************************/ | 134 | *******************************************************************/ |
| 135 | extern "C" HRESULT UserExperienceUnload( | 135 | extern "C" HRESULT UserExperienceUnload( |
| @@ -380,7 +380,7 @@ EXTERN_C BAAPI UserExperienceOnBeginMsiTransactionBegin( | |||
| 380 | args.wzTransactionId = wzTransactionId; | 380 | args.wzTransactionId = wzTransactionId; |
| 381 | 381 | ||
| 382 | results.cbSize = sizeof(results); | 382 | results.cbSize = sizeof(results); |
| 383 | 383 | ||
| 384 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); | 384 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, &args, &results); |
| 385 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); | 385 | ExitOnFailure(hr, "BA OnBeginMsiTransactionBegin failed."); |
| 386 | 386 | ||
| @@ -1017,7 +1017,7 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionBegin( | |||
| 1017 | args.wzTransactionId = wzTransactionId; | 1017 | args.wzTransactionId = wzTransactionId; |
| 1018 | 1018 | ||
| 1019 | results.cbSize = sizeof(results); | 1019 | results.cbSize = sizeof(results); |
| 1020 | 1020 | ||
| 1021 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); | 1021 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, &args, &results); |
| 1022 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); | 1022 | ExitOnFailure(hr, "BA OnCommitMsiTransactionBegin failed."); |
| 1023 | 1023 | ||
| @@ -1033,8 +1033,10 @@ LExit: | |||
| 1033 | EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( | 1033 | EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( |
| 1034 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1034 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 1035 | __in LPCWSTR wzTransactionId, | 1035 | __in LPCWSTR wzTransactionId, |
| 1036 | __in HRESULT hrStatus | 1036 | __in HRESULT hrStatus, |
| 1037 | ) | 1037 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
| 1038 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
| 1039 | ) | ||
| 1038 | { | 1040 | { |
| 1039 | HRESULT hr = S_OK; | 1041 | HRESULT hr = S_OK; |
| 1040 | BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { }; | 1042 | BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS args = { }; |
| @@ -1043,12 +1045,17 @@ EXTERN_C BAAPI UserExperienceOnCommitMsiTransactionComplete( | |||
| 1043 | args.cbSize = sizeof(args); | 1045 | args.cbSize = sizeof(args); |
| 1044 | args.wzTransactionId = wzTransactionId; | 1046 | args.wzTransactionId = wzTransactionId; |
| 1045 | args.hrStatus = hrStatus; | 1047 | args.hrStatus = hrStatus; |
| 1048 | args.restart = restart; | ||
| 1049 | args.recommendation = *pAction; | ||
| 1046 | 1050 | ||
| 1047 | results.cbSize = sizeof(results); | 1051 | results.cbSize = sizeof(results); |
| 1052 | results.action = *pAction; | ||
| 1048 | 1053 | ||
| 1049 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); | 1054 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, &args, &results); |
| 1050 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); | 1055 | ExitOnFailure(hr, "BA OnCommitMsiTransactionComplete failed."); |
| 1051 | 1056 | ||
| 1057 | *pAction = results.action; | ||
| 1058 | |||
| 1052 | LExit: | 1059 | LExit: |
| 1053 | return hr; | 1060 | return hr; |
| 1054 | } | 1061 | } |
| @@ -1908,7 +1915,7 @@ EXTERN_C BAAPI UserExperienceOnPauseAUBegin( | |||
| 1908 | args.cbSize = sizeof(args); | 1915 | args.cbSize = sizeof(args); |
| 1909 | 1916 | ||
| 1910 | results.cbSize = sizeof(results); | 1917 | results.cbSize = sizeof(results); |
| 1911 | 1918 | ||
| 1912 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); | 1919 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, &args, &results); |
| 1913 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); | 1920 | ExitOnFailure(hr, "BA OnPauseAUBegin failed."); |
| 1914 | 1921 | ||
| @@ -2523,7 +2530,7 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionBegin( | |||
| 2523 | args.wzTransactionId = wzTransactionId; | 2530 | args.wzTransactionId = wzTransactionId; |
| 2524 | 2531 | ||
| 2525 | results.cbSize = sizeof(results); | 2532 | results.cbSize = sizeof(results); |
| 2526 | 2533 | ||
| 2527 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); | 2534 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, &args, &results); |
| 2528 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); | 2535 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionBegin failed."); |
| 2529 | 2536 | ||
| @@ -2534,7 +2541,9 @@ LExit: | |||
| 2534 | EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( | 2541 | EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( |
| 2535 | __in BURN_USER_EXPERIENCE* pUserExperience, | 2542 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 2536 | __in LPCWSTR wzTransactionId, | 2543 | __in LPCWSTR wzTransactionId, |
| 2537 | __in HRESULT hrStatus | 2544 | __in HRESULT hrStatus, |
| 2545 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
| 2546 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION *pAction | ||
| 2538 | ) | 2547 | ) |
| 2539 | { | 2548 | { |
| 2540 | HRESULT hr = S_OK; | 2549 | HRESULT hr = S_OK; |
| @@ -2544,12 +2553,17 @@ EXTERN_C BAAPI UserExperienceOnRollbackMsiTransactionComplete( | |||
| 2544 | args.cbSize = sizeof(args); | 2553 | args.cbSize = sizeof(args); |
| 2545 | args.wzTransactionId = wzTransactionId; | 2554 | args.wzTransactionId = wzTransactionId; |
| 2546 | args.hrStatus = hrStatus; | 2555 | args.hrStatus = hrStatus; |
| 2556 | args.restart = restart; | ||
| 2557 | args.recommendation = *pAction; | ||
| 2547 | 2558 | ||
| 2548 | results.cbSize = sizeof(results); | 2559 | results.cbSize = sizeof(results); |
| 2560 | results.action = *pAction; | ||
| 2549 | 2561 | ||
| 2550 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); | 2562 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, &args, &results); |
| 2551 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); | 2563 | ExitOnFailure(hr, "BA OnRollbackMsiTransactionComplete failed."); |
| 2552 | 2564 | ||
| 2565 | *pAction = results.action; | ||
| 2566 | |||
| 2553 | LExit: | 2567 | LExit: |
| 2554 | return hr; | 2568 | return hr; |
| 2555 | } | 2569 | } |
| @@ -2651,7 +2665,7 @@ EXTERN_C BAAPI UserExperienceOnSystemRestorePointBegin( | |||
| 2651 | args.cbSize = sizeof(args); | 2665 | args.cbSize = sizeof(args); |
| 2652 | 2666 | ||
| 2653 | results.cbSize = sizeof(results); | 2667 | results.cbSize = sizeof(results); |
| 2654 | 2668 | ||
| 2655 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); | 2669 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, &args, &results); |
| 2656 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); | 2670 | ExitOnFailure(hr, "BA OnSystemRestorePointBegin failed."); |
| 2657 | 2671 | ||
diff --git a/src/burn/engine/userexperience.h b/src/burn/engine/userexperience.h index e342da03..4f15c5d7 100644 --- a/src/burn/engine/userexperience.h +++ b/src/burn/engine/userexperience.h | |||
| @@ -251,8 +251,10 @@ BAAPI UserExperienceOnCommitMsiTransactionBegin( | |||
| 251 | BAAPI UserExperienceOnCommitMsiTransactionComplete( | 251 | BAAPI UserExperienceOnCommitMsiTransactionComplete( |
| 252 | __in BURN_USER_EXPERIENCE* pUserExperience, | 252 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 253 | __in LPCWSTR wzTransactionId, | 253 | __in LPCWSTR wzTransactionId, |
| 254 | __in HRESULT hrStatus | 254 | __in HRESULT hrStatus, |
| 255 | ); | 255 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
| 256 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
| 257 | ); | ||
| 256 | BAAPI UserExperienceOnDetectBegin( | 258 | BAAPI UserExperienceOnDetectBegin( |
| 257 | __in BURN_USER_EXPERIENCE* pUserExperience, | 259 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 258 | __in BOOL fCached, | 260 | __in BOOL fCached, |
| @@ -567,8 +569,10 @@ BAAPI UserExperienceOnRollbackMsiTransactionBegin( | |||
| 567 | BAAPI UserExperienceOnRollbackMsiTransactionComplete( | 569 | BAAPI UserExperienceOnRollbackMsiTransactionComplete( |
| 568 | __in BURN_USER_EXPERIENCE* pUserExperience, | 570 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 569 | __in LPCWSTR wzTransactionId, | 571 | __in LPCWSTR wzTransactionId, |
| 570 | __in HRESULT hrStatus | 572 | __in HRESULT hrStatus, |
| 571 | ); | 573 | __in BOOTSTRAPPER_APPLY_RESTART restart, |
| 574 | __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* pAction | ||
| 575 | ); | ||
| 572 | BAAPI UserExperienceOnSetUpdateBegin( | 576 | BAAPI UserExperienceOnSetUpdateBegin( |
| 573 | __in BURN_USER_EXPERIENCE* pUserExperience | 577 | __in BURN_USER_EXPERIENCE* pUserExperience |
| 574 | ); | 578 | ); |
