From b7faab06259d3afdc3205024a0004ace72157cbe Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 29 Apr 2020 19:31:01 +1000 Subject: Treat failing to load SCD like mbahost treats .NET 4.5.2 on Win7 RTM. --- src/wixstdba/Resources/dncpreq.thm | 47 ++++++++++++++++++++++ src/wixstdba/Resources/dncpreq.wxl | 29 +++++++++++++ .../WixStandardBootstrapperApplication.cpp | 26 +++++++++++- src/wixstdba/wixstdba.cpp | 26 ++++++++++++ src/wixstdba/wixstdba.def | 2 + 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 src/wixstdba/Resources/dncpreq.thm create mode 100644 src/wixstdba/Resources/dncpreq.wxl (limited to 'src/wixstdba') diff --git a/src/wixstdba/Resources/dncpreq.thm b/src/wixstdba/Resources/dncpreq.thm new file mode 100644 index 00000000..4ae61819 --- /dev/null +++ b/src/wixstdba/Resources/dncpreq.thm @@ -0,0 +1,47 @@ + + + Segoe UI + Segoe UI + Segoe UI + Segoe UI + + + + + + + + + + + + #(loc.InstallLicenseTerms) + + + + + + + + + + + + + #(loc.FailureLogLinkText) + + + + + + + diff --git a/src/wixstdba/Resources/dncpreq.wxl b/src/wixstdba/Resources/dncpreq.wxl new file mode 100644 index 00000000..d6b73b5f --- /dev/null +++ b/src/wixstdba/Resources/dncpreq.wxl @@ -0,0 +1,29 @@ + + + + + + [WixBundleName] Setup + Microsoft .NET Core required for [WixBundleName] setup + Are you sure you want to cancel? + Setup Help + /passive | /quiet - displays minimal UI with no prompts or displays no UI and + no prompts. By default UI and all prompts are displayed. + +/norestart - suppress any attempts to restart. By default UI will prompt before restart. +/log log.txt - logs to a specific file. By default a log file is created in %TEMP%. + &Close + Click the "Accept and Install" button to accept the Microsoft .NET Core <a href="#">license terms</a>. + &Accept and Install + &Decline + Setup Progress + Processing: + &Cancel + Setup Failed + One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the <a href="#">log file</a>. + You must restart your computer to complete the rollback of the software. + &Restart + &Close + [WixBundleName] cannot run on this machine. Install the latest updates and/or the latest OS to run in a supported environment. + No action was taken as a system reboot is required. + diff --git a/src/wixstdba/WixStandardBootstrapperApplication.cpp b/src/wixstdba/WixStandardBootstrapperApplication.cpp index 88a26534..826c4386 100644 --- a/src/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/wixstdba/WixStandardBootstrapperApplication.cpp @@ -2892,6 +2892,23 @@ private: // privates } } } + else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal) + { + HRESULT hr = StrAllocString(&sczUnformattedText, L"#(loc.SCDRUNTIMEFAILUREErrorMessage)", 0); + if (FAILED(hr)) + { + BalLogError(hr, "Failed to initialize SCDRUNTIMEFAILUREErrorMessage loc identifier."); + } + else + { + hr = LocLocalizeString(m_pWixLoc, &sczUnformattedText); + if (FAILED(hr)) + { + BalLogError(hr, "Failed to localize SCDRUNTIMEFAILUREErrorMessage: %ls", sczUnformattedText); + ReleaseNullStr(sczUnformattedText); + } + } + } else // try to get the error message from the error code. { StrAllocFromError(&sczUnformattedText, m_hrFinal, NULL); @@ -2915,6 +2932,13 @@ private: // privates BalFormatString(sczUnformattedText, &sczText); } } + else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal) + { + if (sczUnformattedText) + { + BalFormatString(sczUnformattedText, &sczText); + } + } else { StrAllocFormatted(&sczText, L"0x%08x - %ls", m_hrFinal, sczUnformattedText); @@ -3754,7 +3778,7 @@ HRESULT CreateBootstrapperApplication( if (BOOTSTRAPPER_DISPLAY_UNKNOWN == pArgs->pCommand->display) { - ExitOnFailure(hr = E_INVALIDARG, "Engine requested Unknown display type."); + BalExitOnFailure(hr = E_INVALIDARG, "Engine requested Unknown display type."); } pApplication = new CWixStandardBootstrapperApplication(hModule, fPrereq, hrHostInitialization, pEngine, pArgs); diff --git a/src/wixstdba/wixstdba.cpp b/src/wixstdba/wixstdba.cpp index 2767c74e..727c8cb0 100644 --- a/src/wixstdba/wixstdba.cpp +++ b/src/wixstdba/wixstdba.cpp @@ -55,6 +55,32 @@ extern "C" void WINAPI BootstrapperApplicationDestroy() } +extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate( + __in HRESULT hrHostInitialization, + __in IBootstrapperEngine* pEngine, + __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, + __inout BOOTSTRAPPER_CREATE_RESULTS* pResults + ) +{ + HRESULT hr = S_OK; + + BalInitialize(pEngine); + + hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); + BalExitOnFailure(hr, "Failed to create .NET Core prerequisite bootstrapper application interface."); + +LExit: + return hr; +} + + +extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy() +{ + ReleaseNullObject(vpApplication); + BalUninitialize(); +} + + extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( __in HRESULT hrHostInitialization, __in IBootstrapperEngine* pEngine, diff --git a/src/wixstdba/wixstdba.def b/src/wixstdba/wixstdba.def index 815d2977..ba9980d3 100644 --- a/src/wixstdba/wixstdba.def +++ b/src/wixstdba/wixstdba.def @@ -4,5 +4,7 @@ EXPORTS BootstrapperApplicationCreate BootstrapperApplicationDestroy + DncPrereqBootstrapperApplicationCreate + DncPrereqBootstrapperApplicationDestroy MbaPrereqBootstrapperApplicationCreate MbaPrereqBootstrapperApplicationDestroy -- cgit v1.2.3-55-g6feb