X-Git-Url: https://vilimpoc.org/repos/dotfiles/blobdiff_plain/d52d627830e8e04a7ccada4b0725474b91281656..95307dbb8d8878588729ec7b6c71fc86f2150620:/setup-windows.bat?ds=inline diff --git a/setup-windows.bat b/setup-windows.bat index a42c118..54d6956 100644 --- a/setup-windows.bat +++ b/setup-windows.bat @@ -6,11 +6,13 @@ @rem --- Non-admin (per-user) winget installs --- winget install Anthropic.ClaudeCode +winget install ar51an.iPerf3 winget install Brave.Brave winget install Git.Git winget install Google.AndroidGPUInspector winget install Microsoft.DotNet.SDK.10 winget install Microsoft.PowerShell Microsoft.Sysinternals.ProcessExplorer Microsoft.Sysinternals.ProcessMonitor Microsoft.Sysinternals.SDelete Microsoft.VisualStudioCode Microsoft.WindowsTerminal +winget install NASM.NASM winget install Oracle.VirtualBox winget install Python.Python.3.13 winget install WinMerge.WinMerge @@ -58,25 +60,10 @@ set "DOTNET_EXE=%ProgramFiles%\dotnet\dotnet.exe" @rem --- Elevated installs (VS2022, WDK, system tools) --- @rem The elevated script runs in its own window and logs to setup-windows-uac.log. @rem -PassThru + $p.ExitCode propagates its real exit code back through to ERRORLEVEL. -@rem -@rem -TraceUser passes YOU across the UAC boundary. Accepting that prompt with an -@rem administrator's credentials runs the elevated half AS that administrator, so -@rem it cannot see whose box this is; the account named here is the one it grants -@rem non-elevated ETW collection rights to (xperf / wpr without a UAC prompt). -@rem -@rem The two values go through the environment, and the quotes the child needs -@rem around them are built in PowerShell as [char]34, so the command line below -@rem contains no embedded quote characters at all. Writing them inline as "".."" -@rem works for ONE argument and quietly breaks at two: the quote-state parsing -@rem swallows everything after the first into the -File value, and the elevated -@rem PowerShell dies with "failed because the file does not have a '.ps1' -@rem extension" and exit code -196608 (0xFFFD0000) before it can log a thing. set "UAC_LOG=%~dp0setup-windows-uac.log" if exist "%UAC_LOG%" del "%UAC_LOG%" -set "UAC_SCRIPT=%~dp0setup-windows-with-uac.ps1" -set "UAC_TRACE_USER=%USERDOMAIN%\%USERNAME%" -powershell -NoProfile -Command "$q = [char]34; $p = Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File',($q + $env:UAC_SCRIPT + $q),'-TraceUser',($q + $env:UAC_TRACE_USER + $q) -Wait -PassThru; exit $p.ExitCode" +powershell -NoProfile -Command "$p = Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','""%~dp0setup-windows-with-uac.ps1""' -Wait -PassThru; exit $p.ExitCode" set "UAC_RC=%ERRORLEVEL%" @rem --- Surface the elevated session's output (its window has already closed) ---