ChrisTitusTech / winutil

Chris Titus Tech's Windows Utility - Install Programs, Tweaks, Fixes, and Updates
MIT License
20.88k stars 1.29k forks source link

Unable to Find Specified Registry Key/Value and OS Package Removal Failures #2607

Open catsmoker opened 2 weeks ago

catsmoker commented 2 weeks ago

Description:

During an automated process to remove specific Windows Expedited Apps and OS packages, multiple errors were encountered. The system was unable to find the specified registry keys/values for certain apps, and attempts to remove several OS packages failed.

Steps to Reproduce:

Run Microwin without selecting any of the following options:

OSCDimg (OSCDIM)
ScratchDir
Inject Drivers
Import Drivers
Copy to Ventoy

Observed Errors:

Registry Key/Value Errors:
    ERROR: The system was unable to find the specified registry key or value.
    This error occurred during attempts to remove the following apps:
        DevHomeUpdate
        OutlookUpdate
        CrossDeviceUpdate

OS Package Removal Errors:
    Could not remove OS package <Package_Name>
    The following OS packages could not be removed:
        Microsoft-Windows-FodMetadata-Package
        Microsoft-Windows-Foundation-Package
        Microsoft-Windows-MSPaint-FoD-Package (multiple variants)
        Microsoft-Windows-PowerShell-ISE-FOD-Package (multiple variants)
        Microsoft-Windows-Printing-PMCPPC-FoD-Package
        Microsoft-Windows-Printing-WFS-FoD-Package
        Microsoft-Windows-StepsRecorder-Package (multiple variants)
        Microsoft-Windows-WordPad-FoD-Package (multiple variants)
        Package_for_DotNetRollup
        Package_for_KB5015684
        Package_for_RollupFix

Expected Behavior:

The script should successfully remove the specified Windows Expedited Apps and OS packages without encountering registry key/value errors or package removal failures.

Actual Behavior:

The script fails to remove certain apps and OS packages, and errors are reported for missing registry keys/values.

Impact:

The inability to remove these components may leave unwanted software and packages on the system, potentially causing system clutter or conflicts with other software.

Possible Causes:

The registry keys/values for the targeted apps may not exist on the system.
The OS packages might be protected, already removed, or corrupted.

Environment:

Windows Version: Windows 10 Pro 64-bit URL: https://software.download.prss.microsoft.com/dbazure/Win10_22H2_EnglishInternational_x64v1.iso?t=c0e9eccc-7bf7-4df5-9de7-00471b8d2ada&P1=1724374930&P2=601&P3=2&P4=M1xkZ%2bN8wzryPUOgDF4vvUIexMqFjn%2bGiPkDEqXtBCO4Wk2ho2AHjYrIl%2bvvsdErYksNn0g4qiNOWx6FIu6QhtYfDLxansNgtLxfsCjDX8fl6VqTKoCKHdqYyf%2bJ2am1vCJPmwrg3vnSmZ0rLNsLDCEbIuxGdOhmtELbuO4ZXvBS1ObosZrK8Qr54h68VTd1dSusFae%2fyqydSiYOiBdu0GD2%2b1j7THjCFbsqEAc5uLk9o6hClptmJ5D9ud23OqRunmQAgnaEudWyNaTM8jJMWIeyBH7fLu%2fMllKdJ6D0UODRNkgO%2b6odzSgMUwlwujDk9qLzsrvetkGOzAEFqI9f9Q%3d%3d
Script Version: Release 24.08.16 
Script Tool: Microwin

Suggested Fixes:

Ensure that the registry keys/values exist before attempting to remove them.
CodingWonders commented 2 weeks ago

It's normal for some packages to throw errors when trying to remove them, as they are either permanent packages (like FodMetadata or the foundation package) or superseded by newer versions.

Now, the registry error doesn't prevent MicroWin processing from continuing. It means that there are no expedited apps to remove. A supposed fix was added in #2575 but caused file locks that prevented the image from being unmounted, so ISOs were double their size, and thus I removed that registry check in #2585