@joebigelow / wix-1 / commits / c7bd5d0b

Always pass through the return value for FilesInUse messages.

Sean Hall committed Dec 15, 2021 at 13:19 UTC c7bd5d0b0f676e09d036432ee1afb9bf5dcc4fb5
3 files changed +14 -75
src/burn/engine/apply.cpp
+14 -4
@@ -3049,6 +3049,7 @@ static int GenericExecuteMessageHandler(
3049 BURN_EXECUTE_CONTEXT* pContext = (BURN_EXECUTE_CONTEXT*)pvContext;
3050 DWORD dwAllowedResults = pMessage->dwUIHint & MB_TYPEMASK;
3051 int nResult = IDNOACTION;
3052 + BOOL fPassthrough = FALSE;
3053
3054 switch (pMessage->type)
3055 {
@@ -3065,11 +3066,15 @@ static int GenericExecuteMessageHandler(
3066
3067 case GENERIC_EXECUTE_MESSAGE_NETFX_FILES_IN_USE:
3068 UserExperienceOnExecuteFilesInUse(pContext->pUX, pContext->pExecutingPackage->sczId, pMessage->filesInUse.cFiles, pMessage->filesInUse.rgwzFiles, BOOTSTRAPPER_FILES_IN_USE_TYPE_NETFX, &nResult); // ignore return value.
3068 - dwAllowedResults = BURN_MB_NETFX_FILES_IN_USE;
3069 + fPassthrough = TRUE;
3070 break;
3071 }
3072
3072 - nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult);
3073 + if (!fPassthrough)
3074 + {
3075 + nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult);
3076 + }
3077 +
3078 return nResult;
3079 }
3080
@@ -3082,6 +3087,7 @@ static int MsiExecuteMessageHandler(
3087 DWORD dwAllowedResults = pMessage->dwUIHint & MB_TYPEMASK;
3088 int nResult = IDNOACTION;
3089 BOOL fRestartManager = FALSE;
3090 + BOOL fPassthrough = FALSE;
3091
3092 switch (pMessage->type)
3093 {
@@ -3107,11 +3113,15 @@ static int MsiExecuteMessageHandler(
3113 __fallthrough;
3114 case WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE:
3115 UserExperienceOnExecuteFilesInUse(pContext->pUX, pContext->pExecutingPackage->sczId, pMessage->msiFilesInUse.cFiles, pMessage->msiFilesInUse.rgwzFiles, fRestartManager ? BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI_RM : BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI, &nResult); // ignore return value.
3110 - dwAllowedResults = fRestartManager ? BURN_MB_MSI_RM_FILES_IN_USE : BURN_MB_MSI_FILES_IN_USE;
3116 + fPassthrough = TRUE;
3117 break;
3118 }
3119
3114 - nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult);
3120 + if (!fPassthrough)
3121 + {
3122 + nResult = UserExperienceCheckExecuteResult(pContext->pUX, pContext->fRollback, dwAllowedResults, nResult);
3123 + }
3124 +
3125 return nResult;
3126 }
3127
src/burn/engine/userexperience.cpp
-68
@@ -2607,54 +2607,6 @@ static int FilterResult(
2607 }
2608 break;
2609
2610 - case BURN_MB_MSI_FILES_IN_USE:
2611 - // https://docs.microsoft.com/en-us/windows/win32/msi/installvalidate-action
2612 - if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2613 - {
2614 - nResult = IDRETRY;
2615 - }
2616 - else if (IDCANCEL == nResult || IDABORT == nResult)
2617 - {
2618 - nResult = IDCANCEL;
2619 - }
2620 - else if (IDCONTINUE == nResult || IDIGNORE == nResult)
2621 - {
2622 - nResult = IDIGNORE;
2623 - }
2624 - else
2625 - {
2626 - nResult = IDNOACTION;
2627 - }
2628 - break;
2629 -
2630 - case BURN_MB_MSI_RM_FILES_IN_USE:
2631 - // https://docs.microsoft.com/en-us/windows/win32/msi/using-restart-manager-with-an-external-ui-
2632 - if (IDOK == nResult || IDYES == nResult)
2633 - {
2634 - nResult = IDOK;
2635 - }
2636 - else if (IDCONTINUE == nResult || IDIGNORE == nResult)
2637 - {
2638 - nResult = IDIGNORE;
2639 - }
2640 - else if (IDNO == nResult)
2641 - {
2642 - nResult = IDNO;
2643 - }
2644 - else if (IDCANCEL == nResult || IDABORT == nResult)
2645 - {
2646 - nResult = IDCANCEL;
2647 - }
2648 - else if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2649 - {
2650 - nResult = IDRETRY;
2651 - }
2652 - else
2653 - {
2654 - nResult = IDNOACTION;
2655 - }
2656 - break;
2657 -
2610 case BURN_MB_RETRYTRYAGAIN: // custom return code.
2611 if (IDRETRY != nResult && IDTRYAGAIN != nResult)
2612 {
@@ -2662,26 +2614,6 @@ static int FilterResult(
2614 }
2615 break;
2616
2665 - case BURN_MB_NETFX_FILES_IN_USE:
2666 - // https://docs.microsoft.com/en-us/dotnet/framework/deployment/how-to-get-progress-from-the-dotnet-installer
2667 - if (IDOK == nResult || IDYES == nResult)
2668 - {
2669 - nResult = IDYES;
2670 - }
2671 - else if (IDRETRY == nResult || IDTRYAGAIN == nResult)
2672 - {
2673 - nResult = IDRETRY;
2674 - }
2675 - else if (IDCANCEL == nResult || IDABORT == nResult)
2676 - {
2677 - nResult = IDCANCEL;
2678 - }
2679 - else
2680 - {
2681 - nResult = IDNO;
2682 - }
2683 - break;
2684 -
2617 default:
2618 AssertSz(FALSE, "Unknown allowed results.");
2619 break;
src/burn/engine/userexperience.h
-3
@@ -11,9 +11,6 @@ extern "C" {
11 // constants
12
13 const DWORD BURN_MB_RETRYTRYAGAIN = 0x10;
14 -const DWORD BURN_MB_MSI_FILES_IN_USE = 0x11;
15 -const DWORD BURN_MB_MSI_RM_FILES_IN_USE = 0x12;
16 -const DWORD BURN_MB_NETFX_FILES_IN_USE = 0x13;
14
15
16 // structs