]> vilimpoc.org git repositories - dotfiles/blobdiff - setup-windows-no-uac.ps1
dotfiles: put .local\bin on the user PATH, and skip VirtualBox in a VM
[dotfiles] / setup-windows-no-uac.ps1
index b048ec3770de382e61a87f14e6036b2959521090..0e9c7d48d2bb14bb6ba6db099cc60847fbe44366 100644 (file)
@@ -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) {