From ac83365d9602d4a2d4dfd79f221432e599ef95f9 Mon Sep 17 00:00:00 2001 From: xxxigm Date: Fri, 5 Jun 2026 07:21:59 +0700 Subject: [PATCH] fix(install): expand 8.3 short %TEMP% so Windows Node/Electron stages don't abort On a Windows profile whose folder name contains a space (e.g. "First Last"), Windows can expose %TEMP%/%TMP% as an 8.3 short path (C:\Users\FIRST~1.LAS\AppData\Local\Temp). PowerShell's FileSystem provider mishandles the "~1.ext" component when the path reaches a provider cmdlet such as `Tee-Object -FilePath`, throwing: An object at the specified path C:\Users\FIRST~1.LAS does not exist. Every Node/Electron install+build stage streams its log to %TEMP% via Tee-Object, so they all abort with that error (browser-tools npm, Playwright, TUI npm, and the hard-failing desktop build), while the Python/uv stages -- which never write a side log to %TEMP% through a provider cmdlet -- succeed. Normalize %TEMP%/%TMP% to their long form once, up front, so every downstream cmdlet and child process sees a path the provider can resolve. Fixes #39308 --- scripts/install.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 27d30cb31ea..3626d5b0f28 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -122,6 +122,16 @@ function ConvertTo-LongPath { return $Path } +foreach ($tmpVar in @('TEMP', 'TMP')) { + $current = [Environment]::GetEnvironmentVariable($tmpVar) + if ($current) { + $expanded = ConvertTo-LongPath $current + if ($expanded -and $expanded -ne $current) { + Set-Item -Path "Env:$tmpVar" -Value $expanded + } + } +} + # ============================================================================ # Configuration # ============================================================================