X-Git-Url: https://vilimpoc.org/repos/dotfiles/blobdiff_plain/4776737b67f1d3e04d18dc4622e7bfb120f74e11..325b494c6241dcc4dc1cb7436ee84ac105b318eb:/setup-windows-no-uac.ps1 diff --git a/setup-windows-no-uac.ps1 b/setup-windows-no-uac.ps1 index b048ec3..0e9c7d4 100644 --- a/setup-windows-no-uac.ps1 +++ b/setup-windows-no-uac.ps1 @@ -11,6 +11,8 @@ elevated would configure the *administrator's* profile instead of yours. What this installs / configures: + - %USERPROFILE%\.local\bin on the user PATH: where Claude Code's native + installer puts claude.exe, and nothing else guarantees it is on the PATH - WinMerge on the user PATH (x64 only) - vswhere.exe on the user PATH: the Visual Studio installer puts it in %ProgramFiles(x86)%\Microsoft Visual Studio\Installer, which nothing adds @@ -167,6 +169,22 @@ function Add-ToUserPath { } } +function Add-LocalBinToUserPath { + # %USERPROFILE%\.local\bin is where Claude Code's native installer puts + # claude.exe (see setup-windows.bat). The installer only prints a reminder + # when the directory is not on the PATH, and it is the per-user bin + # directory other tools reach for too, so put it there regardless and create + # it if it is missing - an entry for a directory that is not there yet would + # only be dead until something fills it. + Write-Step '%USERPROFILE%\.local\bin on the user PATH' + $dir = Join-Path $env:USERPROFILE '.local\bin' + if (-not (Test-Path $dir)) { + New-Item -ItemType Directory -Path $dir | Out-Null + Write-Host " Created $dir." + } + Add-ToUserPath $dir +} + function Add-WinMergeToUserPath { Write-Step 'WinMerge on the user PATH' $candidates = @( @@ -1119,6 +1137,7 @@ if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:: # ArchAudit last on purpose: it reports on what the steps before it (and the # winget installs in setup-windows.bat) actually put on the box. $steps = @{ + LocalBinPath = { Add-LocalBinToUserPath } WinMergePath = { Add-WinMergeToUserPath } VsWhere = { Add-VsWhereToUserPath } BinSkim = { Install-BinSkim } @@ -1148,7 +1167,8 @@ if ($unbacked -or $unlisted) { # step of the same name; still accepted. $plan = @(Resolve-SetupSelection -Steps $catalog ` -Only $(if ($PSBoundParameters.ContainsKey('Only')) { $Only } else { $null }) -Skip $Skip ` - -Aliases @{ WinMerge = 'WinMergePath' } -IsArm64 $IsArm64) + -Aliases @{ WinMerge = 'WinMergePath' } -IsArm64 $IsArm64 ` + -VirtualMachine (Get-SetupVirtualMachine)) Write-SetupPlan $plan 'Plan for setup-windows-no-uac.ps1' $runCount = @($plan | Where-Object Selected).Count if ($runCount -eq 0) {