From 9d9881d6cd525e4e770b82d67882063085474cdc Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:27:33 +0100 Subject: [PATCH 1/6] feat(AppX): strip new Teams --- src/playbook/Configuration/atlas/appx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/playbook/Configuration/atlas/appx.yml b/src/playbook/Configuration/atlas/appx.yml index e817644583..6e41d45798 100644 --- a/src/playbook/Configuration/atlas/appx.yml +++ b/src/playbook/Configuration/atlas/appx.yml @@ -25,6 +25,7 @@ actions: # Seems legacy - not in 23H2? - !taskKill: {name: 'msteams*', ignoreErrors: true} - !appx: {name: 'MicrosoftTeams*', type: family} + - !appx: {name: 'MSTeams*', type: family} - !registryValue: {path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications', value: 'ConfigureChatAutoInstall', data: '0', type: REG_DWORD} - !appx: {name: 'Clipchamp.Clipchamp*', type: family} From 1a4ddfb5459e727e37f7d76795f906e98a4f1f87 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:32:48 +0100 Subject: [PATCH 2/6] feat(copilot): Copilot app support --- src/playbook/Configuration/atlas/appx.yml | 8 ++++-- .../Disable Microsoft Copilot (default).cmd | 26 +++++++++++++++++++ .../Disable Microsoft Copilot (default).reg | 4 --- .../Enable Microsoft Copilot.cmd | 22 +++++++++++----- 4 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).cmd delete mode 100644 src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).reg diff --git a/src/playbook/Configuration/atlas/appx.yml b/src/playbook/Configuration/atlas/appx.yml index 6e41d45798..9c71a8201e 100644 --- a/src/playbook/Configuration/atlas/appx.yml +++ b/src/playbook/Configuration/atlas/appx.yml @@ -28,14 +28,18 @@ actions: - !appx: {name: 'MSTeams*', type: family} - !registryValue: {path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications', value: 'ConfigureChatAutoInstall', data: '0', type: REG_DWORD} + # 24H2 Copilot app + - !appx: {name: 'Microsoft.Copilot', type: family} + + # Other apps - !appx: {name: 'Clipchamp.Clipchamp*', type: family} - !appx: {name: 'Disney.37853FC22B2CE*', type: family} - !appx: {name: 'SpotifyAB.SpotifyMusic*', type: family} - !appx: {name: 'Microsoft.549981C3F5F10*', type: family} # Cortana - - !appx: {name: 'Microsoft.XboxApp*', type: family} # Legacy Xbox Console Companion + - !appx: {name: 'Microsoft.XboxApp*', type: family} # Xbox Console Companion (deprecated) - !appx: {name: 'microsoft.windowscommunicationsapps*', type: family} # Mail and Calendar - !appx: {name: 'Microsoft.MSPaint*', type: family} # Paint 3D - - !appx: {name: 'Microsoft.Getstarted*', type: family} # Tips + - !appx: {name: 'Microsoft.Getstarted*', type: family} # Tips (deprecated) - !appx: {name: 'Microsoft.ZuneVideo*', type: family} # Films & TV - !appx: {name: 'MicrosoftCorporationII.MicrosoftFamily*', type: family} - !appx: {name: 'Microsoft.MixedReality.Portal*', type: family} diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).cmd new file mode 100644 index 0000000000..8424303de0 --- /dev/null +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).cmd @@ -0,0 +1,26 @@ +@echo off + +set "___args="%~f0" %*" +fltmc > nul 2>&1 || ( + echo Administrator privileges are required. + powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || ( + echo You must run this script as admin. + if "%*"=="" pause + exit /b 1 + ) + exit /b +) + +echo Disabling and uninstalling Copilot... + +powershell -NoP -NonI "Get-AppxPackage -AllUsers Microsoft.Copilot* | Remove-AppxPackage -AllUsers" +taskkill /f /im explorer.exe > nul 2>&1 +reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowCopilotButton" /t REG_DWORD /d "0" /f > nul +reg add "HKCU\Software\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWindowsCopilot" /t REG_DWORD /d "1" /f > nul +start explorer.exe + +echo] +echo Finished, changes are applied. +echo Press any key to exit... +pause > nul +exit /b \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).reg b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).reg deleted file mode 100644 index ff7ca231f9..0000000000 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Disable Microsoft Copilot (default).reg +++ /dev/null @@ -1,4 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\WindowsCopilot] -"TurnOffWindowsCopilot"=dword:00000001 diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd index f40ccc594c..6861997081 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd @@ -11,24 +11,32 @@ fltmc > nul 2>&1 || ( exit /b ) -echo Please note that some regions or devices may not have Copilot avaliable. -echo This means that the script can seem to 'not work', but it would do if it was avaliable. -pause - -cls +:: Check for Edge support echo] call "%windir%\AtlasModules\Scripts\edgeCheck.cmd" /edgeonly if %errorlevel% neq 0 exit /b 1 echo] echo Enabling Copilot... + +:: Decide if Copilot is avaliable +:: If not, it could be 24H2 (which replaces it with an app +reg query HKCU\Software\Microsoft\Windows\Shell\Copilot /v IsCopilotAvailable 2>&1 | find "0x0" > nul +if %errorlevel%==0 (call :app) else (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowCopilotButton" /t REG_DWORD /d "1" /f > nul) + taskkill /f /im explorer.exe > nul 2>&1 reg delete "HKCU\Software\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWindowsCopilot" /f > nul 2>&1 -reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowCopilotButton" /t REG_DWORD /d "1" /f > nul start explorer.exe +:finish echo] echo Finished, changes are applied. echo Press any key to exit... pause > nul -exit /b \ No newline at end of file +exit /b + +:app +echo NOTE: Copilot on the taskbar isn't available, installing the app instead... +call "%windir%\AtlasModules\Scripts\wingetCheck.cmd" +if %errorlevel% neq 0 exit /b 1 +winget install -e --id 9NHT9RB2F4HD --uninstall-previous -h --accept-source-agreements --accept-package-agreements --force --disable-interactivity > nul \ No newline at end of file From 9ef059fdec32621743b8f5974a247a4c19b3a580 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:46:42 +0100 Subject: [PATCH 3/6] feat(teams): kill new teams appx --- src/playbook/Configuration/atlas/appx.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/playbook/Configuration/atlas/appx.yml b/src/playbook/Configuration/atlas/appx.yml index 9c71a8201e..e924aaa445 100644 --- a/src/playbook/Configuration/atlas/appx.yml +++ b/src/playbook/Configuration/atlas/appx.yml @@ -22,12 +22,14 @@ actions: wait: true # AppX Microsoft Teams - # Seems legacy - not in 23H2? + # Seems legacy - not in 23H2 - !taskKill: {name: 'msteams*', ignoreErrors: true} - !appx: {name: 'MicrosoftTeams*', type: family} - - !appx: {name: 'MSTeams*', type: family} - !registryValue: {path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications', value: 'ConfigureChatAutoInstall', data: '0', type: REG_DWORD} + # New AppX Teams in 24H2 + - !taskKill: {name: 'ms-teams*', ignoreErrors: true} + - !appx: {name: 'MSTeams*', type: family} # 24H2 Copilot app - !appx: {name: 'Microsoft.Copilot', type: family} From c695c0d1b324eb35d1d2bb3f2985712a5d2f45d7 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:48:33 +0100 Subject: [PATCH 4/6] fix(CLIENTCBS): check all of SystemApps --- src/playbook/Executables/CLIENTCBS.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/playbook/Executables/CLIENTCBS.ps1 b/src/playbook/Executables/CLIENTCBS.ps1 index 4890d95f4f..4ff073d6de 100644 --- a/src/playbook/Executables/CLIENTCBS.ps1 +++ b/src/playbook/Executables/CLIENTCBS.ps1 @@ -8,10 +8,9 @@ # Variables $windir = [Environment]::GetFolderPath('Windows') -$cbsPublic = "$windir\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\Public" -$settingsExtensions = "$cbsPublic\wsxpacks\Account\SettingsExtensions.json" +$settingsExtensions = (Get-ChildItem "$windir\SystemApps" -Recurse).FullName | Where-Object { $_ -like '*wsxpacks\Account\SettingsExtensions.json*' } $arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') -if (!(Test-Path $settingsExtensions)) { +if ($settingsExtensions.Count -eq 0) { Write-Output "Settings extensions ($settingsExtensions) not found." Write-Output "User is likely on Windows 10, nothing to do. Exiting..." exit @@ -37,7 +36,10 @@ function Find-VelocityID($Node) { return $ids } -$ids = Find-VelocityID -Node $(Get-Content -Path $settingsExtensions | ConvertFrom-Json) +$ids = @() +foreach ($settingsJson in $settingsExtensions) { + $ids += Find-VelocityID -Node $(Get-Content -Path $settingsJson | ConvertFrom-Json) +} # No IDs check if ($ids.Count -le 0) { From 0d1b0dd9a532d0e36b0831cfe071530ae7f457ec Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:05:42 +0100 Subject: [PATCH 5/6] fix(appx): add * to copilot --- src/playbook/Configuration/atlas/appx.yml | 3 ++- .../Microsoft Copilot/Enable Microsoft Copilot.cmd | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/playbook/Configuration/atlas/appx.yml b/src/playbook/Configuration/atlas/appx.yml index e924aaa445..204c0c4bb7 100644 --- a/src/playbook/Configuration/atlas/appx.yml +++ b/src/playbook/Configuration/atlas/appx.yml @@ -31,7 +31,7 @@ actions: - !taskKill: {name: 'ms-teams*', ignoreErrors: true} - !appx: {name: 'MSTeams*', type: family} # 24H2 Copilot app - - !appx: {name: 'Microsoft.Copilot', type: family} + - !appx: {name: 'Microsoft.Copilot*', type: family} # Other apps - !appx: {name: 'Clipchamp.Clipchamp*', type: family} @@ -86,6 +86,7 @@ actions: wait: true # Clear caches of Client.CBS and more + # Start menu cache is cleared later - !writeStatus: {status: 'Clearing AppX caches'} - !appx: {operation: clearCache, name: '*MicrosoftWindows.Client.CBS*'} - !appx: {operation: clearCache, name: '*Microsoft.Windows.Search*'} diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd index 6861997081..1e134f3b54 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd @@ -20,7 +20,7 @@ echo] echo Enabling Copilot... :: Decide if Copilot is avaliable -:: If not, it could be 24H2 (which replaces it with an app +:: If not, it could be 24H2 (which replaces it with an app) reg query HKCU\Software\Microsoft\Windows\Shell\Copilot /v IsCopilotAvailable 2>&1 | find "0x0" > nul if %errorlevel%==0 (call :app) else (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowCopilotButton" /t REG_DWORD /d "1" /f > nul) From 431ab05f2f559c6a6f998191af2ec5d3711c664e Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:29:53 +0100 Subject: [PATCH 6/6] feat(copilot): better UX for app --- .../Microsoft Copilot/Enable Microsoft Copilot.cmd | 9 ++++++--- .../Executables/AtlasModules/Scripts/wingetCheck.cmd | 12 ++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd index 1e134f3b54..f040239983 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Microsoft Copilot/Enable Microsoft Copilot.cmd @@ -21,6 +21,7 @@ echo Enabling Copilot... :: Decide if Copilot is avaliable :: If not, it could be 24H2 (which replaces it with an app) +set "appText= " reg query HKCU\Software\Microsoft\Windows\Shell\Copilot /v IsCopilotAvailable 2>&1 | find "0x0" > nul if %errorlevel%==0 (call :app) else (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowCopilotButton" /t REG_DWORD /d "1" /f > nul) @@ -30,13 +31,15 @@ start explorer.exe :finish echo] -echo Finished, changes are applied. +echo Finished, changes are applied. %appText% echo Press any key to exit... pause > nul exit /b :app -echo NOTE: Copilot on the taskbar isn't available, installing the app instead... -call "%windir%\AtlasModules\Scripts\wingetCheck.cmd" +echo NOTE: Copilot on the taskbar isn't available, the app will be installed instead. +set "appText=You can find the Copilot app in your Start Menu." +call "%windir%\AtlasModules\Scripts\wingetCheck.cmd" /nodashes if %errorlevel% neq 0 exit /b 1 +echo Installing Copilot... winget install -e --id 9NHT9RB2F4HD --uninstall-previous -h --accept-source-agreements --accept-package-agreements --force --disable-interactivity > nul \ No newline at end of file diff --git a/src/playbook/Executables/AtlasModules/Scripts/wingetCheck.cmd b/src/playbook/Executables/AtlasModules/Scripts/wingetCheck.cmd index 31fdf23117..ab3e1f0bf0 100644 --- a/src/playbook/Executables/AtlasModules/Scripts/wingetCheck.cmd +++ b/src/playbook/Executables/AtlasModules/Scripts/wingetCheck.cmd @@ -2,9 +2,11 @@ set "dashes=-----------------------------------------------------------------------------------------------------" set "silent=" -echo "%~1 %~2" | find "/silent" > nul && set silent=true +set "nodashes=" +echo "%*" | find "/silent" > nul && set silent=true +echo "%*" | find "/nodashes" > nul && set nodashes=true -if not defined silent echo %dashes% +if not defined silent (if not defined nodashes echo %dashes%) ping -n 1 -4 www.microsoft.com > nul 2>&1 if errorlevel == 1 ( @@ -36,8 +38,10 @@ winget search "Microsoft Visual Studio Code" --accept-source-agreements > nul 2> ) if not defined silent ( - echo %dashes% - echo] + if not defined nodashes ( + echo %dashes% + echo] + ) ) exit /b