From 6ec319b27267a1ea16e3b15d16ad925a7f8630d7 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Fri, 24 May 2024 14:13:15 +0200 Subject: [PATCH] Added option to disable gameDVR, clearing start now backs up old file + more Added new option to disable Game DVR. (#62) Clearing the start menu now creates a backup of the current start menu file. (#60) Fixed unnecessarily setting path variable in Get.ps1 in some situations (#59) --- Get.ps1 | 7 ++++--- README.md | 1 + Regfiles/Disable_DVR.reg | 7 +++++++ Regfiles/Undo/Enable_DVR.reg | 7 +++++++ Win11Debloat.ps1 | 27 ++++++++++++++++++++++----- 5 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 Regfiles/Disable_DVR.reg create mode 100644 Regfiles/Undo/Enable_DVR.reg diff --git a/Get.ps1 b/Get.ps1 index 7cb206a..65d7da2 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -10,6 +10,7 @@ param ( [switch]$RemoveCommApps, [switch]$RemoveDevApps, [switch]$RemoveW11Outlook, + [switch]$DisableDVR, [switch]$DisableTelemetry, [switch]$DisableBingSearches, [switch]$DisableBing, [switch]$DisableLockscrTips, [switch]$DisableLockscreenTips, @@ -51,6 +52,9 @@ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) { Write-Output "> Installing git..." winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade + + # Add default install location of git to path + $env:Path += ';C:\Program Files\Git\cmd' Write-Output "" } @@ -58,9 +62,6 @@ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) # Navigate to user temp directory cd $env:TEMP - # Add default install location of git to path - $env:Path += ';C:\Program Files\Git\cmd' - # Download Win11Debloat from github Write-Output "> Downloading Win11Debloat..." git clone https://github.com/Raphire/Win11Debloat/ diff --git a/README.md b/README.md index 4d6c8fe..c07f5de 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ The quick and advanced method support parameters to tailor the behaviour of the | -RemoveW11Outlook | Remove the new Outlook for Windows app. | | -RemoveDevApps | Remove developer-related apps such as Remote Desktop, DevHome and Power Automate. | | -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. | +| -DisableDVR | Disable Xbox game DVR. | | -ClearStart | Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) | | -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. | | -DisableBing | Disable & remove bing search, bing AI & cortana in Windows search. | diff --git a/Regfiles/Disable_DVR.reg b/Regfiles/Disable_DVR.reg new file mode 100644 index 0000000..0818275 --- /dev/null +++ b/Regfiles/Disable_DVR.reg @@ -0,0 +1,7 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\System\GameConfigStore] +"GameDVR_Enabled"=dword:00000000 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR] +"AllowGameDVR"=dword:00000000 diff --git a/Regfiles/Undo/Enable_DVR.reg b/Regfiles/Undo/Enable_DVR.reg new file mode 100644 index 0000000..83dd1f4 --- /dev/null +++ b/Regfiles/Undo/Enable_DVR.reg @@ -0,0 +1,7 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\System\GameConfigStore] +"GameDVR_Enabled"=dword:00000001 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR] +"AllowGameDVR"=dword:00000001 \ No newline at end of file diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 689f17a..ba754ce 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -11,6 +11,7 @@ param ( [switch]$RemoveCommApps, [switch]$RemoveDevApps, [switch]$RemoveW11Outlook, + [switch]$DisableDVR, [switch]$DisableTelemetry, [switch]$DisableBingSearches, [switch]$DisableBing, [switch]$DisableLockscrTips, [switch]$DisableLockscreenTips, @@ -406,9 +407,14 @@ function ClearStartMenu { # Copy Start menu to all users folders ForEach ($startmenu in $usersStartMenu) { $startmenuBinFile = $startmenu.Fullname + "\start2.bin" + $backupBinFile = $startmenuBinFile + ".bak" # Check if bin file exists if (Test-Path $startmenuBinFile) { + # Backup current startmenu file + Move-Item -Path $startmenuBinFile -Destination $backupBinFile + + # Copy template file Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force $cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2] @@ -696,11 +702,18 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP AddParameter 'RemoveW11Outlook' 'Remove the new Outlook for Windows app' AddParameter 'RemoveDevApps' 'Remove developer-related apps' AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar' + AddParameter 'DisableDVR' 'Disable Xbox game DVR' } '3' { Write-Output "You have selected $($global:SelectedApps.Count) apps for removal" AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:" + + Write-Output "" + + if ($( Read-Host -Prompt "Disable Xbox game DVR? (y/n)" ) -eq 'y') { + AddParameter 'DisableDVR' 'Disable Xbox game DVR' + } } } @@ -721,15 +734,15 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP Write-Output "" - if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') { - AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search' + if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') { + AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer' + AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen' } Write-Output "" - if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer and lockscreen? (y/n)" ) -eq 'y') { - AddParameter 'DisableSuggestions' 'Disable tips, tricks, suggestions and ads in start, settings, notifications and Windows explorer' - AddParameter 'DisableLockscreenTips' 'Disable tips & tricks on the lockscreen' + if ($( Read-Host -Prompt "Disable & remove bing search, bing AI & cortana in Windows search? (y/n)" ) -eq 'y') { + AddParameter 'DisableBing' 'Disable & remove bing search, bing AI & cortana in Windows search' } # Only show this option for Windows 11 users running build 22621 or later @@ -1055,6 +1068,10 @@ else { continue } + 'DisableDVR' { + RegImport "> Disabling Xbox game DVR..." $PSScriptRoot\Regfiles\Disable_DVR.reg + continue + } 'ClearStart' { ClearStartMenu "> Removing all pinned apps from the start menu..." continue