Remove-MS-Edge icon indicating copy to clipboard operation
Remove-MS-Edge copied to clipboard

Update failure loop on latest Win10 update KB5051974 #79

Open ChillyBilly86 opened this issue 9 months ago • 9 comments

Great little edge unistaller, but maybe it totally brakes Windows 10 update now, causing update failure loop when installing KB5051974. Reinstalling edge doesn't fix the problem, will update when i find solution.

ChillyBilly86 avatar Feb 12 '25 20:02 ChillyBilly86

Can confirm.

ltguillaume avatar Feb 12 '25 21:02 ltguillaume

It appears to have to do with some folders not being deleted.

Temporary Fix - run this after removing edge.

taskkill /im MicrosoftEdgeUpdate.exe /f
rd /s /q "C:\Program Files (x86)\Microsoft\Edge"
rd /s /q "C:\Program Files (x86)\Microsoft\EdgeCore"
rd /s /q "C:\Program Files (x86)\Microsoft\EdgeUpdate"
rd /s /q "C:\Program Files (x86)\Microsoft\Temp"

ShadowWhisperer avatar Feb 13 '25 02:02 ShadowWhisperer

Updated. Should be working. Edge re-installs with this new update.

Let me know if you have issues.

ShadowWhisperer avatar Feb 13 '25 06:02 ShadowWhisperer

Temp fix is much further from the cause of this, thanks for replying tho :) RemoveEdge is causing Update loop on a fresh install machine, when you run it right before Windows updates (as stated)

RemoveEdge might not be related to the cause of this particular UpdateLoop, cause many of my systems did the update correctly. The tricky part is that the image of all this systems is almost identical to the ones that didn't work, and that really is a riddle. The only difference is that i used an earlier version of RemoveEdge.

Tried in place upgrade and still didn't fix. Tried to recreate the error but i couldn't.

1: Fresh installed Win10LTSC_IOT 21H2
2: Manually updating to the previous Cumulative update KB5049981 3: Run latest Remove-Edge.exe 4: Manually updating to latest Cumulative Update KB5051974 and it worked.

Which means that maybe something else is breaking my other systems that are affected withe update loop. Also used a tracing program to detect everything that RemoveEdge does, it gathered everything and simply restored it on an affected system, but nothing still.

The only thing that fixed it was system reset which is not an option. In the meantime i just paused updates forever on those systems until Microsoft fixes it. Sorry for my long post. Will update if i get to the source of this.

ChillyBilly86 avatar Feb 14 '25 15:02 ChillyBilly86

Strange. I had both an older Win 10, and did a fresh install (In a VM). I did all of the updates except KB5051974, and took a snapshot. If I leave Edge alone it was fine. If I ran the Edge removal tool, if failed and did the reboot loop. After deleting these folder first, it didn't fail on either VMs.

I'll keep testing, but we don't have a lot of Windows 10 systems coming in lately.

ShadowWhisperer avatar Feb 14 '25 15:02 ShadowWhisperer

Working for you @ltguillaume ?

ShadowWhisperer avatar Feb 21 '25 04:02 ShadowWhisperer

I've tried your suggestions and many variations of it and plenty of other things, couldn't fix or reproduce the loop. I've hidden the update and postponed auto updates for a month on all these systems. Hope they fix it on the next Cumulative Update and they will be able to update normally, or else infinite update pause is innvitable, they will get Defender updates at least.

Will keep Edge on new systems but will disable this on Group Policy: "Computer Configuration - Administrative Templates - Windows Components - Microsoft Edge -Allow Microsoft Edge to Prelaunch -Allow Microsoft Edge to start and load"

Thanks for your help :)

ChillyBilly86 avatar Feb 23 '25 16:02 ChillyBilly86

Have anyone gotten out of this Windows Update loop successfully?

First I tried deleting the folders as mentioned, but that didn't work. Then I tried reinstalling Edge and then reapplying the update, but that didn't work either.

I guess the system is hosed if you run these scripts?

madsl avatar Mar 28 '25 12:03 madsl

@madsl

%WinDir%\Logs\CBS\CBS.log

ShadowWhisperer avatar Apr 02 '25 20:04 ShadowWhisperer

@ShadowWhisperer

Win11 LTSC, tried the following:

  • Reinstalling Edge + WV, then updating
  • Uninstalling Edge the "Microsoft way" via Settings, then updating
  • Removing Edge with this script, then updating

When using online update, it just constantly reverts after two reboots ("Something went wrong. Don't worry... etc.")

With offline installation packages, I found that the latest CU showed the error code when using offline CU update: 0x800f0838 with event log entry:

Windows update "KB5055627: Update voor Windows" could not be installed because of error 2148468792 "" (Command line: ""C:\WINDOWS\system32\wusa.exe" "D:\Evenwel\Updates\Windows11.0-KB5055627-x64.msu" ")

Thanks to https://community.broadcom.com/symantecenterprise/discussion/lcu-error-0x800f0838-after-inplace-upgrade-win11-24h2 I found out that indeed the "checkpoint update" KB5043080 needed to be installed first.

However, trying an offline install of this update gave the same result as the online update.

Investigation still ongoing.

ltguillaume avatar May 05 '25 14:05 ltguillaume

I have found the issue and managed to recover the updating functionality on my Windows 11 LTSC.

For me, the issue was indeed caused by (the May 29, 2024 version of) this script. This version was escaping the | pipe character in the following command:

for /f "delims=" %%a in ('powershell -NoProfile -Command "Get-AppxPackage -AllUsers ^| Where-Object { $_.PackageFullName -like '*microsoftedge*' } ^| Select-Object -ExpandProperty PackageFullName"') do (

As such, a set of illegal registry were found that actually consisted of PowerShell's error output. Below is a non-exhaustive list of those keys (i.e. you should check everywhere under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx for such keys and delete them):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\    + CategoryInfo          : InvalidArgument: (:) [Where-Object], ParameterBindingException
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.WhereObjectCommand
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\+ ... AllUsers ^| Where-Object { $_.PackageFullName -like '*microsoftedge*' ...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\At line:1 char:30

The same junk keys were found in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-21-4118929241-500846636-3322479537-1001

ltguillaume avatar May 05 '25 16:05 ltguillaume

I have finally found the solution thanks to this guy FCA162 on reddit Tested on Windows 10 21H2 IOT LTSC WinUpdateFix.zip

-Copy the script "Mark_Corrupted_Packages_as_Absent.ps1" to C -Run with Nirsofts AdvancedRun and execute it as TrustedInstaller (as shown below) -Reboot the device and run update, it will work flawlessly with no errors.

The script will mark the corrupted packages as absent, so it will force redownload and install

Image

ChillyBilly86 avatar May 05 '25 17:05 ChillyBilly86

I added a fix to the beginning of the .exe versions that should delete the invalid keys.

ShadowWhisperer avatar May 05 '25 18:05 ShadowWhisperer

I added a fix to the beginning of the .exe versions that should delete the invalid keys.

So these 3 keys can just be removed and are then rebuilt by Windows?

As for the solution used by @ChillyBilly86, that might be solution for a different problem?

ltguillaume avatar May 05 '25 18:05 ltguillaume

It's my understanding that it does. **Apps disabled by the end user may reinstall

The subkeys under Deprovisioned and EndOfLife

** I hadn't had a chance to fully read ChillyBilly86's full post, yet.

I keep getting interrupted (I'm at work)

ShadowWhisperer avatar May 05 '25 19:05 ShadowWhisperer

**Apps disabled by the end user may reinstall

That would be a very undesired side effect. Perhaps it would be better to then go through the keys and only delete those that don't have a typical package name pattern.

ltguillaume avatar May 05 '25 20:05 ltguillaume

Updated to delete keys that do not match pattern.

ShadowWhisperer avatar May 05 '25 21:05 ShadowWhisperer

@madsl Did the latest update to this tool fix your Windows Update loop?

ShadowWhisperer avatar May 24 '25 17:05 ShadowWhisperer

For me personally, I have no use for it anymore, since Edge can now be uninstalled in an official way. I have not tried to use it since fixing the registry issues.

I'm not sure why people would still want to use it, other than cleaning up a few registry keys. Unless they also want to remove WebView.

ltguillaume avatar May 24 '25 17:05 ltguillaume

@ShadowWhisperer have you updated the batch files?

To be honest I don't get why you distribute the .exe files at all - why not focus on batch/powershell? Who actually wants to run a random .exe from github with no insight over what it is doing?

madsl avatar Jun 16 '25 09:06 madsl

It is now.

Based on the Github traffic - Little over 5K on the .exe file and almost 200 on the .bat files.

That is why there are options / source is there with instruction on how to build from source

ShadowWhisperer avatar Jun 16 '25 12:06 ShadowWhisperer