Jump to content

How to get rid of Candy Crush Soda Saga and other Windows 10 Start Menu junk for good!


Recommended Posts

Posted
I have put a lightly modified version below, that goes back to mounting the ISO like one of the previous versions, then dumping the .wim in the same folder when finished. Doesn't save that much time but may be handy.

Good idea! I was thinking of combining the two scripts but didn't have enough time before going to work this morning to actually do it. :)

Posted
@Chuckster (and @sparkeh, @eddyc). There is now. :)

 

As with the previous version use the one attached below with an untouched install.wim from a Windows 10 ISO.

 

Thanks @Arthur. I have put a lightly modified version below, that goes back to mounting the ISO like one of the previous versions, then dumping the .wim in the same folder when finished. Doesn't save that much time but may be handy.

 

 

Just checking I've got the right end of the stick: The script that @Arthur posted this morning runs against a wim - like the one I was using on the Anniversary edition (1607), but failed on the November update (1607_2).

 

The amended script that @3s-gtech posted works on an ISO - like the one @Arthur shared in March.

 

Thanks

Posted

@jmak. 100% correct.

 

When I get a bit of spare time I think I will create a combined version of the two scripts that works with a .wim or .iso. The best of both worlds! :)

  • Thanks 2
Posted

Just going through what I've done before and the old versions of the scripts. I noticed that you've left a couple more items in than first time around:

 

Microsoft.DesktopAppInstaller and Microsoft.StorePurchaseApp

 

I presume the first one is to do with the idea that in theory we might want to install a desktop app through the store? I was less sure about the second one - as far as I could see (Google as my source), the only function is to show the purchase history. Does it do something else or could I miss it out? The old script white listed Microsoft.Appconnector - is this safe to bin now?

Posted
I think those two can cause some potential breakage of the install and can be extremely tricky to fix if you suddenly start getting requests for Store apps (if the Store ever becomes worth using). As they don't cause much bother, they're left in to save future stress. We just Applocker the Store subsequently, but up to you.
Posted
id leave all the store related stuff as there is a gpo to force it to use the business store so at best they can see your curated list of apps don't give em a logon or have any approved apps they will see nothing anyway that way the stores there if you ever need it for anything but effectively neutered
Posted

Thought I would add what worked in for me.

 

I am deploying some Windows 10 Pro machines and the methods in this dont give the same results as what the orginal poster gets.

 

What I ended up having to do to disable store (as well as all of its apps) was apply a software restriciton policy.

 

Computer Config > Polocies > Windows Settings > Securtiy Settings > Software Restriciton Policies and in additonal rules folder create a new path rule to disallow the following:

 

%programfiles%\WindowsApps\Microsoft.*

 

You can of course use the app name you are looking to disable i.e. Microsoft.WindowsStore*

 

The "*" is the most important part as the text after this is the version number, without it as soon as a new update is installed fo rthat app it will be enabled again.

 

Apologiese if already stated already in this thread, I didnt read all 9 pages fully........

 

You will have to deploy a custom start menu XML via GPO however as everything still remains in there but cannot be run.

 

Hope it helps someone in future.

  • 2 weeks later...
Posted
@Chuckster (and @sparkeh, @eddyc). There is now. :)

 

As with the previous version use the one attached below with an untouched install.wim from a Windows 10 ISO.

 

Btw, if your Start Menu looks like this in the Creators Update, just reboot and it will be back to normal...

 

Deploying a custom start menu layout would also fix this.

 

YgaQ5M.png

 

This is what mine looks like! But a reboot doesnt change that! It still looks the same!

Posted
This is what mine looks like! But a reboot doesnt change that! It still looks the same!

I got the same, but I wonder if that's because I wasn't using a GPO for a custom startmenu layout. Anyway, I found a way around this and it involves just adding a single file to the .wim just before the powershell script saves the image.

 

The LayoutModification.xml, when placed in the folder - C:\Users\Default\AppData\Microsoft\Windows\Shell

has the result of creating a slimmer new user startmenu layout - I'm pretty sure it was quicker to login too!

 

Here's the file I used which just gives me three tiles (Explorer, Edge and Remote Desktop). Of course, you can customise this file for your environment...

 

LayoutModification.xml.txt

 

Edit: You'll need to rename the attached file back to .xml extension.

  • Thanks 1
  • 1 month later...
Posted

Could I just confirm something. If I strip out the apps during the deployment process using the powershell script, am I then going to be unable to run a sysprep and capture? Do the apps have to be stripped out of the original install.wim first?

 

Just don't want to waste time building an image to find I can't capture it!

Posted
Could I just confirm something. If I strip out the apps during the deployment process using the powershell script, am I then going to be unable to run a sysprep and capture? Do the apps have to be stripped out of the original install.wim first?

 

Just don't want to waste time building an image to find I can't capture it!

 

from my experience yes

 

if you want to remove apps and capture you have 2 choices

 

1 remove BEFORE deploying the vanilla image to your build vm (use dism to strip them out of the standard install.wim file)

 

2 scriot remove them when you actually deploy the image to the final machine

 

if you say install windows to a vm update install office strip apps then try to syspre & capture it always fails in my experience

  • Thanks 1
Posted (edited)

I keep to the guidance from the blog linked below, and don't have any problems.

https://4sysops.com/archives/windows-10-sysprep-was-not-able-to-validate-your-windows-installation/

 

Specifically this

Note that this discrepancy affects all user accounts that have been created on the machine. For instance, if you install a new app for one user and then run sysprep with another account, sysprep will fail. Likewise, if you removed provisioned apps but didn’t uninstall them for all users on the system, you will run into trouble.
Edited by ollyyllo
  • Thanks 1
Posted

OK, thanks @sted. I didn't actually consider your second option, that might work better for me by adding my script to the end of the deployment when pushing out the final image. It gives me some scope to adjust which apps I keep at a later date if I change my mind on anything.

 

Cheers

Posted
I keep to the guidance from the blog linked below, and don't have any problems.

https://4sysops.com/archives/windows-10-sysprep-was-not-able-to-validate-your-windows-installation/

 

 

Hmm actually, from reading that I should be able to run it during the script anyway, as long as it happens before anything logs on. Not sure which stage of the TS would be best for this?

Posted
Plus as there's a new version every 8 months change your workflow to install changes to a default installation via gpo/scripts, or write scripts to create a capture image automatically
  • 3 weeks later...
Posted (edited)

Deploying 1703 in the Summer, is the best way to remove the Xbox app etc, to mount the WIM and using DISM to install? Is this relatively straight forward?

 

I already have a custom .WIM I have made through a VM, captured and imported into MDT etc, it's just hiding the apps now

Edited by DB91
Posted
Deploying 1703 in the Summer, is the best way to remove the Xbox app etc, to mount the WIM and using DISM to install? Is this relatively straight forward?

 

I already have a custom .WIM I have made through a VM, captured and imported into MDT etc, it's just hiding the apps now

 

Possibly. With a new release every 8 months make sure you've scripted all changes to the base wim or you'll be bored of it in a couple of years.

  • 2 weeks later...
Posted
Thanks for this! This has been bugging me like crazy ever since Windows Update went ahead and updated me to Windows 10 :p Begone, saga of crushed candies!
  • 1 month later...
Posted
Thanks @Arthur. I have put a lightly modified version below, that goes back to mounting the ISO like one of the previous versions, then dumping the .wim in the same folder when finished. Doesn't save that much time but may be handy.

 

#Requires –Version 5.0
#Requires -RunAsAdministrator
#Requires –Modules Dism

<# This script is based upon Invoke-RemoveBuiltinApps.ps1
  https://github.com/NickolajA/PowerShell/blob/master/MDT/Reference%20Image/Invoke-RemoveBuiltinApps.ps1
  https://www.scconfigmgr.com/2016/03/01/remove-built-in-apps-when-creating-a-windows-10-reference-image/
#>

# Set script directory (due to a bug in psISE we can't use $PSScriptRoot on its own: https://goo.gl/h59In2)
$ScriptDir = $PSScriptRoot
Set-Location "$ScriptDir"

# Create mount folder if it doesn't exist
if (!(Test-Path -path "$ScriptDir\Mount")) {
New-Item "$ScriptDir\Mount" -Type Directory -Force | Out-Null
}

# Whitelist of AppX packages to keep installed
$WhiteListedApps = @(
   'Microsoft.DesktopAppInstaller',
   'Microsoft.MicrosoftStickyNotes',
   'Microsoft.MSPaint',
   'Microsoft.StorePurchaseApp',
   'Microsoft.Windows.Photos',
   'Microsoft.WindowsCalculator',
   'Microsoft.WindowsStore',
   'Microsoft.WindowsCamera'
)
$ISO = "$ScriptDir\SW_DVD5_WIN_EDU_10_1703_64BIT_Eng_Intl_MLF_X21-36556.iso"

#region Mount ISO
Mount-DiskImage -ImagePath $ISO
$ISODrive = "{0}{1}" -f [string](Get-DiskImage -ImagePath $ISO | Get-Volume).DriveLetter, ':'
#endregion


#region Extract WIM
Write-Output -InputObject "Extracting WIM from ISO`n"
$ImageName = (Get-WindowsImage -ImagePath "$ISODrive\Sources\install.wim" -Index 1).ImageName
$Image = "{0} - {1}{2}" -f $ImageName,(Get-Date -format "yyyy.MM.dd"),'.wim'
Remove-Item "$ScriptDir\$Image" -ErrorAction SilentlyContinue
Export-WindowsImage -SourceImagePath "$ISODrive\Sources\install.wim" -SourceName $ImageName -DestinationImagePath $Image -CompressionType max -ErrorAction Stop | Out-Null
#endregion

#region Remove built-in apps from all .wim image indexes
Get-WindowsImage -ImagePath "$ScriptDir\$Image" -ErrorAction Stop | ForEach-Object {

   # Mount image(s)
   "{0} {1} {2}" -f "Mounting image", $($_.ImageIndex), "`n"
   Mount-WindowsImage -Path "$ScriptDir\Mount" -ErrorAction Stop -Index $_.ImageIndex -ImagePath $_.ImagePath | Out-Null

   # Get a list of all apps
   $AppArrayList = Get-AppxProvisionedPackage -Path "$ScriptDir\Mount" | Select-Object -Property DisplayName,PackageName | Sort-Object -Property DisplayName

   # Loop through the list of apps
   ForEach ($App in $AppArrayList) {

       # Exclude whitelisted apps
       if (($App.DisplayName -in $WhiteListedApps)) {
           Write-Output -InputObject "Skipping: $($App.DisplayName)"
       }
       else {
       # Remove remaining apps

           # Gather package names
           $AppProvisioningPackageName = Get-AppxProvisionedPackage -Path "$ScriptDir\Mount" | Where-Object { $_.DisplayName -like $App.DisplayName } | Select-Object -ExpandProperty PackageName

           # Attempt to remove AppxProvisioningPackage
           if ($AppProvisioningPackageName -ne $null) {
               try {
                   Write-Output -InputObject "Removing: $($App.DisplayName)"
                   Remove-AppxProvisionedPackage -PackageName $AppProvisioningPackageName -Path "$ScriptDir\Mount" -ErrorAction Stop | Out-Null
               }
               catch [system.Exception] {
                   Write-Warning -Message $_.Exception.Message
               }
           }
       } # Else
   } # ForEach


   # White list of Features On Demand V2 packages
   Write-Output -InputObject "`nStarting Features on Demand V2 removal`n"

   <#  To remove Internet Explorer and Windows Media Player use the following whitelist variable:
   $WhiteListOnDemand = "NetFX3|Tools.Graphics.DirectX|Tools.DeveloperMode.Core|Language" #>
   $WhiteListOnDemand = "NetFX3|Tools.Graphics.DirectX|Tools.DeveloperMode.Core|Language|Browser.InternetExplorer|Media.WindowsMediaPlayer"

   # Get Features On Demand that should be removed
   $OnDemandFeatures = Get-WindowsCapability -Path "$ScriptDir\Mount" | Where-Object { $_.Name -notmatch $WhiteListOnDemand -and $_.State -like "Installed" } | Select-Object -ExpandProperty Name

   foreach ($Feature in $OnDemandFeatures) {
       try {
           Write-Output -InputObject "Removing: $($Feature)"
           Get-WindowsCapability -Path "$ScriptDir\Mount" -ErrorAction Stop | Where-Object { $_.Name -like $Feature } | Remove-WindowsCapability -Path "$ScriptDir\Mount" -ErrorAction Stop | Out-Null
       }
       catch [system.Exception] {
           Write-Warning -Message $_.Exception.Message
       }
   }


   #region Customise Default User Profile and HKLM\SOFTWARE hive (Optional)
   # Many of these settings can be managed through Group Policy instead. Google the registry values to find out what they do.
   Write-Output -InputObject "`nCustomising the default user profile and HKLM\SOFTWARE hive`n"
   REG LOAD "HKLM\_USER" "$ScriptDir\Mount\Users\Default\NTUSER.DAT" | Out-Null
   REG LOAD "HKLM\_SOFTWARE" "$ScriptDir\Mount\Windows\System32\config\SOFTWARE" | Out-Null

   & REG ADD "HKLM\_SOFTWARE\Policies\Microsoft\MRT" /v DontOfferThroughWUAU /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v DisableSoftLanding /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v DisableWindowsConsumerFeatures /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoLockscreen /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SystemPaneSuggestionsEnabled /d 0 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisableThumbnailCache /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /d 0 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v StartupDelayInMSec /d 0 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Search" /v BingSearchEnabled /d 0 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions" /v NoHelpItemSendFeedback /d 1 /t REG_DWORD /f
   & REG ADD "HKLM\_USER\Software\Policies\Microsoft\Windows\Explorer" /v NoPinningStoreToTaskbar /d 1 /t REG_DWORD /f
   & REG DELETE "HKLM\_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f

   REG UNLOAD "HKLM\_USER" | Out-Null
   REG UNLOAD "HKLM\_SOFTWARE" | Out-Null
   #endregion

   "{0} {1}" -f "Unmounting image", $($_.ImageIndex)
   Get-WindowsImage -Mounted | Dismount-WindowsImage -Save -ErrorAction Stop | Out-Null
} #endregion

 

 

After a break I'm back on the Windows 10 image build!

 

Just to confirm I just need to:

download the latest ISO - currently "SW_DVD9_WIN_EDU_10_1703.1_64BIT_English_MLF_X21-47826.ISO"

copy this to a Windows 10 PC and run the above script

 

It seems too easy!

Posted
Make sure you download the "English International" latest ISO. Then go to your Windows 10 PC to update the wim using the scripts, making sure you download the latest CU, FP etc to roll into it at the same time. Otherwise, the script does make it pretty easy - run it as admin though!
Posted
Make sure you download the "English International" latest ISO. Then go to your Windows 10 PC to update the wim using the scripts, making sure you download the latest CU, FP etc to roll into it at the same time. Otherwise, the script does make it pretty easy - run it as admin though!

 

Thanks, do I need to edit anything in the script before running?

Posted
Yes. You'll need to change the list of apps to whitelist depending on what you want (I kept some that the original did not). You also need to change the ISO name if appropriate, and make sure you're running the script from the correct location ($PSScriptRoot) so that it can find the files.
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...