From 73f2b3619c7d562b618a98f3ba54f5695ee26a4e Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:35:25 +0000 Subject: [PATCH 1/2] Initial plan From 78277866659a26d4dd3169cd99ea53fe34a54f87 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:39:15 +0000 Subject: [PATCH 2/2] Simplify newUsers.ps1 idempotency guard (fix issue #1607) Co-authored-by: Stensel8 <102481635+Stensel8@users.noreply.github.com> Agent-Logs-Url: https://github.com/Stensel8/Atlas/sessions/4c46b493-b8cb-4ca0-a495-27baa3f469b1 --- .../Executables/AtlasModules/Scripts/newUsers.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1 b/src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1 index 5cb1690cee..e71c1723a8 100644 --- a/src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1 +++ b/src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1 @@ -1,5 +1,9 @@ -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 +# Guard against re-running on already-configured accounts (e.g., after profile reset) +$sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value +if ((Get-ItemProperty -Path "HKLM:\SOFTWARE\AtlasOS\UserSetup" -Name $sid -ErrorAction SilentlyContinue).$sid -eq 1) { exit } + +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') @@ -51,6 +55,10 @@ $Browser & "$atlasModules\Scripts\taskbarPins.ps1" $Browser Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Value 1 +# Mark setup complete for this SID to prevent re-runs after profile reset +New-Item -Path "HKLM:\SOFTWARE\AtlasOS\UserSetup" -Force | Out-Null +New-ItemProperty -Path "HKLM:\SOFTWARE\AtlasOS\UserSetup" -Name $sid -Value 1 -PropertyType DWord -Force | Out-Null + # Leave -Start-Sleep 5 +Start-Sleep 5 logoff \ No newline at end of file