Repository navigation
Description
Description
The Windows installer aborts while cleaning up its temporary directory when $env:TEMP points to an 8.3 short path.
My Windows user profile directory contains a space:
C:\Users\David X
In the affected PowerShell session, the temporary directory resolves through the corresponding short path:
C:\Users\DAVIDX~1\...
The prebuilt binary downloads and passes SHA-256 verification successfully, but the installer then fails at the Remove-Item call in its finally block.
This is the normal prebuilt installation path. I did not use -BuildFromSource.
Steps to reproduce
Run the standard installer in the affected environment:
irm https://jcode.sh/install.ps1 | iexOutput:
PS C:\Users\David X> irm https://jcode.sh/install.ps1 | iex
Fetching latest release...
Installing jcode v0.68.0
launcher: C:\Users\David X\AppData\Local\jcode\bin\jcode.exe
Downloading jcode-windows-x86_64.exe from https://github.com/1jehuang/jcode/releases/download/v0.68.0...
Verified SHA256: jcode-windows-x86_64.exe
Remove-Item:
Line |
1094 | Remove-Item -Path $TempDir -Recurse -Force -ErrorAction SilentlyC …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| An object at the specified path C:\Users\DAVIDX~1 does not exist.
Expected behavior
The installer should complete successfully even when $env:TEMP uses an 8.3 short path.
A failure to clean up the temporary directory should also not abort an otherwise successful installation or prevent subsequent steps such as updating the user PATH.
Cause
The installer creates its temporary directory from $env:TEMP:
$TempDir = Join-Path $env:TEMP "jcode-install-$(Get-Random)"
New-Item -ItemType Directory -Path $TempDir -Force | Out-NullIt later removes that directory directly by path:
finally {
Remove-Item -Path $TempDir -Recurse -Force -ErrorAction SilentlyContinue
}PowerShell has an existing FileSystemProvider bug where Remove-Item -Path can fail to normalize paths under $env:TEMP when an 8.3 short path is involved:
The upstream issue produces essentially the same error:
An object at the specified path C:\Users\XXXXXX~1 does not exist.
Confirmed workaround
Overriding TEMP and TMP with the long path in the current PowerShell process allows the installation to complete successfully:
$oldTemp = $env:TEMP
$oldTmp = $env:TMP
$longTemp = Join-Path $env:LOCALAPPDATA "Temp"
New-Item -ItemType Directory -LiteralPath $longTemp -Force | Out-Null
try {
$env:TEMP = $longTemp
$env:TMP = $longTemp
irm https://jcode.sh/install.ps1 | iex
}
finally {
$env:TEMP = $oldTemp
$env:TMP = $oldTmp
}With this workaround, jcode installs successfully.
Possible fix
The workaround documented in the upstream PowerShell issue is to resolve the item first and pipe the resulting object to Remove-Item:
Get-Item -LiteralPath $TempDir -ErrorAction SilentlyContinue |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinueThis could replace the current direct Remove-Item -Path $TempDir cleanup.
Alternatively, cleanup could use a .NET filesystem API, with cleanup errors handled separately so that they do not abort the remaining installation steps.
Activity
1jehuang commentedon Aug 8, 2026
Fixed on
agent/triage-2026-08-07in commit46173b2a4. Cleanup now resolves the temporary directory withGet-Item -LiteralPathbefore removal, avoiding the PowerShell 8.3-path bug. PowerShell parsing, focused regression checks, and the short-path cleanup exercise pass.--- — Jcode agent (automated triage), on behalf of @1jehuang
1jehuang commentedon Aug 8, 2026
The validated fix is now available for review in #841 on a clean branch based on the public default branch.
--- — Jcode agent (automated triage), on behalf of @1jehuang
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
chore: sync fork with upstream jcode (fresh merge onto current master) (
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)
fix: unblock SDK 1.2.0 runtime refresh (1jehuang#842)