+@rem ---------------------------------------------------------------------------\r
+@rem Can this account elevate? Worked out ONCE, here, because it gates two very\r
+@rem different things: the elevated half far below, and a handful of the "per-user"\r
+@rem winget installs just after this, which are per-user in name only.\r
+@rem\r
+@rem ALREADY - already elevated. IsInRole(Administrator) is false for an admin\r
+@rem running unelevated under UAC, so this means actually elevated,\r
+@rem not merely capable of it.\r
+@rem PROMPT - not elevated, UAC on, so elevation can be requested.\r
+@rem NOLUA - UAC is off machine-wide (EnableLUA = 0) AND this is not an\r
+@rem administrator. Elevation is impossible, not merely declined:\r
+@rem Windows has no prompt to offer. Note that with UAC off,\r
+@rem `Start-Process -Verb RunAs` does not fail - it is silently\r
+@rem ignored, runs the child with the caller's own token, and reports\r
+@rem success, which is why this needs detecting rather than trying.\r
+@rem ---------------------------------------------------------------------------\r
+set "ELEV=PROMPT"\r
+for /f "usebackq tokens=*" %%A in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "$id=[Security.Principal.WindowsIdentity]::GetCurrent(); if (([Security.Principal.WindowsPrincipal]$id).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { 'ALREADY' } elseif ((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -ErrorAction SilentlyContinue).EnableLUA -eq 0) { 'NOLUA' } else { 'PROMPT' }"`) do set "ELEV=%%A"\r
+echo [setup-windows] Elevation: %ELEV%\r
+if "%ELEV%"=="NOLUA" (\r
+ echo [setup-windows] This account cannot elevate ^(UAC off, not an administrator^). Packages that\r
+ echo [setup-windows] need a machine-wide install will be SKIPPED rather than left to fail; details\r
+ echo [setup-windows] at each one, and a summary before the elevated half.\r
+)\r
+\r
+@rem ---------------------------------------------------------------------------\r
+@rem ARM64 is a lean build box, x64 is the full workstation\r
+@rem\r
+@rem The ARM64 machine here is a small VM, and everything it was installing\r
+@rem without a native build was going to run under Prism emulation anyway. So the\r
+@rem two architectures now provision different things on purpose: x64 keeps the\r
+@rem full set, ARM64 installs ONE compiler - MSVC from Visual Studio - and\r
+@rem nothing that merely duplicates it or that exists only as an x64 binary.\r
+@rem\r
+@rem Dropped on ARM64, and where each one is dropped:\r
+@rem Brave.Brave here no ARM64 build; Edge is in-box and native\r
+@rem WinMerge.WinMerge here ARM64 build is machine-scope only\r
+@rem LLVM.LLVM here second Clang, dropped with VS's clang-cl\r
+@rem NASM.NASM here x86/x64 assembler; ARM64 uses MSVC's armasm64\r
+@rem Google.AndroidGPUInspector here x64-only, profiles Android devices\r
+@rem OpenCppCoverage.OpenCppCoverage here x86/x64 only; cannot instrument ARM64 binaries\r
+@rem VS Clang/LLVM component with-uac see $ClangComponents\r
+@rem Windows Driver Kit with-uac see the WDK step\r
+@rem BinSkim no-uac NuGet publishes win-x64 only\r
+@rem\r
+@rem :x64only at the bottom of this file is the one place that decision is\r
+@rem applied, so the skip and its reason land in the log together.\r
+@rem ---------------------------------------------------------------------------\r
+\r