Disassembler0 / Win10-Initial-Setup-Script

PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
MIT License
4.7k stars 1.08k forks source link

Start Menu Settings #145

Closed LiBOSS-CZ closed 5 years ago

LiBOSS-CZ commented 6 years ago

Hello, at first. Respect for this script.

I have problem with reminding start menu settings after installing 1809 version. I am suspecting problems in bloatware removing. I run the script and after restarting/shutting down (sometimes several times) or installing of new app, Start menu settings is restored. Installed apps are marked as new and recently added apps setting is enabled. I am trying to find out which setting is causing this problem.

I am running actual script version 3.1 from 04.10.2018.

My preset is attached.

Win10-my.preset.txt

SCVoldo commented 6 years ago

I'm experiencing the same problem.

Disassembler0 commented 6 years ago

Do you both have a fresh installation on 1809 or was it upgraded from older build?

I suspect it's still the same issue as in #101.

Tl;dr: Once the online provisioning process starts (after first login with internet connection), it needs to finish in order for the bloatware removal tweaks to be effective.

The tweaks related to this are DisableAppSuggestions to stop influx of new bloatware, DisableBackgroundApps to stop Store in updatating already provisioned apps, and UninstallMsftBloat +UninstallThirdPartyBloat which will uninstall the apps once the provisioning process finishes.

I'll check it once more on fresh installation, but I'm almost sure that you are too fast and trying to run the tweaks when the provisioning is still running.

SCVoldo commented 6 years ago

Yes, I have a fresh install of 1809.

LiBOSS-CZ commented 6 years ago

I have both. Fresh on one laptop and vmware and update on another laptop.

MariuzM commented 6 years ago

Yep having the same issue, after Restart of Logoff Icons come back and settings reset. For example it start showing recent installed items but when checking in settings that option is not turned on

MariuzM commented 6 years ago

You might be right about provisioning, right now tested with fresh win and done all updates and app updates then installed tweak for now no issues. will try couple of times and let you know

LiBOSS-CZ commented 6 years ago

I have tried it on completely fresh install of 1809. Do all updates, wait until everything is deployed (leave PC about hour and half) + severel restarts and with same problem. I have also tried to not run your suggested 4 tweaks with same problem (+ Application Tweaks are completely disabled) . So it has to be something else. I have also noticed, that this problem occured after running Windows for a longer time and restart after that. If you start windows up and restart right after logging on. Everything is OK. Win10-my.preset.txt

MariuzM commented 6 years ago

I have tried it on completely fresh install of 1809. Do all updates, wait until everything is deployed (leave PC about hour and half) + severel restarts and with same problem. I have also tried to not run your suggested 4 tweaks with same problem (+ Application Tweaks are completely disabled) . So it has to be something else. I have also noticed, that this problem occured after running Windows for a longer time and restart after that. If you start windows up and restart right after logging on. Everything is OK. Win10-my.preset.txt

Same for me

MariuzM commented 6 years ago

Still had issue with these settings

### Privacy Tweaks ###
DisableTelemetry                # EnableTelemetry
DisableWiFiSense                # EnableWiFiSense
# DisableSmartScreen            # EnableSmartScreen
DisableWebSearch                # EnableWebSearch
DisableAppSuggestions           # EnableAppSuggestions
DisableActivityHistory          # EnableActivityHistory
DisableBackgroundApps           # EnableBackgroundApps
DisableLocationTracking         # EnableLocationTracking
DisableMapUpdates               # EnableMapUpdates
DisableFeedback                 # EnableFeedback
DisableTailoredExperiences      # EnableTailoredExperiences
DisableAdvertisingID            # EnableAdvertisingID
DisableWebLangList              # EnableWebLangList
DisableCortana                  # EnableCortana
DisableErrorReporting           # EnableErrorReporting
# SetP2PUpdateLocal             # SetP2PUpdateInternet          # SetP2PUpdateDisable
DisableDiagTrack                # EnableDiagTrack
DisableWAPPush                  # EnableWAPPush
# HideRecentJumplists           # ShowRecentJumplists

### Security Tweaks ###
# SetUACLow                     # SetUACHigh
# EnableSharingMappedDrives     # DisableSharingMappedDrives
DisableAdminShares              # EnableAdminShares
# DisableSMB1                   # EnableSMB1
# DisableSMBServer              # EnableSMBServer
# DisableLLMNR                  # EnableLLMNR
# DisableNCSIProbe              # EnableNCSIProbe
SetCurrentNetworkPrivate        # SetCurrentNetworkPublic
# SetUnknownNetworksPrivate     # SetUnknownNetworksPublic
# DisableNetDevicesAutoInst     # EnableNetDevicesAutoInst
# DisableFirewall               # EnableFirewall
# DisableDefender               # EnableDefender
# DisableDefenderCloud          # EnableDefenderCloud
# EnableCtrldFolderAccess       # DisableCtrldFolderAccess
# EnableCIMemoryIntegrity       # DisableCIMemoryIntegrity
# EnableDefenderAppGuard        # DisableDefenderAppGuard
HideAccountProtectionWarn       # ShowAccountProtectionWarn
# DisableDownloadBlocking       # EnableDownloadBlocking
DisableScriptHost               # EnableScriptHost
EnableDotNetStrongCrypto        # DisableDotNetStrongCrypto
# EnableMeltdownCompatFlag      # DisableMeltdownCompatFlag
EnableF8BootMenu                # DisableF8BootMenu
# DisableBootRecovery           # EnableBootRecovery
# DisableRecoveryAndReset       # EnableRecoveryAndReset
SetDEPOptOut                    # SetDEPOptIn

### Service Tweaks ###
# DisableUpdateMSRT             # EnableUpdateMSRT
# DisableUpdateDriver           # EnableUpdateDriver
DisableUpdateRestart            # EnableUpdateRestart
# DisableHomeGroups             # EnableHomeGroups
DisableSharedExperiences        # EnableSharedExperiences
DisableRemoteAssistance         # EnableRemoteAssistance
# EnableRemoteDesktop             # DisableRemoteDesktop
DisableAutoplay                 # EnableAutoplay
DisableAutorun                  # EnableAutorun
# DisableRestorePoints          # EnableRestorePoints
# EnableStorageSense            # DisableStorageSense
# DisableDefragmentation        # EnableDefragmentation
DisableSuperfetch             # EnableSuperfetch
DisableIndexing               # EnableIndexing
# DisableNTFSLastAccess         # EnableNTFSLastAccess
# SetBIOSTimeUTC                # SetBIOSTimeLocal
# EnableHibernation             # DisableHibernation
# DisableSleepButton            # EnableSleepButton
# DisableSleepTimeout           # EnableSleepTimeout
# DisableFastStartup            # EnableFastStartup
# DisableAutoRebootOnCrash      # EnableAutoRebootOnCrash

### Unpinning ###
UnpinStartMenuTiles
# UnpinTaskbarIcons
Disassembler0 commented 6 years ago

Alright, I'm able to replicate it with clean 1809. The apps are uninstalled as they don't show in Apps & Features or Get-AppxPackage but some of them still remain as suggestions in the start menu. I'll try to find out why.

MariuzM commented 5 years ago

Running this i'm not getting the issue at-least for now, so for now i assume it's something to do with Service Tweaks

### Require administrator privileges ###
RequireAdmin

### Privacy Tweaks ###
DisableTelemetry                # EnableTelemetry
DisableWiFiSense                # EnableWiFiSense
# DisableSmartScreen            # EnableSmartScreen
DisableWebSearch                # EnableWebSearch
DisableAppSuggestions           # EnableAppSuggestions
DisableActivityHistory          # EnableActivityHistory
DisableBackgroundApps           # EnableBackgroundApps
DisableLocationTracking         # EnableLocationTracking
DisableMapUpdates               # EnableMapUpdates
DisableFeedback                 # EnableFeedback
DisableTailoredExperiences      # EnableTailoredExperiences
DisableAdvertisingID            # EnableAdvertisingID
DisableWebLangList              # EnableWebLangList
DisableCortana                  # EnableCortana
DisableErrorReporting           # EnableErrorReporting
# SetP2PUpdateLocal             # SetP2PUpdateInternet          # SetP2PUpdateDisable
DisableDiagTrack                # EnableDiagTrack
DisableWAPPush                  # EnableWAPPush
# HideRecentJumplists           # ShowRecentJumplists

### Security Tweaks ###
# SetUACLow                     # SetUACHigh
# EnableSharingMappedDrives     # DisableSharingMappedDrives
DisableAdminShares              # EnableAdminShares
# DisableSMB1                   # EnableSMB1
# DisableSMBServer              # EnableSMBServer
# DisableLLMNR                  # EnableLLMNR
# DisableNCSIProbe              # EnableNCSIProbe
SetCurrentNetworkPrivate        # SetCurrentNetworkPublic
# SetUnknownNetworksPrivate     # SetUnknownNetworksPublic
# DisableNetDevicesAutoInst     # EnableNetDevicesAutoInst
# DisableFirewall               # EnableFirewall
# DisableDefender               # EnableDefender
# DisableDefenderCloud          # EnableDefenderCloud
# EnableCtrldFolderAccess       # DisableCtrldFolderAccess
# EnableCIMemoryIntegrity       # DisableCIMemoryIntegrity
# EnableDefenderAppGuard        # DisableDefenderAppGuard
HideAccountProtectionWarn       # ShowAccountProtectionWarn
# DisableDownloadBlocking       # EnableDownloadBlocking
DisableScriptHost               # EnableScriptHost
EnableDotNetStrongCrypto        # DisableDotNetStrongCrypto
# EnableMeltdownCompatFlag      # DisableMeltdownCompatFlag
EnableF8BootMenu                # DisableF8BootMenu
# DisableBootRecovery           # EnableBootRecovery
# DisableRecoveryAndReset       # EnableRecoveryAndReset
SetDEPOptOut                    # SetDEPOptIn

### Unpinning ###
UnpinStartMenuTiles
# UnpinTaskbarIcons
Disassembler0 commented 5 years ago

That's probably accidental. I have run the exact same scenario for about 12 times by now with different results almost every time. Most of the times I end up with everything removed except Minecraft and both Candy Crushes. Then I'll fiddle around with something, logout, login and they are gone. And then when I do the same with the extra actions on the next run, I'm unable to replicate the successful removal again. :)

From what I remember, I have tried to play around with backgroud apps (that gets the provisioning stuck, but doesn't roll it back), I've played with HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore AutoDownload policy, I have fiddled with HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps where the suggestions are stored, and I have tried a few other things, but still I got nothing what would work and could be reliably replicated.

I'm so desperate that I have now started playing with the CloudStore caches.

Disassembler0 commented 5 years ago

Lol. OK. 1809 is haunted. This is what I've done and can replicate:

  1. Install the system, create user, login for the first time.
  2. Apply the tweaks. Doesn't matter if it'll be the default preset or the one linked in the OPs post.
  3. Let the system reboot. It will come up with the unwanted apps still in start menu list and tiles.
  4. Do nothing. This is very important step.
  5. You can enhance the step 4 by observing the registry. Namely HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore, subkeys Store\Cache and StoreInit.
  6. After a while (5 - 10 mins, didn't measure it or checked when and why does that happen), the whole tree under HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache disappears and a value HasStoreCacheInitialized set to 1 appears in HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\StoreInit
  7. Logout and login and the apps and tiles are gone.
Disassembler0 commented 5 years ago

@LiBOSS-CZ, @MariuzM, @SCVoldo and any other brave souls:
Please try the DisableAppSuggestions tweak from bloat-cache-purge branch. It modifies Placeholder tile collection of the start menu registry cache and then kills ShellExperienceHost.exe process of the start menu. The process is immediately automatically respawned and reloads the registry cache.

It can happen to you that you'll get an error about nonexisting registry key, in which case you're observing the same behavior as I've mentioned in the comment above. It seems that the registry cache is commited into %LocalAppData%\Packages\Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy\TempState directory every now and then and removed from registry until a subsequent change in the start menu occurs. In such case simply logout and login and you'll have the cache fully loaded in registry again.

Also, I would really like to meet the person who invented the CloudCache part and all the binary blobs. I would probably kiss him. With a crowbar. This is how my VM looks after this lovely afternoon. snap

MariuzM commented 5 years ago

Should try this on clean win?

Disassembler0 commented 5 years ago

It will work even on "dirty". Even on version which are upgraded from older builds (the caches were actually introduced in 1803). The absolutely worst thing what could happen is that you start menu won't show, which can be fixed.

MariuzM commented 5 years ago

Trying now, clean Win + bloat-cache-purge branch (default) settings. No errors, going to leave it for couple of hours and Restart / Sign Out

Disassembler0 commented 5 years ago

Yeah, also worth to mention - this removes the items from the start menu list (left side), but not necessarily from the tiles (right side). For the tiles, the best bet is to use UnpinStartMenuTiles to remove all at once, because the suggested tiles are baked in in yet another binary blob and can't be picked that easily.

Also the remark about online provisioning still stands. Once you'll see the progress bar under the suggestion in start menu, it's likely that it will be eventually installed even when you use all the removal tweaks. So let it install, then ged rid of it.

MariuzM commented 5 years ago

Nope same issue. Just Signed Out tiles are back

LiBOSS-CZ commented 5 years ago

Wonderful Snapping tree :D I will try it in a couple of hours or in the morning

MariuzM commented 5 years ago

https://imgur.com/VD35y5X

Disassembler0 commented 5 years ago

@MariuzM: What am I looking at? I see no Minecrafts, no Candy Crushes, no Hidden Cities or any other suggestions.

MariuzM commented 5 years ago

OH sorry, before i have applied the tweak i have uninstalled all the unwanted apps myself

MariuzM commented 5 years ago

Pre Patch https://imgur.com/KY9sGCY

Disassembler0 commented 5 years ago

Wait... I'm lost. The issue was about the suggestions reappearing as start menu items (i.e. not tiles) marked as new. This - https://i.imgur.com/n5vCeSv.png

In your "pre patch" I see just a few MS apps, which are normally uninstalled by UninstallMsftBloat which I don't see in any of your presets what you've posted.

Disassembler0 commented 5 years ago

Also, @LiBOSS-CZ, now I'm looking at the second part of your description.

...and recently added apps setting is enabled

There is a separate tweak for that, HideRecentlyAddedApps. I see you have it commented in your preset.

MariuzM commented 5 years ago

Hm for me is:

  1. Tiles and Folders (Create, Play, Explore) re-appear - https://imgur.com/VD35y5X because i have Store and Edge installed thats whats re-appearing.
  2. I think the New bit also is an issue, when i right clicked on the New app or opened it to remove the New highlight after restart it came back
  3. "Recently Added" before the patch i have unticked in Start Menu settings but after the patch + restart it comes back
MariuzM commented 5 years ago

I will try again from Clean Win 10 (full reinstall) + Win Updates + App Updates + your tweak

Disassembler0 commented 5 years ago

Tiles and Folders (Create, Play, Explore) re-appear...

Tiles reappear after you do what? The only tweak touching the tiles directly is UnpinStartMenuTiles which I don't see in your preset either. Or does it happen that the tiles reappear after login/logout even when you remove them manually?

... when i right clicked on the New app or opened it to remove the New highlight after restart it came back

Well that's that what the bloat-cache-purge branch attempts to solve. If it's still reappearing then the cache purge is not reflected, which, frankly, I have no idea how to reproduce.

"Recently Added" before the patch i have unticked in Start Menu settings but after the patch + restart it comes back

On your screenshots, I see recently added items both pre-patch and post. There's a separate tweak for that - HideRecentlyAddedApps. But if you switched the option off manually and it switched back on automatically after you've applied the script, then it's a problem (however I tried it just now and it remained off, so I might need something more to on)

MariuzM commented 5 years ago

Yes the tiles reappear after i remove them manually and then apply the tweak + restart + wait sometime + Restart/Log off = tiles are back

MariuzM commented 5 years ago

Update:

Fresh install, applied the bloat-cache-purge branch tweak https://imgur.com/vHzQ9pB

Removed tiles manually: https://imgur.com/CEKpkku

Around 25min restart and this: https://imgur.com/qbDtEPZ

Disassembler0 commented 5 years ago

Alright. First of all, I am blind and you do use UnpinStartMenuTiles. In which case I don't understand what do you mean by "... i remove them manually ...", because you shouldn't remove anything by hand. The tweak does it for you, only it's not visible right away (bloat-cache-purge branch fixes that too).

Second, you are right about one of the service tweak interfering. Turns out that DisableSharedExperiences forces the system to drop the start menu and tiles cache and rebuild.

The Store + Edge tiles and 3 default categories what you're eventually seeing are result of a corrupted cache. When that happens (or when you drop the *start.tilegrid$windows.data.curatedtilecollection.tilecollection\Current manually), this is what the systems restores as fallback tile grid.

I'll run a few more test and try to find if there is a way out. The UnpinStartMenuTiles probably needs an adjustment as the value set by it is not understood in this specific scenario. Probably tomorrow.

MariuzM commented 5 years ago

On bloat-cache-purge branch UnpinStartMenuTiles is not enabled. It's your default settings i have not changed.

Settings above that i have posted was from a normal branch + my settings and not bloat-cache-purge (default settings) Thanks for your hard work on this tweak!

Disassembler0 commented 5 years ago

iwkad22 That's not my bug, that's Microsoft's!

It really is sufficient to enable the EnableCdp and EnableMmx policies contained in DisableSharedExperiences and nothing more to trigger this behavior. Then you just need to remove a few tiles and restart. As it seems, the restart won't save the changes permanently, so next time the caches are rebuilt, the changes are lost.

I've pushed another commit to bloat-cache-purge branch. It simply kills the start menu process as part of the DisableSharedExperiences, causing it to respawn and do proper cache restore/save/cleanup, so the changes done up until that point are reflected even after restart. Just don't do any changes between the tweak application and restart and it should work. Feel free to test.

MariuzM commented 5 years ago

I was not saying it was your bug :) i meant in general thanks for this Tweak :)

Disassembler0 commented 5 years ago

I was just surprised that it's not on my end. The things I do to the binary blobs are mostly black magic, so I would expect that the problem would be there, but no.

However on second try, not even the additional commit seems to work. :/ At first I though it did, but I must have done something differently. Oh well... let's continue with more trial and error.

MariuzM commented 5 years ago

Trying the updated tweak now

MariuzM commented 5 years ago

Hm :) the arch nemesis is back :D https://imgur.com/Z641tRR

BTW i had enabled to remove all tiles

Disassembler0 commented 5 years ago

I'm out of ideas. Simply enabling the GPO causes the start menu app to create a new identity, losing the original settings, unless the user manually performs any changes in start menu in the few minutes after the reboot. All of this happens long time after the script finishes, so I don't see any options how can i prevent it or work around it.

I have now two options, both of them pretty bad. Either I'll simply document the behavior and call it a day. Or I can revert the DisableSharedExperiences tweak to non-GPO variant as it was before commit 98e106b78ad5de2521945da38bebd4af1558071f.

One way or another, I'm done for now as it's 00:12 here.

LiBOSS-CZ commented 5 years ago

Same bad results for me. Workaround does not help:-( At least reenabling "SharedExperiences" works for "dirty" system as well.

Disassembler0 commented 5 years ago

"Same bad results" means that only the tiles reappear, right? The suggestions marked as "new" are not showing anymore (assuming the provisioning process finished).

I have pushed one more commit which reverts the DisableSharedExperiences to non-GPO variant. I don't like it, but it's probably still better than the current state. Feel free to test once more.

LiBOSS-CZ commented 5 years ago

Everything is back:-( I have manually unpin tiles. I will try non-GPO variant today. start

MariuzM commented 5 years ago

"Same bad results" means that only the tiles reappear, right? The suggestions marked as "new" are not showing anymore (assuming the provisioning process finished).

I have pushed one more commit which reverts the DisableSharedExperiences to non-GPO variant. I don't like it, but it's probably still better than the current state. Feel free to test once more.

Still no issues i think it's been an hour so for now i can say this works

Disassembler0 commented 5 years ago

Alright. I see 3 separate things on the screenshot.

1) Recently added - As I've alredy mentioned, you don't use HideRecentlyAddedApps in your preset, so it makes sense that they are not hidden :) If you hid them manually, then see point 3.

2) Calculator marked as new - Calculator is the only application excluded from UninstallMsftBloat because that's the only undisputedly useful application. If you're contesting why is it marked as new, then see point 3. If you removed it manually and it came back, then it's likely the same problem as with the provisioning. You haven't uninstalled Store (UninstallWindowsStore) and you haven't disabled backgroud apps (DisableBackgroundApps), so Store can go wild and update whatever it pleases.

3) Store + Edge tiles - That's the same problem as @MariuzM has and that's caused by the GPO version of DisableSharedExperiences, which causes the start menu caches to be dropped and recreated. This is also likely the cause of all other problems as it's possible that it even reverts some settings, like the recently added mentioned in point 1, so try with the non-GPO variant.

Just to compare with what I'm getting, I have made a video (H264 MP4, 9.8 MB) where you can see the very first login on a clean 1809 installation. I don't even wait for the provisioning to finish, download bloat-cache-purge branch as it currently is (incl. the non-GPO variant of DisableSharedExperiences), download your preset given in the first post and run it. After restart, I wait 13 minutes (3:00 - 16:00) and then log off and log back in. Everything what you see in the start menu is expected to be there.

LiBOSS-CZ commented 5 years ago

Yes I understand. It was not only calculator, but also other apps (for example Total Commander),.... I was only trying workaround for GPO version but with no success. Non-GPO version works well.

LiBOSS-CZ commented 5 years ago

Archnemesis is back. Just without any changes to the system or running script again. Any ideas? What should I check,...

Disassembler0 commented 5 years ago

Run this as admin and paste the output of the Write-Output, please.

$ErrorActionPreference = "SilentlyContinue"
$cdp = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableCdp"
$mmx = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableMmx"
$rome = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy"
$svc = $(Get-Service CDPUserSvc).StartType
Write-Output "EnableCdp: $cdp`nEnableMmx: $mmx`nRomePolicy: $rome`nCDPUserSvc: $svc"
LiBOSS-CZ commented 5 years ago

Output: EnableCdp: EnableMmx: RomePolicy: 1 CDPUserSvc: Automatic

Disassembler0 commented 5 years ago

All of these are correct.

  1. Do you use any other script or software for tweaking Windows?
  2. Do you use Microsoft account or only local one?
  3. In #187 you've mentioned that you've reinstalled. Which version of script did you use on which version (build, edition) of Windows afterwards?
  4. Can you please send me the preset you have used?
LiBOSS-CZ commented 5 years ago
  1. I am using Universal Windows Tweaker 4 to disable low space check and remove shorcut arrow ( https://www.thewindowsclub.com/ultimate-windows-tweaker-4-windows-10 )
  2. local only
  3. 1809 with 3.5 version of script
  4. Win10-my.preset.txt