Skip to content

Commit

Permalink
Feat: Reset folder configuration when applying
Browse files Browse the repository at this point in the history
  • Loading branch information
TheyCreeper committed Feb 24, 2025
1 parent 4092627 commit 182c1f4
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/playbook/Configuration/atlas/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ actions:
- !writeStatus: {status: 'Applying default Atlas Folder settings'}
- !powerShell:
command: '.\DEFAULT.ps1'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%

reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /t REG_DWORD /d 1 /f > nul
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "BackgroundAppGlobalToggle" /t REG_DWORD /d 0 /f > nul
if "%~1"=="/silent" exit /b

echo.
echo Background Apps have been disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%

reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /f > nul 2>&1
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "BackgroundAppGlobalToggle" /f > nul 2>&1
if "%~1"=="/silent" exit /b

echo.
echo Background Apps have been enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ fltmc > nul 2>&1 || (
)
exit /b
)

`
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul

powershell -EP Bypass -NoP -File "%script%"
if "%~1"=="/silent" powershell -EP Bypass -NoP -File "%script%" -Silent
if "%~1"=="/silent" exit /b

echo Finished, File Sharing is now disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "NoConnectedUser" /t REG_DWORD /d "1" /f > nul
call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide mobile-devices

if "%~1"=="/silent" exit /b

choice /c:yn /n /m "Would you like to remove the 'Phone Link' app? [Y/N] "
if %errorlevel%==1 powershell -NoP -NonI "Get-AppxPackage -AllUsers Microsoft.YourPhone* | Remove-AppxPackage -AllUsers"

choice /c:yn /n /m "Would you like to disable Store auto-updates? [Y/N] "
if %errorlevel%==1 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /v "AutoDownload" /t REG_DWORD /d "2" /f > nul
if %errorlevel%==2 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /v "AutoDownload" /t REG_DWORD /d "4" /f > nul
if "%~1"=="/silent" exit /b

echo.
echo Phone Link has been disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if not exist "%script%" (
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul

powershell -EP Bypass -NoP -File "%script%" %*
powershell -EP Bypass -NoP -File "%script%" %* -Silent

if "%~1"=="/silent" exit /b

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#Requires -RunAsAdministrator
param (
[switch]$Silent
)

$windir = [Environment]::GetFolderPath('Windows')
& "$windir\AtlasModules\initPowerShell.ps1"
Expand Down Expand Up @@ -78,5 +81,7 @@ Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Para
# Reference: https://blogs.windows.com/windows-insider/2017/04/18/introducing-power-throttling
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" -Name "PowerThrottlingOff" -ErrorAction SilentlyContinue


if ($Silent) { exit }
# Finish
Read-Pause "`nCompleted.`nPress Enter to exit"
11 changes: 8 additions & 3 deletions src/playbook/Executables/DEFAULT.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit
}

$windir = [Environment]::GetFolderPath('Windows')
$folderItems = Get-ChildItem -Path "$windir\AtlasDesktop\*" -File -Recurse
$pattern = "\(default\)\.cmd"

foreach ($script in $folderItems)
{
if ($script.PSChildName -match $pattern){
& $script.FullName /silent
}
if ($script.PSChildName -match $pattern){
#& $script.FullName /silent
Write-Host $script.PSChildName
}
}
1 change: 1 addition & 0 deletions src/playbook/playbook.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Atlas makes your computer snappier and more private with lots of usability impro
<!-- 24H2 -->
<string>26100</string>
</SupportedBuilds>
<UpgradableFrom>0.4.0-0.4.1</UpgradableFrom>
<Requirements>
<Requirement>DefenderToggled</Requirement>
<Requirement>NoAntivirus</Requirement>
Expand Down

0 comments on commit 182c1f4

Please sign in to comment.