Fix install.bat failing when the user profile path contains a space - #1854
Merged
josevalim merged 1 commit intoSep 23, 2026
Merged
Conversation
`mkdir %tmp_dir% 2>nul` is unquoted, so when %USERPROFILE% contains a space cmd splits it into two arguments and creates the wrong directories. The error is swallowed by 2>nul, so the script continues with a tmp directory that was never created, and the download then fails with a bare `curl: (23) client returned ERROR on write of 16384 bytes`. Every other use of the path variables in this file is already quoted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
|
💚 💙 💜 💛 ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
public/install.batcreates its temp directory with an unquoted path:When
%USERPROFILE%contains a space — e.g.C:\Users\Jane Doe—cmdtreats this as two arguments tomkdirand creates the wrong directories. The resulting error is swallowed by2>nul, so the script carries on with atmp_dirthat does not exist.The first download then fails with an error that gives no hint about the real cause:
curl: (23)isCURLE_WRITE_ERROR— the transfer itself succeeded but the local write failed, becausecurl.exe -fsSLo "%tmp_dir%\%otp_zip%"(correctly quoted) points into a directory that was never created.Fix
Quote the path, matching the rest of the file.
mkdirwas the only unquoted use of these path variables in the script — every other reference (curl.exe -fsSLo,Expand-Archive,del,rmdir,cd /d) is already quoted, which is why this single line was enough to break the install for any profile with a space in the name.Reproduction
On a Windows account whose profile path contains a space:
Fails as above. After manually running
mkdir "$env:USERPROFILE\.elixir-install\tmp", the same command completes successfully.