Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Exit early if this SID was already set up — prevents re-running after an accidental profile reset
$sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value
if ((Get-ItemProperty 'HKLM:\SOFTWARE\AtlasOS\UserSetup' -Name $sid -EA SilentlyContinue).$sid -eq 1) { exit }

$windir = [Environment]::GetFolderPath('Windows')
& "$windir\AtlasModules\initPowerShell.ps1"
$atlasDesktop = "$windir\AtlasDesktop"
Expand Down Expand Up @@ -73,6 +77,10 @@ if ([string]::IsNullOrWhiteSpace($browser)) {
& "$atlasModules\Scripts\taskbarPins.ps1" $browser
& reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 1 /f *> $null

# Mark this SID as set up so the guard above triggers on any future re-run
New-Item 'HKLM:\SOFTWARE\AtlasOS\UserSetup' -Force | Out-Null
Set-ItemProperty 'HKLM:\SOFTWARE\AtlasOS\UserSetup' -Name $sid -Value 1 -Type DWord -Force

# Leave
Start-Sleep 5
Start-Sleep 5
logoff
Loading