Skip to content

Commit

Permalink
Fix logic to determine whether an app is a system app
Browse files Browse the repository at this point in the history
Checking the path is not reliable since %WINDIR% can be
"C:\WINDOWS" instead of "C:\Windows" on some systems
  • Loading branch information
Fs00 committed Jul 29, 2023
1 parent 51d0801 commit 1051e15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Utils/AppxRemover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ private Result PerformAppsRemoval(string[] appNames, RemovalMethod removalMethod

private static bool IsSystemApp(Package package)
{
string systemAppsFolder = $@"{Environment.GetFolderPath(Environment.SpecialFolder.Windows)}\SystemApps";
return package.InstalledPath.StartsWith(systemAppsFolder);
return package.SignatureKind == PackageSignatureKind.System;
}

private abstract class RemovalMethod
Expand Down

0 comments on commit 1051e15

Please # to comment.