diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-29 19:31:01 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-29 19:53:29 +1000 |
| commit | b7faab06259d3afdc3205024a0004ace72157cbe (patch) | |
| tree | 4d9797f017b564c0fe6e8a602950c876daba612f /src/wixstdba | |
| parent | 39e930d9aaff250e0fd5019eeedaa40717a6c6fe (diff) | |
| download | wix-b7faab06259d3afdc3205024a0004ace72157cbe.tar.gz wix-b7faab06259d3afdc3205024a0004ace72157cbe.tar.bz2 wix-b7faab06259d3afdc3205024a0004ace72157cbe.zip | |
Treat failing to load SCD like mbahost treats .NET 4.5.2 on Win7 RTM.
Diffstat (limited to 'src/wixstdba')
| -rw-r--r-- | src/wixstdba/Resources/dncpreq.thm | 47 | ||||
| -rw-r--r-- | src/wixstdba/Resources/dncpreq.wxl | 29 | ||||
| -rw-r--r-- | src/wixstdba/WixStandardBootstrapperApplication.cpp | 26 | ||||
| -rw-r--r-- | src/wixstdba/wixstdba.cpp | 26 | ||||
| -rw-r--r-- | src/wixstdba/wixstdba.def | 2 |
5 files changed, 129 insertions, 1 deletions
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil"> | ||
| 3 | <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font> | ||
| 4 | <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font> | ||
| 5 | <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font> | ||
| 6 | <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font> | ||
| 7 | |||
| 8 | <Window Width="485" Height="300" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)"> | ||
| 9 | <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="mbapreq.png" Visible="yes"/> | ||
| 10 | <Label X="80" Y="11" Width="-11" Height="96" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label> | ||
| 11 | |||
| 12 | <Page Name="Help"> | ||
| 13 | <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label> | ||
| 14 | <Label X="11" Y="153" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label> | ||
| 15 | <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | ||
| 16 | <Text>#(loc.HelpCloseButton)</Text> | ||
| 17 | <CloseWindowAction /> | ||
| 18 | </Button> | ||
| 19 | </Page> | ||
| 20 | <Page Name="Install"> | ||
| 21 | <Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="34" TabStop="yes" FontId="3">#(loc.InstallLicenseTerms)</Hypertext> | ||
| 22 | <Button Name="InstallButton" X="-91" Y="-11" Width="130" Height="23" TabStop="yes" FontId="0">#(loc.InstallAcceptAndInstallButton)</Button> | ||
| 23 | <Button Name="InstallDeclineButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | ||
| 24 | <Text>#(loc.InstallDeclineButton)</Text> | ||
| 25 | <CloseWindowAction /> | ||
| 26 | </Button> | ||
| 27 | </Page> | ||
| 28 | <Page Name="Progress"> | ||
| 29 | <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label> | ||
| 30 | <Label X="11" Y="153" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label> | ||
| 31 | <Label Name="OverallProgressPackageText" X="85" Y="153" Width="-11" Height="17" FontId="3" DisablePrefix="yes">[ProgressPackageName]</Label> | ||
| 32 | <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="175" Width="-11" Height="15" /> | ||
| 33 | <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button> | ||
| 34 | </Page> | ||
| 35 | <Page Name="Failure"> | ||
| 36 | <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.FailureHeader)</Label> | ||
| 37 | <Hypertext Name="FailureLogFileLink" X="11" Y="153" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureLogLinkText)</Hypertext> | ||
| 38 | <Hypertext Name="FailureMessageText" X="22" Y="190" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes"/> | ||
| 39 | <Label X="-11" Y="-20" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label> | ||
| 40 | <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button> | ||
| 41 | <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | ||
| 42 | <Text>#(loc.FailureCloseButton)</Text> | ||
| 43 | <CloseWindowAction /> | ||
| 44 | </Button> | ||
| 45 | </Page> | ||
| 46 | </Window> | ||
| 47 | </Theme> | ||
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | |||
| 5 | <WixLocalization Culture="en-us" Language="1033" xmlns="http://wixtoolset.org/schemas/v4/wxl"> | ||
| 6 | <String Id="Caption">[WixBundleName] Setup</String> | ||
| 7 | <String Id="Title">Microsoft .NET Core required for [WixBundleName] setup</String> | ||
| 8 | <String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String> | ||
| 9 | <String Id="HelpHeader">Setup Help</String> | ||
| 10 | <String Id="HelpText">/passive | /quiet - displays minimal UI with no prompts or displays no UI and | ||
| 11 | no prompts. By default UI and all prompts are displayed. | ||
| 12 | |||
| 13 | /norestart - suppress any attempts to restart. By default UI will prompt before restart. | ||
| 14 | /log log.txt - logs to a specific file. By default a log file is created in %TEMP%.</String> | ||
| 15 | <String Id="HelpCloseButton">&Close</String> | ||
| 16 | <String Id="InstallLicenseTerms">Click the "Accept and Install" button to accept the Microsoft .NET Core <a href="#">license terms</a>.</String> | ||
| 17 | <String Id="InstallAcceptAndInstallButton">&Accept and Install</String> | ||
| 18 | <String Id="InstallDeclineButton">&Decline</String> | ||
| 19 | <String Id="ProgressHeader">Setup Progress</String> | ||
| 20 | <String Id="ProgressLabel">Processing:</String> | ||
| 21 | <String Id="ProgressCancelButton">&Cancel</String> | ||
| 22 | <String Id="FailureHeader">Setup Failed</String> | ||
| 23 | <String Id="FailureLogLinkText">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>.</String> | ||
| 24 | <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String> | ||
| 25 | <String Id="FailureRestartButton">&Restart</String> | ||
| 26 | <String Id="FailureCloseButton">&Close</String> | ||
| 27 | <String Id="SCDRUNTIMEFAILUREErrorMessage">[WixBundleName] cannot run on this machine. Install the latest updates and/or the latest OS to run in a supported environment.</String> | ||
| 28 | <String Id="ErrorFailNoActionReboot">No action was taken as a system reboot is required.</String> | ||
| 29 | </WixLocalization> | ||
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 | |||
| 2892 | } | 2892 | } |
| 2893 | } | 2893 | } |
| 2894 | } | 2894 | } |
| 2895 | else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal) | ||
| 2896 | { | ||
| 2897 | HRESULT hr = StrAllocString(&sczUnformattedText, L"#(loc.SCDRUNTIMEFAILUREErrorMessage)", 0); | ||
| 2898 | if (FAILED(hr)) | ||
| 2899 | { | ||
| 2900 | BalLogError(hr, "Failed to initialize SCDRUNTIMEFAILUREErrorMessage loc identifier."); | ||
| 2901 | } | ||
| 2902 | else | ||
| 2903 | { | ||
| 2904 | hr = LocLocalizeString(m_pWixLoc, &sczUnformattedText); | ||
| 2905 | if (FAILED(hr)) | ||
| 2906 | { | ||
| 2907 | BalLogError(hr, "Failed to localize SCDRUNTIMEFAILUREErrorMessage: %ls", sczUnformattedText); | ||
| 2908 | ReleaseNullStr(sczUnformattedText); | ||
| 2909 | } | ||
| 2910 | } | ||
| 2911 | } | ||
| 2895 | else // try to get the error message from the error code. | 2912 | else // try to get the error message from the error code. |
| 2896 | { | 2913 | { |
| 2897 | StrAllocFromError(&sczUnformattedText, m_hrFinal, NULL); | 2914 | StrAllocFromError(&sczUnformattedText, m_hrFinal, NULL); |
| @@ -2915,6 +2932,13 @@ private: // privates | |||
| 2915 | BalFormatString(sczUnformattedText, &sczText); | 2932 | BalFormatString(sczUnformattedText, &sczText); |
| 2916 | } | 2933 | } |
| 2917 | } | 2934 | } |
| 2935 | else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal) | ||
| 2936 | { | ||
| 2937 | if (sczUnformattedText) | ||
| 2938 | { | ||
| 2939 | BalFormatString(sczUnformattedText, &sczText); | ||
| 2940 | } | ||
| 2941 | } | ||
| 2918 | else | 2942 | else |
| 2919 | { | 2943 | { |
| 2920 | StrAllocFormatted(&sczText, L"0x%08x - %ls", m_hrFinal, sczUnformattedText); | 2944 | StrAllocFormatted(&sczText, L"0x%08x - %ls", m_hrFinal, sczUnformattedText); |
| @@ -3754,7 +3778,7 @@ HRESULT CreateBootstrapperApplication( | |||
| 3754 | 3778 | ||
| 3755 | if (BOOTSTRAPPER_DISPLAY_UNKNOWN == pArgs->pCommand->display) | 3779 | if (BOOTSTRAPPER_DISPLAY_UNKNOWN == pArgs->pCommand->display) |
| 3756 | { | 3780 | { |
| 3757 | ExitOnFailure(hr = E_INVALIDARG, "Engine requested Unknown display type."); | 3781 | BalExitOnFailure(hr = E_INVALIDARG, "Engine requested Unknown display type."); |
| 3758 | } | 3782 | } |
| 3759 | 3783 | ||
| 3760 | pApplication = new CWixStandardBootstrapperApplication(hModule, fPrereq, hrHostInitialization, pEngine, pArgs); | 3784 | 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() | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate( | ||
| 59 | __in HRESULT hrHostInitialization, | ||
| 60 | __in IBootstrapperEngine* pEngine, | ||
| 61 | __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, | ||
| 62 | __inout BOOTSTRAPPER_CREATE_RESULTS* pResults | ||
| 63 | ) | ||
| 64 | { | ||
| 65 | HRESULT hr = S_OK; | ||
| 66 | |||
| 67 | BalInitialize(pEngine); | ||
| 68 | |||
| 69 | hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); | ||
| 70 | BalExitOnFailure(hr, "Failed to create .NET Core prerequisite bootstrapper application interface."); | ||
| 71 | |||
| 72 | LExit: | ||
| 73 | return hr; | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy() | ||
| 78 | { | ||
| 79 | ReleaseNullObject(vpApplication); | ||
| 80 | BalUninitialize(); | ||
| 81 | } | ||
| 82 | |||
| 83 | |||
| 58 | extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( | 84 | extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( |
| 59 | __in HRESULT hrHostInitialization, | 85 | __in HRESULT hrHostInitialization, |
| 60 | __in IBootstrapperEngine* pEngine, | 86 | __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 @@ | |||
| 4 | EXPORTS | 4 | EXPORTS |
| 5 | BootstrapperApplicationCreate | 5 | BootstrapperApplicationCreate |
| 6 | BootstrapperApplicationDestroy | 6 | BootstrapperApplicationDestroy |
| 7 | DncPrereqBootstrapperApplicationCreate | ||
| 8 | DncPrereqBootstrapperApplicationDestroy | ||
| 7 | MbaPrereqBootstrapperApplicationCreate | 9 | MbaPrereqBootstrapperApplicationCreate |
| 8 | MbaPrereqBootstrapperApplicationDestroy | 10 | MbaPrereqBootstrapperApplicationDestroy |
