From 4c34ad46d0eb664a48dc2b4a7696cd96c3c3a56a Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 26 Dec 2021 23:23:24 -0500 Subject: Remove RebootRequired per... ...https://github.com/wixtoolset/issues/issues/6668. --- src/burn/burn.cmd | 2 +- src/burn/burn.sln | 7 +-- src/burn/engine/engine.mc | 6 --- src/burn/engine/registration.cpp | 62 +------------------------ src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj | 20 +++++--- src/burn/test/BurnUnitTest/RegistrationTest.cpp | 1 - 6 files changed, 20 insertions(+), 78 deletions(-) (limited to 'src/burn') diff --git a/src/burn/burn.cmd b/src/burn/burn.cmd index 55478eb2..10d56558 100644 --- a/src/burn/burn.cmd +++ b/src/burn/burn.cmd @@ -12,7 +12,7 @@ nuget restore || exit /b -msbuild -t:Test -p:Configuration=%_C% test\BurnUnitTest || exit /b +msbuild -t:Test -p:Configuration=%_C%;Platform=x86 test\BurnUnitTest || exit /b msbuild -t:Build -p:Configuration=%_C%;Platform=x86 || exit /b msbuild -t:Build -p:Configuration=%_C%;Platform=x64 || exit /b diff --git a/src/burn/burn.sln b/src/burn/burn.sln index 95d8c511..0a6227a5 100644 --- a/src/burn/burn.sln +++ b/src/burn/burn.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30711.63 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 15.0.26124.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}" EndProject @@ -44,7 +44,8 @@ Global {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.ActiveCfg = Release|Win32 {C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}.Release|x86.Build.0 = Release|Win32 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|Win32 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.ActiveCfg = Debug|x64 + {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x64.Build.0 = Debug|x64 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.ActiveCfg = Debug|Win32 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Debug|x86.Build.0 = Debug|Win32 {9D1F1BA3-9393-4833-87A3-D5F1FC08EF67}.Release|ARM64.ActiveCfg = Release|ARM64 diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index 29e4f956..dde4d40b 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc @@ -1131,9 +1131,3 @@ Language=English Skipping MSI property '%1!ls!' because condition '%2!ls!' evaluates to %3!hs!. . -MessageId=701 -Severity=Warning -SymbolicName=MSG_PENDING_REBOOT_DETECTED -Language=English -A reboot is pending from a prior execution of this bundle: %1!ls!. Apply will be blocked. Continuing... -. diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 54a5a928..e06767e1 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp @@ -7,7 +7,6 @@ const LPCWSTR REGISTRY_RUN_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"; const LPCWSTR REGISTRY_RUN_ONCE_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"; -const LPCWSTR REGISTRY_REBOOT_PENDING_FORMAT = L"%ls.RebootRequired"; const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L"Installed"; const LPCWSTR REGISTRY_BUNDLE_DISPLAY_ICON = L"DisplayIcon"; const LPCWSTR REGISTRY_BUNDLE_DISPLAY_VERSION = L"DisplayVersion"; @@ -108,9 +107,6 @@ static HRESULT UpdateBundleNameRegistration( __in BOOL fInProgressRegistration ); static BOOL IsWuRebootPending(); -static BOOL IsBundleRebootPending( - __in BURN_REGISTRATION* pRegistration -); static BOOL IsRegistryRebootPending(); // function definitions @@ -469,7 +465,7 @@ extern "C" HRESULT RegistrationSetVariables( hr = VariableSetVersion(pVariables, BURN_BUNDLE_VERSION, pRegistration->pVersion, TRUE); ExitOnFailure(hr, "Failed to overwrite the bundle version built-in variable."); - hr = VariableSetNumeric(pVariables, BURN_REBOOT_PENDING, IsBundleRebootPending(pRegistration) || IsWuRebootPending() || IsRegistryRebootPending(), TRUE); + hr = VariableSetNumeric(pVariables, BURN_REBOOT_PENDING, IsWuRebootPending() || IsRegistryRebootPending(), TRUE); ExitOnFailure(hr, "Failed to overwrite the bundle reboot-pending built-in variable."); LExit: @@ -521,14 +517,6 @@ extern "C" HRESULT RegistrationDetectResumeType( HKEY hkRegistration = NULL; DWORD dwResume = 0; - if (IsBundleRebootPending(pRegistration)) - { - LogId(REPORT_STANDARD, MSG_PENDING_REBOOT_DETECTED, pRegistration->sczRegistrationKey); - - *pResumeType = BOOTSTRAPPER_RESUME_TYPE_REBOOT_PENDING; - ExitFunction1(hr = S_OK); - } - // open registration key hr = RegOpen(pRegistration->hkRoot, pRegistration->sczRegistrationKey, KEY_QUERY_VALUE, &hkRegistration); if (E_FILENOTFOUND == hr || E_PATHNOTFOUND == hr) @@ -905,31 +893,8 @@ extern "C" HRESULT RegistrationSessionEnd( ) { HRESULT hr = S_OK; - LPWSTR sczRebootRequiredKey = NULL; - HKEY hkRebootRequired = NULL; HKEY hkRegistration = NULL; - // If a restart is required for any reason, write a volatile registry key to track of - // of that fact until the reboot has taken place. - if (BOOTSTRAPPER_APPLY_RESTART_NONE != restart) - { - // We'll write the volatile registry key right next to the bundle ARP registry key - // because that's easy. This is all best effort since the worst case just means in - // the rare case the user launches the same install again before taking the restart - // the BA won't know a restart was still required. - hr = StrAllocFormatted(&sczRebootRequiredKey, REGISTRY_REBOOT_PENDING_FORMAT, pRegistration->sczRegistrationKey); - if (SUCCEEDED(hr)) - { - hr = RegCreateEx(pRegistration->hkRoot, sczRebootRequiredKey, KEY_WRITE, TRUE, NULL, &hkRebootRequired, NULL); - } - - if (FAILED(hr)) - { - ExitTraceSource(DUTIL_SOURCE_DEFAULT, hr, "Failed to write volatile reboot required registry key."); - hr = S_OK; - } - } - // If no resume mode, then remove the bundle registration. if (BURN_RESUME_MODE_NONE == resumeMode) { @@ -981,8 +946,6 @@ extern "C" HRESULT RegistrationSessionEnd( LExit: ReleaseRegKey(hkRegistration); - ReleaseRegKey(hkRebootRequired); - ReleaseStr(sczRebootRequiredKey); return hr; } @@ -1320,7 +1283,6 @@ static HRESULT UpdateResumeMode( { HRESULT hr = S_OK; DWORD er = ERROR_SUCCESS; - HKEY hkRebootRequired = NULL; HKEY hkRun = NULL; LPWSTR sczRunOnceCommandLine = NULL; LPCWSTR sczResumeKey = REGISTRY_RUN_ONCE_KEY; @@ -1399,7 +1361,6 @@ static HRESULT UpdateResumeMode( LExit: ReleaseStr(sczRunOnceCommandLine); - ReleaseRegKey(hkRebootRequired); ReleaseRegKey(hkRun); return hr; @@ -1769,27 +1730,6 @@ static BOOL IsWuRebootPending() return fRebootPending; } -static BOOL IsBundleRebootPending(BURN_REGISTRATION* pRegistration) -{ - HRESULT hr = S_OK; - LPWSTR sczRebootRequiredKey = NULL; - HKEY hkRebootRequired = NULL; - BOOL fBundleRebootPending = FALSE; - - // Check to see if a restart is pending for this bundle. - hr = StrAllocFormatted(&sczRebootRequiredKey, REGISTRY_REBOOT_PENDING_FORMAT, pRegistration->sczRegistrationKey); - ExitOnFailure(hr, "Failed to format pending restart registry key to read."); - - hr = RegOpen(pRegistration->hkRoot, sczRebootRequiredKey, KEY_QUERY_VALUE, &hkRebootRequired); - fBundleRebootPending = SUCCEEDED(hr); - -LExit: - ReleaseStr(sczRebootRequiredKey); - ReleaseRegKey(hkRebootRequired); - - return fBundleRebootPending; -} - static BOOL IsRegistryRebootPending() { HRESULT hr = S_OK; diff --git a/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj b/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj index c038dccd..714b6549 100644 --- a/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj +++ b/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj @@ -5,22 +5,30 @@ - - Debug - ARM64 - Debug Win32 - - Release + + Debug + x64 + + + Debug ARM64 Release Win32 + + Release + x64 + + + Release + ARM64 + diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index 94937ef6..3cf15d10 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp @@ -369,7 +369,6 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to set registration variables."); Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_BUNDLE_INSTALLED)); - Assert::Equal(1ll, VariableGetNumericHelper(&variables, BURN_REBOOT_PENDING)); Assert::Equal(gcnew String(L"foo"), VariableGetStringHelper(&variables, BURN_BUNDLE_TAG)); Assert::Equal(gcnew String(L"bar"), VariableGetStringHelper(&variables, BURN_BUNDLE_PROVIDER_KEY)); Assert::Equal(gcnew String(L"1.0.0.0"), VariableGetVersionHelper(&variables, BURN_BUNDLE_VERSION)); -- cgit v1.2.3-55-g6feb