[RESOLVED] Proposal for a new uninstallation package for Windows 10 Appx

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
jeancharles
Messages: 21
Registration: June 11, 2019 - 10:02

October 14, 2019 - 1:32 PM

Good morning,

I'm currently deploying Windows 10 1903 and, like many others, I want to remove unnecessary applications. I wanted to suggest adding this script to your repository or the fourmisduweb repository:

Code: Select all

https://github.com/SCConfigMgr/ConfigMgr/blob/master/Operating%20System%20Deployment/Invoke-RemoveBuiltinApps.ps1
This script will allow you to clean up "non-essential" applications from Windows 10.
This configuration setting can also be used to disable the "consumer" view with Candy Crush

Code: Select all

https://www.windowsmanagementexperts.com/disabling-windows-10-consumer-experience/disabling-windows-10-consumer-experience.htm
What do you think of the validity of this idea, and if not here, where should this message be placed?

Thank you and have a good day :) ,
Last edited by jeancharles on Oct 15, 2019 - 11:31, edited 1 time.
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

October 14, 2019 - 2:07 PM

I don't remember if it's available at TIS, but this one works perfectly:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import subprocess
import json

uninstallkey = []

apps = [
    ## default Windows 10 apps
    'Microsoft.3DBuilder',
    'Microsoft.Print3D',
    'Microsoft.Microsoft3DViewer',
    'Microsoft.MixedReality.Portal',
    'Microsoft.YourPhone',
    'Microsoft.WindowsFeedbackHub',
    #'Microsoft.Appconnector',
    'Microsoft.BingFinance',
    'Microsoft.BingNews',
    'Microsoft.BingSports',
    'Microsoft.BingWeather',
    #'Microsoft.FreshPaint',
    'Microsoft.Getstarted',
    'Microsoft.MicrosoftOfficeHub',
    'Microsoft.MicrosoftSolitaireCollection',
    #'Microsoft.MicrosoftStickyNotes',
    #'Microsoft.Office.OneNote',
    'Microsoft.OneConnect',
    'Microsoft.People',
    'Microsoft.SkypeApp',
    #'Microsoft.Windows.Photos',
    'Microsoft.WindowsAlarms',
    #'Microsoft.WindowsCalculator',
    #'Microsoft.WindowsCamera',
    'Microsoft.WindowsMaps',
    'Microsoft.WindowsPhone',
    'Microsoft.WindowsSoundRecorder',
    #'Microsoft.WindowsStore',
    'Microsoft.XboxApp',
    'Microsoft.ZuneMusic',
    'Microsoft.ZuneVideo',
    'microsoft.windowscommunicationsapps',
    'Microsoft.MinecraftUWP',
    'Microsoft.MixedReality.Portal'
    #'Microsoft.ScreenSketch'

    ## Threshold 2 apps
    'Microsoft.CommsPhone',
    #'Microsoft.ConnectivityStore',
    'Microsoft.Messaging',
    #'Microsoft.Office.Sway',


    ##Redstone apps
    'Microsoft.BingFoodAndDrink',
    'Microsoft.BingTravel',
    'Microsoft.BingHealthAndFitness',
    'Microsoft.WindowsReadingList',

    ## non-Microsoft
    '9E2F88E3.Twitter',
    'Flipboard.Flipboard',
    'ShazamEntertainmentLtd.Shazam',
    'king.com.CandyCrushSaga',
    'king.com.CandyCrushSodaSaga',
    'king.com.*',
    'ClearChannelRadioDigital.iHeartRadio',
    '4DF9E0F8.Netflix',
    '6Wunderkinder.Wunderlist',
    'Drawboard.DrawboardPDF',
    '2FE3CB00.PicsArt-PhotoStudio',
    'D52A8D61.FarmVille2CountryEscape',
    'TuneIn.TuneInRadio',
    'TheNewYorkTimes.NYTCrossword',
    'king.com.CandyCrushSag',
    'king.com.CandyCrushSodaSaga',
    '828B5831.HiddenCityMysteryofShadow',
    'Microsoft.Advertising.Xaml',

    ## apps which cannot be removed using Remove-AppxPackage
    #'Microsoft.BioEnrollment',
    #'Microsoft.MicrosoftEdge',
    'Microsoft.Windows.Cortana',
    #'Microsoft.WindowsFeedback',
    'Microsoft.XboxGameCallableUI',
    'Microsoft.XboxIdentityProvider',
    'Windows.ContactSupport',
    ]


def install():
    print(u'Starting the debloating process...')
    removed = []
    for app in apps:
        print(u"Trying to remove %s"%app)
        result = run_powershell("""\
            Get-AppxPackage -Name %s -AllUsers | Remove-AppxPackage""" % app)
        if result:
            removed.append(app)
        print run_powershell("""\
            Get-AppXProvisionedPackage -Online |
            where DisplayName -EQ %s |
            Remove-AppxProvisionedPackage -Online""" % app)
    old_removed = json.loads(WAPT.read_param(control.package,'[]'))
    print(u'Previously removed by wapt :\n%s' % ('\n'.join(old_removed),))



##    old_removed.extend(removed)
##    WAPT.write_param(control.package,old_removed)

    print(u'Remaining metro apps ;) : ')
##    print u'\n'.join(sorted(u'"%(Name)s", # (%(Version)s)",' % app for app in run_powershell('Get-AppxPackage -AllUsers')))

def uninstall():
    old_removed = json.loads(WAPT.read_param(control.package,'[]'))
    print(u'Previously removed by wapt :\n%s' % ('\n'.join(old_removed),))
    for app in old_removed:
        result = run_powershell('Get-AppxPackage -Name %(app)s -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}' % locals())
        print result
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

October 15, 2019 - 11:10

Hello,
a suggestion if I may: if the structure allows, set up an MDT with the script.
Combined with WAPT, you practically have an SCCM. ;)
jeancharles
Messages: 21
Registration: June 11, 2019 - 10:02

October 15, 2019 - 11:30

Thanks, that looks pretty good, I'll test it. I liked this script; it was up-to-date for version 1903 with only the applications to keep.

Thanks for MDT too. While browsing the packages, I also saw FOG, which looks good:
https://wiki.fogproject.org/wiki/index. ... =Main_Page.


Otherwise, where can we suggest packages, list tips, or find alternative repositories?

I created a fairly simple Citrix Receiver 4.9.8000 LTSR package, for example:

`install_exe_if_needed("CitrixReceiver-4.9.8000.exe",'/SILENT /includeSSON /AutoUpdateCheck=disabled /EnableCEIP=False',key='CitrixOnlinePluginPackWeb')`.

For my PowerShell script that uninstalls unnecessary applications, here's how to run it as a batch file without modifying the PowerShell policy:
`cd %~dp0
powershell -NoProfile -ExecutionPolicy bypass -command "& '.\Invoke-RemoveBuiltinApps.ps1'"`.


Thank you for this great tool and thank you to the community. :)
jlatieule
Messages: 59
Registration: July 3, 2019 - 9:18 AM

December 28, 2020 - 5:18 PM

This script is very nice, but I don't understand one of the lines that uses JSON

Does this update the control file? Or is something else generated?

Mathieu wrote: Oct 14, 2019 - 2:07 PM I don't remember if it's available at TIS, but this one works perfectly:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
import subprocess
import json

uninstallkey = []

apps = [
    ## default Windows 10 apps
    'Microsoft.3DBuilder',
    'Microsoft.Print3D',
    'Microsoft.Microsoft3DViewer',
    'Microsoft.MixedReality.Portal',
    'Microsoft.YourPhone',
    'Microsoft.WindowsFeedbackHub',
    #'Microsoft.Appconnector',
    'Microsoft.BingFinance',
    'Microsoft.BingNews',
    'Microsoft.BingSports',
    'Microsoft.BingWeather',
    #'Microsoft.FreshPaint',
    'Microsoft.Getstarted',
    'Microsoft.MicrosoftOfficeHub',
    'Microsoft.MicrosoftSolitaireCollection',
    #'Microsoft.MicrosoftStickyNotes',
    #'Microsoft.Office.OneNote',
    'Microsoft.OneConnect',
    'Microsoft.People',
    'Microsoft.SkypeApp',
    #'Microsoft.Windows.Photos',
    'Microsoft.WindowsAlarms',
    #'Microsoft.WindowsCalculator',
    #'Microsoft.WindowsCamera',
    'Microsoft.WindowsMaps',
    'Microsoft.WindowsPhone',
    'Microsoft.WindowsSoundRecorder',
    #'Microsoft.WindowsStore',
    'Microsoft.XboxApp',
    'Microsoft.ZuneMusic',
    'Microsoft.ZuneVideo',
    'microsoft.windowscommunicationsapps',
    'Microsoft.MinecraftUWP',
    'Microsoft.MixedReality.Portal'
    #'Microsoft.ScreenSketch'

    ## Threshold 2 apps
    'Microsoft.CommsPhone',
    #'Microsoft.ConnectivityStore',
    'Microsoft.Messaging',
    #'Microsoft.Office.Sway',


    ##Redstone apps
    'Microsoft.BingFoodAndDrink',
    'Microsoft.BingTravel',
    'Microsoft.BingHealthAndFitness',
    'Microsoft.WindowsReadingList',

    ## non-Microsoft
    '9E2F88E3.Twitter',
    'Flipboard.Flipboard',
    'ShazamEntertainmentLtd.Shazam',
    'king.com.CandyCrushSaga',
    'king.com.CandyCrushSodaSaga',
    'king.com.*',
    'ClearChannelRadioDigital.iHeartRadio',
    '4DF9E0F8.Netflix',
    '6Wunderkinder.Wunderlist',
    'Drawboard.DrawboardPDF',
    '2FE3CB00.PicsArt-PhotoStudio',
    'D52A8D61.FarmVille2CountryEscape',
    'TuneIn.TuneInRadio',
    'TheNewYorkTimes.NYTCrossword',
    'king.com.CandyCrushSag',
    'king.com.CandyCrushSodaSaga',
    '828B5831.HiddenCityMysteryofShadow',
    'Microsoft.Advertising.Xaml',

    ## apps which cannot be removed using Remove-AppxPackage
    #'Microsoft.BioEnrollment',
    #'Microsoft.MicrosoftEdge',
    'Microsoft.Windows.Cortana',
    #'Microsoft.WindowsFeedback',
    'Microsoft.XboxGameCallableUI',
    'Microsoft.XboxIdentityProvider',
    'Windows.ContactSupport',
    ]


def install():
    print(u'Starting the debloating process...')
    removed = []
    for app in apps:
        print(u"Trying to remove %s"%app)
        result = run_powershell("""\
            Get-AppxPackage -Name %s -AllUsers | Remove-AppxPackage""" % app)
        if result:
            removed.append(app)
        print run_powershell("""\
            Get-AppXProvisionedPackage -Online |
            where DisplayName -EQ %s |
            Remove-AppxProvisionedPackage -Online""" % app)
    old_removed = json.loads(WAPT.read_param(control.package,'[]'))
    print(u'Previously removed by wapt :\n%s' % ('\n'.join(old_removed),))



##    old_removed.extend(removed)
##    WAPT.write_param(control.package,old_removed)

    print(u'Remaining metro apps ;) : ')
##    print u'\n'.join(sorted(u'"%(Name)s", # (%(Version)s)",' % app for app in run_powershell('Get-AppxPackage -AllUsers')))

def uninstall():
    old_removed = json.loads(WAPT.read_param(control.package,'[]'))
    print(u'Previously removed by wapt :\n%s' % ('\n'.join(old_removed),))
    for app in old_removed:
        result = run_powershell('Get-AppxPackage -Name %(app)s -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}' % locals())
        print result
System and Network Administrator at Domitia Habitat
User avatar
jpele
Messages: 156
Registration: March 4, 2019 - 12:01
Location: Nantes

January 4, 2021 - 11:19

Hello everyone,

The package in question is already available on the Store:

https://store.wapt.fr/store/tis-remove-windows-appx

Feel free to suggest improvements.

Sincerely,
Jimmy
Locked