Skip to content

Commit

Permalink
feat: 24H2 features & fixes (#1149)
Browse files Browse the repository at this point in the history
### Questions
- [x] Did you test your changes or double-check that they work?
- [x] Did you read and follow the [Atlas Contribution
Guidelines](https://docs.atlasos.net/contributions/)?

### Describe your pull request
Does these for 24H2:
- Adds support for the Copilot app
- Fixes the 'Accounts' settings page ads
	- It's also more reliable generally now
- Remove & kill new Appx Teams

**This PR doesn't bring 24H2 support;** it implements needed changes I
noticed when testing the Windows Insider Canary branch. These changes
are required for when 24H2 is officially released, but they don't really
impact 23H2.
  • Loading branch information
he3als authored Jul 16, 2024
1 parent 3ce9f08 commit 72c70ff
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 23 deletions.
14 changes: 11 additions & 3 deletions src/playbook/Configuration/atlas/appx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,26 @@ 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}
- !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}

# 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}
Expand Down Expand Up @@ -79,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*'}
Expand Down
Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,35 @@ 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)
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)

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 Finished, changes are applied. %appText%
echo Press any key to exit...
pause > nul
exit /b
exit /b

:app
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
12 changes: 8 additions & 4 deletions src/playbook/Executables/AtlasModules/Scripts/wingetCheck.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/playbook/Executables/CLIENTCBS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 72c70ff

Please sign in to comment.