Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Remove system apps" breaks windows commulative updates #287

Closed
zdat opened this issue Nov 16, 2023 · 7 comments
Closed

"Remove system apps" breaks windows commulative updates #287

zdat opened this issue Nov 16, 2023 · 7 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@zdat
Copy link

zdat commented Nov 16, 2023

Remove bloatware > Remove Windows apps > Remove system apps... any one of these breaks Windows (commulative) updates.

This wasn't the case for 0.12.5(?) so I'm wondering which part each of these options has in common that breaks installing Windows commulative updates.

I can add that specific part to my "fix"/revert scripts. I'd rather not revert every single "Remove system apps" option every time I want to install a commulative update.

Can anyone help? Thanks.

@zdat zdat added the enhancement New feature or request label Nov 16, 2023
@undergroundwires
Copy link
Owner

undergroundwires commented Nov 17, 2023

Hi @zdat, here's the new logic added since that version (introduced by #260):

  • Completely removal of appx-package Remove-AppPackage
  • Deprovisioning it using reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\{{ AppName}} " /f
  • Set it as end-of-life reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\$($sid)\$($packageFamilyName)" /f (I highly suspect this one)

This must be a side-effect of one these.

Testing updates is so hard for me, so I rely on community support for this.

Two potential ways to debug this:

  1. Checking update logs to see if it states why it fails.
  2. Once experiencing this, instead of running the complete revert script, we can comment out/remove the lines that are fixing the keys (EndOfLife and Deprovisioned) and try again (i.e. run. If updates fail then we know that this caused by Remove-AppPackage, if they do not fail we verify that it's one of these keys, the next step would be the running key revert codes one by one to see which one is running this.

The line setting Deprovisioned key:

image

The line setting EndOfLife key:

image

@hafeoz
Copy link

hafeoz commented Nov 20, 2023

Can confirm commenting out EndOfLife fixes the issue.

@undergroundwires
Copy link
Owner

Thank you for the information @hafeoz.
I will fix this in a few days and release a patch for it.

@tempdrive
Copy link

Just a heads-up, hope this will help: the deployment of Edge has been made more strict recently to the point where updates are being rolled back if the deployment fails.
There wasn't anything specific mentioned here that would be explicit enough to conclude the origin of the issue, so I assume the whole EndOfLife code was skipped (for all of the apps), however, focusing only on this app (Edge) with regards to disabling changes made by your app might be sufficient.
The deployment of Edge is handled individually (EdgeAI.dll from Servicing Stack Update) from what I can tell, so hopefully other parts of the code can be left enabled having this in mind.

undergroundwires added a commit that referenced this issue Nov 24, 2023
This commit fixes an issue where removing systems apps could disrupt
Windows Cumulative updates as reported in #287.

The fix involves removing the `EndOfLife` registry key after the app is
removed. Keeping the key at
`HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife`
was identified as the cause for update failures in #287.

This commit also refactors the registry key creation/removal logic to be
owned by separate functions for easier readability and reusability.
@undergroundwires undergroundwires added the bug Something isn't working label Nov 24, 2023
@zdat
Copy link
Author

zdat commented Nov 25, 2023

I see there is a commit that fixes this issue.

What exactly should I do with this commit script to restore update functionality? I'm not sure what a commit is to be honest so I don't know if the script fixes the issue or it's something to be added later to the privacy.sexy next release or something.

@undergroundwires
Copy link
Owner

undergroundwires commented Nov 25, 2023

Hi, thank you for asking, I will released the fix version on Tuesday. However, it will not retroactively fix the issues but will not cause these issue in future.

I will update here once the release is there, then you can run remove system apps again, until then, do not run system app removal scripts. For those who's seeing this thread later, the issue will be fixed since v0.12.8 so you shouldn't worry about, but if you deleted apps using older versions (v0.12.7 or v0.12.6), keep reading.

Here's how you can fix the issue with updates (which seems to be caused by Microsoft refusing to do updates if it cannot install Edge):

  1. Open Command Prompt (Start Menu ➜ type "cmd" ➜ select "Command Prompt")

  2. Copy and paste the following command:

    PowerShell -ExecutionPolicy Unrestricted -Command "Remove-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\*' -Force -Verbose"
  3. Press Enter

@undergroundwires
Copy link
Owner

The fix is released (the EndOfLife key will no longer be left around by privacy.sexy) and instructions to fix your Windows (without reverting uninstallation of system apps) is documented in release notes, see 0.12.8 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants