Skip to content

Commit

Permalink
fix(WU): deprecated !systemPackage to use CAB approach instead
Browse files Browse the repository at this point in the history
Credits to echnobas, Atlas team and all the contributors for the CAB approach

Reasons for this change:
- Removing system packages with !systemPackage causes Windows Updates to fail
- In cases one of the removed components causes unexpected behavior, it is possible to revert the change without reinstalling the whole system

There are also additional changes:
- Unregistered appx manifests from StateRepostiory instead of removing, such as advertisment banners in Settings, the GetStarted placeholder in the Start Menu and Windows Backup. Removing them causes Windows Update to fail.
- Moved PowerShell optimization action at the start
- GitHub Actions automatically builds a CAB file
  • Loading branch information
melo936 authored Nov 25, 2023
1 parent 736d73e commit dbfaf47
Show file tree
Hide file tree
Showing 7 changed files with 675 additions and 889 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,44 @@ on:
tags:
- '*'

env:
SXSC_REPO: 'https://github.com/Atlas-OS/sxsc'
FILENAME: 'Revi-PB-${{ github.ref_name }}.apbx'

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set file name
run: echo "FILENAME=Revi-PB-${{ github.ref_name }}.apbx" >> $GITHUB_ENV
# Credits to echnobas, Atlas and all the contributors.
- name: Git clone sxsc
run: |
git clone --depth=1 ${{ env.SXSC_REPO }} sxsc-src
- name: Build cab
run: |
pip install -r requirements.txt | Out-Null
$systemPackages = "..\src\Executables\CAB\systemPackages.yaml"
Copy-Item -Path $systemPackages -Destination "cfg.yaml" -Force | Out-Null
python sxsc.py
if ($LASTEXITCODE -ne 0) { exit 1 }
.\build.bat
.\clean.bat
Copy-Item -Path *.cab -Destination ".\src\Executables\CAB" -Force | Out-Null
working-directory: sxsc-src
#

- name: Archive content
run: |
7z a -p${{ secrets.PASSWORD }} -mhe=on "${{ env.FILENAME }}" ./src/*
7z a -pmalte -mhe=on ${{ env.FILENAME }} ./src/*
- name: Hash 256
- name: Generate SHA256
run: |
echo "HASH=$(sha256sum ${{ env.FILENAME }} | cut -d ' ' -f 1)" >> $GITHUB_ENV
$hash = (Get-FileHash -Algorithm SHA256 -Path ${{ env.FILENAME }}).Hash
echo ("HASH=" + $hash) >> $env:GITHUB_ENV
# - name: DevUploads
# run: |
Expand Down
10 changes: 5 additions & 5 deletions src/Configuration/features/revision/appx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ actions:
- !writeStatus: {status: "Removing GetStarted"}
- !appx: {name: '*Microsoft.Getstarted*', type: family, weight: 10}
# Get Started placeholder
- !appx: {name: '*WebExperienceHost*', type: app, weight: 10}
- !appx: {name: '*WebExperienceHost*', type: app, unregister: true, weight: 10}

- !writeStatus: {status: "Removing Todos"}
- !appx: {name: '*Microsoft.Todos*', type: family, weight: 10}
Expand Down Expand Up @@ -132,13 +132,13 @@ actions:

- !writeStatus: {status: "Removing Banners"}
# MicrosoftWindows.Client.CBS_cw5n1h2txyewy!
- !appx: {name: '*Global.ValueBanner*', type: app, weight: 50}
- !appx: {name: '*Global.WsxPackManager*', type: app, weight: 50}
- !appx: {name: '*Global.ValueBanner*', type: app, unregister: true, weight: 50}
- !appx: {name: '*Global.WsxPackManager*', type: app, unregister: true, weight: 50}
# MicrosoftWindows.Client.Core_cw5n1h2txyewy
- !appx: {name: '*Global.BackupBanner*', type: app, weight: 50}
- !appx: {name: '*Global.BackupBanner*', type: app, unregister: true, weight: 50}

- !writeStatus: {status: "Removing DevHome"}
- !appx: {name: '*DevHome*', type: family, option: "remove-uwp-devhome", weight: 10}

- !writeStatus: {status: "Removing Windows Backup"}
- !appx: {name: '*WindowsBackup*', type: app, option: "remove-uwp-wbackup", weight: 10}
- !appx: {name: '*WindowsBackup*', type: app, unregister: true, option: "remove-uwp-wbackup", weight: 10}
23 changes: 12 additions & 11 deletions src/Configuration/features/revision/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Applies some Revision configurations
privilege: TrustedInstaller
actions:

- !writeStatus: {status: "Configuring general settings"}
- !writeStatus: {status: "Finalizing process"}
- !registryValue: {path: 'HKCU\System\GameConfigStore', value: 'GameDVR_FSEBehaviorMode', type: REG_DWORD, data: '0', weight: 70}
- !registryValue: {path: 'HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications', value: 'GlobalUserDisabled', type: REG_DWORD, data: '1', weight: 60}

Expand All @@ -17,14 +17,6 @@ actions:
args: '-NoP -ExecutionPolicy Bypass -File SVCGROUP.ps1'
weight: 50

- !writeStatus: {status: "Optimizing PowerShell"}
- !run:
exeDir: true
exe: "PowerShell"
args: '-NoP -ExecutionPolicy Bypass -File ngen.ps1'
weight: 100

- !writeStatus: {status: "Finalizing process"}
- !run: {exeDir: true, exe: "FINALIZE.cmd", weight: 200}

- !run:
Expand All @@ -44,7 +36,7 @@ actions:
option: "configure-wallpaper"
weight: 90

- !writeStatus: {status: "Removing temporary files"}
- !writeStatus: {status: "Removing logs"}
- !run:
exeDir: true
exe: "PowerShell"
Expand All @@ -69,7 +61,16 @@ actions:
- !appx: {operation: clearCache, name: '*XboxIdentityProvider*'}
- !appx: {operation: clearCache, name: '*XboxSpeechToTextOverlay*'}


- !run:
exe: "explorer.exe"
runas: currentUser

- !taskKill: {name: "explorer", ignoreErrors: true}

- !cmd:
exeDir: true
command: 'copy /y %WINDIR%\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\appxmanifest.xml.og %WINDIR%\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\appxmanifest.xml'
weight: 10

# Start as user process to prevent weird look due to running as TrustedInstaller
# - !run: {baseDir: true, exe: "NSudoLC.exe", args: '-U:C -UseCurrentConsole explorer.exe'}
Loading

0 comments on commit dbfaf47

Please sign in to comment.