@joebigelow / wix / commits / 4c34ad46

Remove RebootRequired per...

...https://github.com/wixtoolset/issues/issues/6668.

Bob Arnson committed Dec 26, 2021 at 23:23 UTC 4c34ad46d0eb664a48dc2b4a7696cd96c3c3a56a
6 files changed +20 -78
src/burn/burn.cmd
+1 -1
@@ -12,7 +12,7 @@
12
13 nuget restore || exit /b
14
15 -msbuild -t:Test -p:Configuration=%_C% test\BurnUnitTest || exit /b
15 +msbuild -t:Test -p:Configuration=%_C%;Platform=x86 test\BurnUnitTest || exit /b
16
17 msbuild -t:Build -p:Configuration=%_C%;Platform=x86 || exit /b
18 msbuild -t:Build -p:Configuration=%_C%;Platform=x64 || exit /b
src/burn/burn.sln
+4 -3
@@ -1,7 +1,7 @@
1 
2 Microsoft Visual Studio Solution File, Format Version 12.00
3 -# Visual Studio Version 16
4 -VisualStudioVersion = 16.0.30711.63
3 +# Visual Studio Version 17
4 +VisualStudioVersion = 17.0.32014.148
5 MinimumVisualStudioVersion = 15.0.26124.0
6 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}"
7 EndProject
@@ -44,7 +44,8 @@ Global
44 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.ActiveCfg = Release|Win32
45 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.Build.0 = Release|Win32
46 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|ARM64.ActiveCfg = Debug|ARM64
47 - {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|Win32
47 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|x64
48 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.Build.0 = Debug|x64
49 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.ActiveCfg = Debug|Win32
50 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.Build.0 = Debug|Win32
51 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|ARM64.ActiveCfg = Release|ARM64
src/burn/engine/engine.mc
-6
@@ -1131,9 +1131,3 @@ Language=English
1131 Skipping MSI property '%1!ls!' because condition '%2!ls!' evaluates to %3!hs!.
1132 .
1133
1134 -MessageId=701
1135 -Severity=Warning
1136 -SymbolicName=MSG_PENDING_REBOOT_DETECTED
1137 -Language=English
1138 -A reboot is pending from a prior execution of this bundle: %1!ls!. Apply will be blocked. Continuing...
1139 -.
src/burn/engine/registration.cpp
+1 -61
@@ -7,7 +7,6 @@
7
8 const LPCWSTR REGISTRY_RUN_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
9 const LPCWSTR REGISTRY_RUN_ONCE_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce";
10 -const LPCWSTR REGISTRY_REBOOT_PENDING_FORMAT = L"%ls.RebootRequired";
10 const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L"Installed";
11 const LPCWSTR REGISTRY_BUNDLE_DISPLAY_ICON = L"DisplayIcon";
12 const LPCWSTR REGISTRY_BUNDLE_DISPLAY_VERSION = L"DisplayVersion";
@@ -108,9 +107,6 @@ static HRESULT UpdateBundleNameRegistration(
107 __in BOOL fInProgressRegistration
108 );
109 static BOOL IsWuRebootPending();
111 -static BOOL IsBundleRebootPending(
112 - __in BURN_REGISTRATION* pRegistration
113 -);
110 static BOOL IsRegistryRebootPending();
111
112 // function definitions
@@ -469,7 +465,7 @@ extern "C" HRESULT RegistrationSetVariables(
465 hr = VariableSetVersion(pVariables, BURN_BUNDLE_VERSION, pRegistration->pVersion, TRUE);
466 ExitOnFailure(hr, "Failed to overwrite the bundle version built-in variable.");
467
472 - hr = VariableSetNumeric(pVariables, BURN_REBOOT_PENDING, IsBundleRebootPending(pRegistration) || IsWuRebootPending() || IsRegistryRebootPending(), TRUE);
468 + hr = VariableSetNumeric(pVariables, BURN_REBOOT_PENDING, IsWuRebootPending() || IsRegistryRebootPending(), TRUE);
469 ExitOnFailure(hr, "Failed to overwrite the bundle reboot-pending built-in variable.");
470
471 LExit:
@@ -521,14 +517,6 @@ extern "C" HRESULT RegistrationDetectResumeType(
517 HKEY hkRegistration = NULL;
518 DWORD dwResume = 0;
519
524 - if (IsBundleRebootPending(pRegistration))
525 - {
526 - LogId(REPORT_STANDARD, MSG_PENDING_REBOOT_DETECTED, pRegistration->sczRegistrationKey);
527 -
528 - *pResumeType = BOOTSTRAPPER_RESUME_TYPE_REBOOT_PENDING;
529 - ExitFunction1(hr = S_OK);
530 - }
531 -
520 // open registration key
521 hr = RegOpen(pRegistration->hkRoot, pRegistration->sczRegistrationKey, KEY_QUERY_VALUE, &hkRegistration);
522 if (E_FILENOTFOUND == hr || E_PATHNOTFOUND == hr)
@@ -905,31 +893,8 @@ extern "C" HRESULT RegistrationSessionEnd(
893 )
894 {
895 HRESULT hr = S_OK;
908 - LPWSTR sczRebootRequiredKey = NULL;
909 - HKEY hkRebootRequired = NULL;
896 HKEY hkRegistration = NULL;
897
912 - // If a restart is required for any reason, write a volatile registry key to track of
913 - // of that fact until the reboot has taken place.
914 - if (BOOTSTRAPPER_APPLY_RESTART_NONE != restart)
915 - {
916 - // We'll write the volatile registry key right next to the bundle ARP registry key
917 - // because that's easy. This is all best effort since the worst case just means in
918 - // the rare case the user launches the same install again before taking the restart
919 - // the BA won't know a restart was still required.
920 - hr = StrAllocFormatted(&sczRebootRequiredKey, REGISTRY_REBOOT_PENDING_FORMAT, pRegistration->sczRegistrationKey);
921 - if (SUCCEEDED(hr))
922 - {
923 - hr = RegCreateEx(pRegistration->hkRoot, sczRebootRequiredKey, KEY_WRITE, TRUE, NULL, &hkRebootRequired, NULL);
924 - }
925 -
926 - if (FAILED(hr))
927 - {
928 - ExitTraceSource(DUTIL_SOURCE_DEFAULT, hr, "Failed to write volatile reboot required registry key.");
929 - hr = S_OK;
930 - }
931 - }
932 -
898 // If no resume mode, then remove the bundle registration.
899 if (BURN_RESUME_MODE_NONE == resumeMode)
900 {
@@ -981,8 +946,6 @@ extern "C" HRESULT RegistrationSessionEnd(
946
947 LExit:
948 ReleaseRegKey(hkRegistration);
984 - ReleaseRegKey(hkRebootRequired);
985 - ReleaseStr(sczRebootRequiredKey);
949
950 return hr;
951 }
@@ -1320,7 +1283,6 @@ static HRESULT UpdateResumeMode(
1283 {
1284 HRESULT hr = S_OK;
1285 DWORD er = ERROR_SUCCESS;
1323 - HKEY hkRebootRequired = NULL;
1286 HKEY hkRun = NULL;
1287 LPWSTR sczRunOnceCommandLine = NULL;
1288 LPCWSTR sczResumeKey = REGISTRY_RUN_ONCE_KEY;
@@ -1399,7 +1361,6 @@ static HRESULT UpdateResumeMode(
1361
1362 LExit:
1363 ReleaseStr(sczRunOnceCommandLine);
1402 - ReleaseRegKey(hkRebootRequired);
1364 ReleaseRegKey(hkRun);
1365
1366 return hr;
@@ -1769,27 +1730,6 @@ static BOOL IsWuRebootPending()
1730 return fRebootPending;
1731 }
1732
1772 -static BOOL IsBundleRebootPending(BURN_REGISTRATION* pRegistration)
1773 -{
1774 - HRESULT hr = S_OK;
1775 - LPWSTR sczRebootRequiredKey = NULL;
1776 - HKEY hkRebootRequired = NULL;
1777 - BOOL fBundleRebootPending = FALSE;
1778 -
1779 - // Check to see if a restart is pending for this bundle.
1780 - hr = StrAllocFormatted(&sczRebootRequiredKey, REGISTRY_REBOOT_PENDING_FORMAT, pRegistration->sczRegistrationKey);
1781 - ExitOnFailure(hr, "Failed to format pending restart registry key to read.");
1782 -
1783 - hr = RegOpen(pRegistration->hkRoot, sczRebootRequiredKey, KEY_QUERY_VALUE, &hkRebootRequired);
1784 - fBundleRebootPending = SUCCEEDED(hr);
1785 -
1786 -LExit:
1787 - ReleaseStr(sczRebootRequiredKey);
1788 - ReleaseRegKey(hkRebootRequired);
1789 -
1790 - return fBundleRebootPending;
1791 -}
1792 -
1733 static BOOL IsRegistryRebootPending()
1734 {
1735 HRESULT hr = S_OK;
src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj
+14 -6
@@ -5,22 +5,30 @@
5 <Import Project="..\..\..\internal\WixBuildTools.TestSupport.Native\build\WixBuildTools.TestSupport.Native.props" />
6
7 <ItemGroup Label="ProjectConfigurations">
8 - <ProjectConfiguration Include="Debug|ARM64">
9 - <Configuration>Debug</Configuration>
10 - <Platform>ARM64</Platform>
11 - </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|Win32">
9 <Configuration>Debug</Configuration>
10 <Platform>Win32</Platform>
11 </ProjectConfiguration>
16 - <ProjectConfiguration Include="Release|ARM64">
17 - <Configuration>Release</Configuration>
12 + <ProjectConfiguration Include="Debug|x64">
13 + <Configuration>Debug</Configuration>
14 + <Platform>x64</Platform>
15 + </ProjectConfiguration>
16 + <ProjectConfiguration Include="Debug|ARM64">
17 + <Configuration>Debug</Configuration>
18 <Platform>ARM64</Platform>
19 </ProjectConfiguration>
20 <ProjectConfiguration Include="Release|Win32">
21 <Configuration>Release</Configuration>
22 <Platform>Win32</Platform>
23 </ProjectConfiguration>
24 + <ProjectConfiguration Include="Release|x64">
25 + <Configuration>Release</Configuration>
26 + <Platform>x64</Platform>
27 + </ProjectConfiguration>
28 + <ProjectConfiguration Include="Release|ARM64">
29 + <Configuration>Release</Configuration>
30 + <Platform>ARM64</Platform>
31 + </ProjectConfiguration>
32 </ItemGroup>
33
34 <PropertyGroup Label="Globals">
src/burn/test/BurnUnitTest/RegistrationTest.cpp
-1
@@ -369,7 +369,6 @@ namespace Bootstrapper
369 TestThrowOnFailure(hr, L"Failed to set registration variables.");
370
371 Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_BUNDLE_INSTALLED));
372 - Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_REBOOT_PENDING));
372 Assert::Equal<String^>(gcnew String(L"foo"), VariableGetStringHelper(&variables, BURN_BUNDLE_TAG));
373 Assert::Equal<String^>(gcnew String(L"bar"), VariableGetStringHelper(&variables, BURN_BUNDLE_PROVIDER_KEY));
374 Assert::Equal<String^>(gcnew String(L"1.0.0.0"), VariableGetVersionHelper(&variables, BURN_BUNDLE_VERSION));