Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Atlas-OS/Atlas into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Sep 18, 2023
2 parents 5eb7072 + d5d4669 commit 6d9e58a
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function light_mode {
}
}
# Checks the system "app" color (light or dark)
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\"
$registryPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize\"
$keyName = "AppsUseLightTheme"
function check_system_theme{
if(((Get-ItemProperty -Path $registryPath -Name $keyName).$keyName) -eq 0){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ if ($LASTEXITCODE -eq 1) {
} | Enable-NetFirewallRule

# Set up network connected devices automatically
New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Force -EA SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" -Value 1 | Out-Null
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Force -EA SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" -Value 1 | Out-Null
}

choice /c:yn /n /m "Would you like to add the Network Navigation Pane to the Explorer sidebar? [Y/N] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if !errorlevel! NEQ 0 (
)

echo Creating the Start menu shortcut...
PowerShell -NoP -C "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("""$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Process Explorer.lnk"""); $Shortcut.TargetPath = """$env:WinDir\AtlasModules\Apps\ProcessExplorer\procexp.exe"""; $Shortcut.Save()" > nul
PowerShell -NoP -C "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("""$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Process Explorer.lnk"""); $Shortcut.TargetPath = """$env:windir\AtlasModules\Apps\ProcessExplorer\procexp.exe"""; $Shortcut.Save()" > nul
if not errorlevel 0 (
echo Process Explorer shortcut could not be created in the start menu^^!
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ param (

# https://learn.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity#validate-enabled-vbs-and-memory-integrity-features

$memIntegrity = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity"
$kernelShadowStacks = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\KernelShadowStacks"
$credentialGuard = "HKLM:\System\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard"
$memIntegrity = "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity"
$kernelShadowStacks = "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\KernelShadowStacks"
$credentialGuard = "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard"

if ($DisableAllVBS) {
Write-Warning "Disabling VBS features..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if ($null -eq $packages) {$DefenderEnabled = '(current)'} else {$DefenderDisable

function SetSafeMode {
Start-Process -File 'bcdedit' -ArgumentList '/set {current} safeboot minimal' -WindowStyle Hidden
Set-ItemProperty -Path $winlogon -Name Shell -Value "$env:WinDir\AtlasDesktop\7. Security\Defender\Toggle Defender.cmd -SafeMode"
Set-ItemProperty -Path $winlogon -Name Shell -Value "$env:windir\AtlasDesktop\7. Security\Defender\Toggle Defender.cmd -SafeMode"
Restart-Computer
exit
}
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/AtlasModules/Scripts/RunAsTI.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function RunAsTI ($cmd,$arg) { $id='RunAsTI'; $key="Registry::HKU\$(((whoami /us
F 'CreateProcess' $Run; return}; $env:R=''; rp $key $id -force; $priv=[diagnostics.process]."GetM`ember"('SetPrivilege',42)[0]
'SeSecurityPrivilege','SeTakeOwnershipPrivilege','SeBackupPrivilege','SeRestorePrivilege' |% {$priv.Invoke($null, @("$_",2))}
$HKU=[uintptr][uint32]2147483651; $NT='S-1-5-18'; $reg=($HKU,$NT,8,2,($HKU -as $D[9])); F 'RegOpenKeyEx' $reg; $LNK=$reg[4]
function L ($1,$2,$3) {sp 'HKLM:\Software\Classes\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}' 'RunAs' $3 -force -ea 0
function L ($1,$2,$3) {sp 'HKLM:\SOFTWARE\Classes\AppID\{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}' 'RunAs' $3 -force -ea 0
$b=[Text.Encoding]::Unicode.GetBytes("\Registry\User\$1"); F 'RegSetValueEx' @($2,'SymbolicLinkValue',0,6,[byte[]]$b,$b.Length)}
function Q {[int](gwmi win32_process -filter 'name="explorer.exe"'|?{$_.getownersid().sid-eq$NT}|select -last 1).ProcessId}
$11bug=($((gwmi Win32_OperatingSystem).BuildNumber)-eq'22000')-AND(($cmd-eq'file:')-OR(test-path -lit $cmd -PathType Container))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if ($CabPaths) {
}
} else {$Silent = $false}

$certRegPath = "HKLM:\Software\Microsoft\SystemCertificates\ROOT\Certificates"
$certRegPath = "HKLM:\SOFTWARE\Microsoft\SystemCertificates\ROOT\Certificates"

function PauseNul ($message = "Press any key to exit... ") {
Write-Host $message -NoNewLine
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/BRAVE.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$tempDir = "$env:WinDir\Temp\$([System.IO.Path]::GetRandomFileName())"
$tempDir = "$env:windir\Temp\$([System.IO.Path]::GetRandomFileName())"
New-Item $tempDir -ItemType Directory -Force

Invoke-WebRequest "https://laptop-updates.brave.com/latest/winx64" -OutFile "$tempDir\BraveSetup.exe" -UseBasicParsing
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/CLEANUP.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Invoke-AtlasDiskCleanup {
# Disk Cleanup preset
# 2 = enabled
# 0 = disabled
$baseKey = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches'
$baseKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches'
$regValues = @{
"Active Setup Temp Folders" = 2
"BranchCache" = 2
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/CLIENTCBS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Made by Xyueta

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

## Remove 'Get started' and 'Windows Backup' from Start Menu
$Manifest = Join-Path $Cbs 'appxmanifest.xml'
Expand Down
5 changes: 1 addition & 4 deletions src/playbook/Executables/FINALIZE.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ for %%a in (
)
)

:: Set correct username variable of the currently logged in user
for /f "tokens=3 delims==\" %%a in ('wmic computersystem get username /value ^| find "="') do set "loggedinUsername=%%a"

:: Hide unnecessary items from the 'Send To' context menu
for %%a in (
"Documents.mydocs"
Expand Down Expand Up @@ -194,7 +191,7 @@ for /f "usebackq tokens=2 delims=\" %%a in (`reg query HKU ^| findstr /r /x /c:"
)

:: Detect hard drive - Solid State Drive (SSD) or Hard Disk Drive (HDD)
for /f %%a in ('PowerShell -NoP -C "(Get-PhysicalDisk -SerialNumber (Get-Disk -Number (Get-Partition -DriveLetter $env:SystemDrive.Substring(0, 1)).DiskNumber).SerialNumber.TrimStart()).MediaType"') do (
for /f %%a in ('PowerShell -NoP -C "(Get-PhysicalDisk -SerialNumber (Get-Disk -Number (Get-Partition -DriveLetter C:.Substring(0, 1)).DiskNumber).SerialNumber.TrimStart()).MediaType"') do (
set "diskDrive=%%a"
)

Expand Down
4 changes: 2 additions & 2 deletions src/playbook/Executables/LIBREWOLF.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ $librewolfUpdaterDownload = (Invoke-RestMethod -Uri "$librewolfUpdaterURI" -Head
Select-Object -ExpandProperty browser_download_url

# output paths
$outputLibrewolf = "$env:systemdrive\$librewolfFileName"
$outputLibrewolfUpdater = "$env:systemdrive\librewolf-winupdater.zip"
$outputLibrewolf = "C:\$librewolfFileName"
$outputLibrewolfUpdater = "C:\librewolf-winupdater.zip"

Write-Warning "Downloading the latest LibreWolf setup"
Invoke-WebRequest -Uri $librewolfDownload -OutFile $outputLibrewolf
Expand Down
28 changes: 14 additions & 14 deletions src/playbook/Executables/REFRESHENV.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
:: modified by Xyueta

:main
echo/@echo off >"%temp%\_env.cmd"
call :GetRegEnv "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" >> "%temp%\_env.cmd"
call :GetRegEnv "HKCU\Environment">>"%temp%\_env.cmd" >> "%temp%\_env.cmd"
call :SetFromReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%temp%\_env.cmd"
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%temp%\_env.cmd"
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%temp%\_env.cmd"
del /f /q "%temp%\_envset.tmp" > nul 2>&1
del /f /q "%temp%\_envget.tmp" > nul 2>&1
echo/@echo off >"%TEMP%\_env.cmd"
call :GetRegEnv "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd"
call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd"
call :SetFromReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd"
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd"
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd"
del /f /q "%TEMP%\_envset.tmp" > nul 2>&1
del /f /q "%TEMP%\_envget.tmp" > nul 2>&1
set "OriginalUserName=%USERNAME%"
set "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%"
call "%temp%\_env.cmd"
del /f /q "%temp%\_env.cmd" > nul 2>&1
call "%TEMP%\_env.cmd"
del /f /q "%TEMP%\_env.cmd" > nul 2>&1
set "USERNAME=%OriginalUserName%"
set "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%"
exit /b

:SetFromReg
reg query "%~1" /v "%~2" > "%temp%\_envset.tmp" 2>NUL
for /f "usebackq skip=2 tokens=2,*" %%a in ("%temp%\_envset.tmp") do (
reg query "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL
for /f "usebackq skip=2 tokens=2,*" %%a in ("%TEMP%\_envset.tmp") do (
echo/set "%~3=%%b"
)
goto :eof

:GetRegEnv
reg query "%~1" > "%temp%\_envget.tmp"
for /f "usebackq skip=2" %%a in ("%temp%\_envget.tmp") do (
reg query "%~1" > "%TEMP%\_envget.tmp"
for /f "usebackq skip=2" %%a in ("%TEMP%\_envget.tmp") do (
if /I not "%%~a"=="Path" (
call :SetFromReg "%~1" "%%~a" "%%~a"
)
Expand Down
6 changes: 3 additions & 3 deletions src/playbook/Executables/SHORTCUTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function New-Shortcut {
$Shortcut.Save()
}

$defaultShortcut = "$env:SystemDrive\Users\Default\Desktop\Atlas.lnk"
New-Shortcut -Icon "$env:WinDir\AtlasModules\Other\atlas-folder.ico,0" -Target "$env:WinDir\AtlasDesktop" -ShortcutPath $defaultShortcut
foreach ($user in $(Get-ChildItem -Path "$env:SystemDrive\Users" -Directory | Where-Object { 'Public' -notcontains $_.Name })) {
$defaultShortcut = "C:\Users\Default\Desktop\Atlas.lnk"
New-Shortcut -Icon "$env:windir\AtlasModules\Other\atlas-folder.ico,0" -Target "$env:windir\AtlasDesktop" -ShortcutPath $defaultShortcut
foreach ($user in $(Get-ChildItem -Path "C:\Users" -Directory | Where-Object { 'Public' -notcontains $_.Name })) {
Copy-Item $defaultShortcut -Destination "$($user.FullName)\Desktop" -Force
}
Copy-Item $defaultShortcut -Destination "$env:ProgramData\Microsoft\Windows\Start Menu\Programs" -Force
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/WINGET.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $progressPreference = 'SilentlyContinue'
$wingetPath = "$env:localappdata\Microsoft\WindowsApps\winget.exe"

# Make temporary directory
$tempDir = Join-Path -Path $env:temp -ChildPath $([System.IO.Path]::GetRandomFileName())
$tempDir = Join-Path -Path $env:TEMP -ChildPath $([System.IO.Path]::GetRandomFileName())
New-Item $tempDir -ItemType Directory -Force | Out-Null

if (!(Get-Command winget -ErrorAction SilentlyContinue)) {$getLatest = $true} else {
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/local-build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if (!($?) -and (Test-Path -Path "$zipFileName")) {
}

# make temp directories
$rootTemp = Join-Path -Path $env:temp -ChildPath $([System.IO.Path]::GetRandomFileName())
$rootTemp = Join-Path -Path $env:TEMP -ChildPath $([System.IO.Path]::GetRandomFileName())
New-Item $rootTemp -ItemType Directory -Force | Out-Null
if (!(Test-Path -Path "$rootTemp")) {
Write-Host "Failed to create temporary directory!" -ForegroundColor Red
Expand Down

0 comments on commit 6d9e58a

Please sign in to comment.