From 39fbadcc9e0969b0a4f3e14801eb7dfe4ed069b4 Mon Sep 17 00:00:00 2001 From: undergroundwires <git@undergroundwires.dev> Date: Tue, 3 Oct 2023 13:02:54 +0200 Subject: [PATCH] win: fix Microsoft Advertising app removal $200 This commit fixes the issue where the Microsoft Advertising app fails to be removed using the standard script. The problem is due to Microsoft Advertising SDK (`Microsoft.Advertising.Xaml`) acting as a framework package. Such packages are automatically installed when a specific application requires them, and they cannot be individually removed if there are applications that depend on them. The only way to effectively remove this library is by uninstalling the dependent applications. Based on findings: - On Windows 11 22H2, the issue does not arise as the package does not exist. - On Windows 10 22H2, the user is prompted to delete dependent applications, like MSN Weather and Mail And Calendar apps. Once these apps are removed, the Microsoft Advertising app is automatically removed. Given the nuances and potential for confusion, this script is removed. This means that the app will no longer be removed directly but will be handled as part of the removal of its dependencies. --- src/application/collections/windows.yaml | 43 +++++++++++++----------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/application/collections/windows.yaml b/src/application/collections/windows.yaml index 4e5cd4cc2..f29184943 100644 --- a/src/application/collections/windows.yaml +++ b/src/application/collections/windows.yaml @@ -6419,17 +6419,31 @@ actions: Windows apps were introduced with Windows 8 and are typically acquired and installed through the Store app [1]. Many of these apps come pre-installed on Windows by default [1]. + This category does not target framework apps. Framework apps are packages that get installed automatically if another application requires them [2]. If there are + applications depending on these framework packages, you cannot delete the framework app individually [2]. However, if you remove those dependent applications, the + associated framework package will be deleted [3]. To list all framework apps, you can use the following command: + `Get-AppxPackage | Where-Object { $_.IsFramework -eq $true } | Select-Object -ExpandProperty Name`. + Uninstalling unused or unwanted apps contributes to privacy by reducing potential data collection points and minimizing your digital footprint. [1]: https://web.archive.org/web/20210727081048/https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10 "Windows 10 - Apps - Windows Application Management | Microsoft Docs" + [2]: https://web.archive.org/web/20231003110200/https://learn.microsoft.com/en-us/windows/uwp/monetize/install-the-microsoft-advertising-libraries "Install the Microsoft Advertising SDK - Microsoft Store | Microsoft Learn" + [3]: https://github.com/undergroundwires/privacy.sexy/issues/200 "[BUG]: Microsoft Advertising app removal failure · Issue #200 · undergroundwires/privacy.sexy" children: - # Good information for development: - # - Find out package name from store ID: https://learn.microsoft.com/en-us/mem/configmgr/protect/deploy-use/find-a-pfn-for-per-app-vpn - # Excluded apps: - # - Microsoft.Windows.ShellExperienceHost - # "Start app", required for different setting windows such as WiFi and battery panes in action bar. - # - Windows.immersivecontrolpanel - # "Settings app", required for settings view. + # Good information for development: + # - Find out package name from store ID: https://learn.microsoft.com/en-us/mem/configmgr/protect/deploy-use/find-a-pfn-for-per-app-vpn + # Excluded apps: + # - Microsoft.Windows.ShellExperienceHost + # "Start app", required for different setting windows such as WiFi and battery panes in action bar. + # - Windows.immersivecontrolpanel + # "Settings app", required for settings view. + # - Exclude framework apps: + # List out framework packages: + # Get-AppxPackage | Where-Object { $_.IsFramework -eq $true } | Select-Object -ExpandProperty Name + # Windows 11 (22H2) : Microsoft.UI.Xaml.CBS, Microsoft.NET.Native.Framework.2.2, Microsoft.NET.Native.Runtime.2.2, Microsoft.VCLibs.140.00.UWPDesktop + # Microsoft.UI.Xaml.2.7, Microsoft.VCLibs.140.00, Microsoft.WindowsAppRuntime.1.2, Microsoft.UI.Xaml.2.4 + # Windows 10 (22H2) : Microsoft.VCLibs.140.00.UWPDesktop, Microsoft.NET.Native.Framework.2.2, Microsoft.NET.Native.Runtime.2.2, Microsoft.VCLibs.140.00 + # Microsoft.UI.Xaml.2.0, Microsoft.Advertising.Xaml, Microsoft.NET.Native.Framework.1.7, Microsoft.NET.Native.Runtime.1.7 - category: Remove provisioned Windows apps docs: |- @@ -7496,19 +7510,6 @@ actions: [1]: https://web.archive.org/web/20210727081048/https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10 "Windows 10 - Apps - Windows Application Management | Microsoft Docs" children: - - - name: Remove "Microsoft Advertising" app - recommend: standard - docs: |- - - [More about Microsoft Advertising SDK](https://web.archive.org/web/20231003190154/https://learn.microsoft.com/en-us/windows/uwp/monetize/install-the-microsoft-advertising-libraries) - - [News about Microsoft shutting down Microsoft Ad Monetization](https://web.archive.org/web/20231003190159/https://social.msdn.microsoft.com/Forums/windowsapps/en-US/db8d44cb-1381-47f7-94d3-c6ded3fea36f/microsoft-ad-monetization-platform-shut-down-as-of-june-1st?forum=aiamgr) - call: - function: UninstallStoreApp - parameters: - # Existence : Windows 10 (≥ 22H2): ❌ Missing | Windows 11 (≥ 22H2): ❌ Missing - # More info : Get-AppxPackage Microsoft.Advertising.Xaml - packageName: Microsoft.Advertising.Xaml - publisherId: 8wekyb3d8bbwe - name: Remove "Microsoft Remote Desktop" app docs: |- @@ -7519,6 +7520,8 @@ actions: This app comes pre-installed on certain versions of Windows [1]. [1]: https://web.archive.org/web/20210727081048/https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10 "Windows 10 - Apps - Windows Application Management | Microsoft Docs" + name: Remote Desktop app + docs: https://www.microsoft.com/en-us/p/microsoft-remote-desktop/9wzdncrfj3ps?activetab=pivot:overviewtab call: function: UninstallStoreApp parameters: