diff options
-rw-r--r-- | src/wixstdba/WixStandardBootstrapperApplication.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index e78b37b0..4aef8ce5 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -709,7 +709,9 @@ public: // IBootstrapperApplication | |||
709 | __inout BOOL* pfCancel | 709 | __inout BOOL* pfCancel |
710 | ) | 710 | ) |
711 | { | 711 | { |
712 | HRESULT hr = S_OK; | ||
712 | LPWSTR sczFormattedString = NULL; | 713 | LPWSTR sczFormattedString = NULL; |
714 | BOOL fShowingInternalUiThisPackage = FALSE; | ||
713 | 715 | ||
714 | m_fStartedExecution = TRUE; | 716 | m_fStartedExecution = TRUE; |
715 | 717 | ||
@@ -749,22 +751,23 @@ public: // IBootstrapperApplication | |||
749 | } | 751 | } |
750 | 752 | ||
751 | // Needs to match MsiEngineCalculateInstallUiLevel in msiengine.cpp in Burn. | 753 | // Needs to match MsiEngineCalculateInstallUiLevel in msiengine.cpp in Burn. |
752 | m_fShowingInternalUiThisPackage = pPackage && pPackage->fDisplayInternalUI && | 754 | fShowingInternalUiThisPackage = pPackage && pPackage->fDisplayInternalUI && |
753 | BOOTSTRAPPER_ACTION_STATE_UNINSTALL != action && | 755 | BOOTSTRAPPER_ACTION_STATE_UNINSTALL != action && |
754 | BOOTSTRAPPER_ACTION_STATE_REPAIR != action && | 756 | BOOTSTRAPPER_ACTION_STATE_REPAIR != action && |
755 | (BOOTSTRAPPER_DISPLAY_FULL == m_command.display || | 757 | (BOOTSTRAPPER_DISPLAY_FULL == m_command.display || |
756 | BOOTSTRAPPER_DISPLAY_PASSIVE == m_command.display); | 758 | BOOTSTRAPPER_DISPLAY_PASSIVE == m_command.display); |
757 | 759 | ||
758 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT, wz); | 760 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT, wz); |
759 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz); | 761 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz); |
760 | } | 762 | } |
761 | else | 763 | |
762 | { | 764 | ::EnterCriticalSection(&m_csShowingInternalUiThisPackage); |
763 | m_fShowingInternalUiThisPackage = FALSE; | 765 | m_fShowingInternalUiThisPackage = fShowingInternalUiThisPackage; |
764 | } | 766 | hr = __super::OnExecutePackageBegin(wzPackageId, fExecute, action, pfCancel); |
767 | ::LeaveCriticalSection(&m_csShowingInternalUiThisPackage); | ||
765 | 768 | ||
766 | ReleaseStr(sczFormattedString); | 769 | ReleaseStr(sczFormattedString); |
767 | return __super::OnExecutePackageBegin(wzPackageId, fExecute, action, pfCancel); | 770 | return hr; |
768 | } | 771 | } |
769 | 772 | ||
770 | 773 | ||
@@ -837,6 +840,7 @@ public: // IBootstrapperApplication | |||
837 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT, L""); | 840 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT, L""); |
838 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, L""); | 841 | ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, L""); |
839 | ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, FALSE); // no more cancel. | 842 | ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, FALSE); // no more cancel. |
843 | m_fShowingInternalUiThisPackage = FALSE; | ||
840 | 844 | ||
841 | SetState(WIXSTDBA_STATE_EXECUTED, S_OK); // we always return success here and let OnApplyComplete() deal with the error. | 845 | SetState(WIXSTDBA_STATE_EXECUTED, S_OK); // we always return success here and let OnApplyComplete() deal with the error. |
842 | SetProgressState(hrStatus); | 846 | SetProgressState(hrStatus); |
@@ -2975,7 +2979,14 @@ private: // privates | |||
2975 | } | 2979 | } |
2976 | else // prompt the user or force the cancel if there is no UI. | 2980 | else // prompt the user or force the cancel if there is no UI. |
2977 | { | 2981 | { |
2978 | fClose = PromptCancel(m_hWnd, BOOTSTRAPPER_DISPLAY_FULL != m_command.display, m_sczConfirmCloseMessage ? m_sczConfirmCloseMessage : L"Are you sure you want to cancel?", m_pTheme->sczCaption); | 2982 | ::EnterCriticalSection(&m_csShowingInternalUiThisPackage); |
2983 | fClose = PromptCancel( | ||
2984 | m_hWnd, | ||
2985 | BOOTSTRAPPER_DISPLAY_FULL != m_command.display || m_fShowingInternalUiThisPackage, | ||
2986 | m_sczConfirmCloseMessage ? m_sczConfirmCloseMessage : L"Are you sure you want to cancel?", | ||
2987 | m_pTheme->sczCaption); | ||
2988 | ::LeaveCriticalSection(&m_csShowingInternalUiThisPackage); | ||
2989 | |||
2979 | fCancel = fClose; | 2990 | fCancel = fClose; |
2980 | } | 2991 | } |
2981 | 2992 | ||
@@ -3607,6 +3618,7 @@ public: | |||
3607 | m_pTaskbarList = NULL; | 3618 | m_pTaskbarList = NULL; |
3608 | m_uTaskbarButtonCreatedMessage = UINT_MAX; | 3619 | m_uTaskbarButtonCreatedMessage = UINT_MAX; |
3609 | m_fTaskbarButtonOK = FALSE; | 3620 | m_fTaskbarButtonOK = FALSE; |
3621 | ::InitializeCriticalSection(&m_csShowingInternalUiThisPackage); | ||
3610 | m_fShowingInternalUiThisPackage = FALSE; | 3622 | m_fShowingInternalUiThisPackage = FALSE; |
3611 | m_fTriedToLaunchElevated = FALSE; | 3623 | m_fTriedToLaunchElevated = FALSE; |
3612 | 3624 | ||
@@ -3631,6 +3643,7 @@ public: | |||
3631 | AssertSz(!::IsWindow(m_hWnd), "Window should have been destroyed before destructor."); | 3643 | AssertSz(!::IsWindow(m_hWnd), "Window should have been destroyed before destructor."); |
3632 | AssertSz(!m_pTheme, "Theme should have been released before destructor."); | 3644 | AssertSz(!m_pTheme, "Theme should have been released before destructor."); |
3633 | 3645 | ||
3646 | ::DeleteCriticalSection(&m_csShowingInternalUiThisPackage); | ||
3634 | ReleaseObject(m_pTaskbarList); | 3647 | ReleaseObject(m_pTaskbarList); |
3635 | ReleaseDict(m_sdOverridableVariables); | 3648 | ReleaseDict(m_sdOverridableVariables); |
3636 | ReleaseDict(m_shPrereqSupportPackages); | 3649 | ReleaseDict(m_shPrereqSupportPackages); |
@@ -3713,6 +3726,7 @@ private: | |||
3713 | ITaskbarList3* m_pTaskbarList; | 3726 | ITaskbarList3* m_pTaskbarList; |
3714 | UINT m_uTaskbarButtonCreatedMessage; | 3727 | UINT m_uTaskbarButtonCreatedMessage; |
3715 | BOOL m_fTaskbarButtonOK; | 3728 | BOOL m_fTaskbarButtonOK; |
3729 | CRITICAL_SECTION m_csShowingInternalUiThisPackage; | ||
3716 | BOOL m_fShowingInternalUiThisPackage; | 3730 | BOOL m_fShowingInternalUiThisPackage; |
3717 | BOOL m_fTriedToLaunchElevated; | 3731 | BOOL m_fTriedToLaunchElevated; |
3718 | 3732 | ||