Skip to content

Commit

Permalink
feat: client cbs new removal function
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyueta committed Oct 21, 2023
1 parent 9509820 commit b216e0a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 38 deletions.
15 changes: 9 additions & 6 deletions src/playbook/Configuration/atlas/appx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ actions:
# Windows Backup
- !appx: {name: '*WindowsBackup*', type: app}

# Advertisements in Settings
- !appx: {name: '*Global.ValueBanner*', type: app}
- !appx: {name: '*Global.BackupBanner*', type: app}

- !run:
exe: 'powershell.exe'
args: '-NoP -File CLIENTCBS.ps1'
exeDir: true

# Quick Assist
- !appx: {name: '*MicrosoftCorporationII.QuickAssist*', type: family}

Expand Down Expand Up @@ -133,12 +142,6 @@ actions:
- !registryKey: {path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\MicrosoftTeams_8wekyb3d8bbwe', operation: add}
- !registryKey: {path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy', operation: add}

# Edit Client.CBS package to remove annoying ads from apps
- !run:
exe: 'powershell.exe'
args: '-NoP -File CLIENTCBS.ps1'
exeDir: true

# Clear caches of Start menu and more
- !appx: {operation: clearCache, name: '*Client.CBS*'}
- !appx: {operation: clearCache, name: '*StartMenuExperienceHost*'}
Expand Down
12 changes: 6 additions & 6 deletions src/playbook/Configuration/atlas/start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ actions:
# Do not change the line position of this, otherwise things will break
# - !run: {exe: 'cmd.exe', args: '/c start "AME Wizard Live Log" PowerShell -NoP -C "gc -Wait Logs\TIOutput.txt -EA SilentlyContinue | Write-Output; pause"', baseDir: true, wait: false}

# Update Microsoft Store apps to update WinGet
- !run:
exe: 'NSudoLC.exe'
args: '-U:E -UseCurrentConsole -Wait powershell.exe -NoP -C "Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod"'
wait: false

# Prevent annoying notifications during deployment
- !registryValue: {path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance', value: 'Enabled', type: REG_DWORD, data: '0'}

Expand Down Expand Up @@ -49,6 +43,12 @@ actions:
- !run: {exe: 'DISM.exe', args: '/Online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2" /NoRestart', weight: 30}
- !run: {exe: 'DISM.exe', args: '/Online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" /NoRestart', weight: 30}

# Update Microsoft Store applications
- !writeStatus: {status: 'Updating dependencies'}
- !run:
exe: 'NSudoLC.exe'
args: '-U:E -UseCurrentConsole -Wait powershell.exe -NoP -C "Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod"'

- !writeStatus: {status: 'Installing software'}
- !run:
exe: 'powershell.exe'
Expand Down
22 changes: 0 additions & 22 deletions src/playbook/Executables/CLIENTCBS.ps1
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
# Configure Client CBS related entires
# Made by Xyueta

## Set the Client CBS path
$Cbs = "$env:windir\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy"

## Remove 'Get started' and 'Windows Backup' from Start Menu
$Manifest = Join-Path $Cbs 'appxmanifest.xml'
$AtlasManifest = Join-Path $Cbs "appxmanifest.xml.atlas"
if (!(Test-Path $AtlasManifest)) {
Copy-Item -Path $Manifest -Destination $AtlasManifest -Force
Get-Acl -Path $Manifest | Set-Acl -Path $AtlasManifest
Remove-Item $Manifest -Force
}
[xml]$xml = Get-Content -Path "$Cbs\appxmanifest.xml.atlas" -Raw
$applicationNodes = $xml.Package.Applications.Application | Where-Object { $_.Id -eq 'WebExperienceHost' -or $_.Id -eq 'WindowsBackup' }
foreach ($applicationNode in $applicationNodes) { $xml.Package.Applications.RemoveChild($applicationNode) }
$xml.Save($Manifest)

## Remove ads from the 'Accounts' page in Immersive Control Panel
$content = Get-Content -Path "$Cbs\Public\wsxpacks.json"
$pattern = '^\s*"Windows\.Settings\.Account".*'
$modifiedContent = $content -replace $pattern, ''
$modifiedContent = ($modifiedContent | Where-Object { $_.Trim() -ne "" }) -join "`n"
Set-Content -Path "$Cbs\Public\wsxpacks.json" -Value $modifiedContent

## Remove banner from Immersive Control Panel
Rename-Item "$Cbs\SystemSettingsExtensions.dll" -NewName "SystemSettingsExtensions.dll.old" -Force
5 changes: 1 addition & 4 deletions src/playbook/Executables/WIN11.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ for /f "usebackq tokens=2 delims=\" %%a in (`reg query HKU ^| findstr /r /x /c:"
reg query "HKU\%%a" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > nul && (
echo Applying %regVariable% changes to "%%a"...
call :%regVariable% "%%a"

rem Disable archive apps
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\InstallService\Stubification\%~1" /v "EnableAppOffloading" /t REG_DWORD /d "0" /f > nul
)
)
if defined win10 exit /b
Expand All @@ -79,7 +76,7 @@ reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWin
bcdedit /set description "AtlasOS 11" > nul

:: Remove Gallery from Explorer
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_41040327\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}" /f > nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_41040327\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}" /f > nul 2>&1

:: Re-enable Action Center on Win11, as it breaks calendar
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /f > nul 2>&1
Expand Down

0 comments on commit b216e0a

Please sign in to comment.