From bc86a163524e9bbe6f3716df84a541e35d3c1d77 Mon Sep 17 00:00:00 2001 From: Peter Linder <32513411+hanuele@users.noreply.github.com> Date: Wed, 20 May 2026 16:40:11 +0200 Subject: [PATCH] install.bat: fix parens-in-username breaking OTP path expansion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, when %USERPROFILE% contains parentheses (e.g. `PeterLinder(3Txpert)`), four lines in install.bat fail because %tmp_dir% expands inside `if (...)` cmd-batch blocks at parse time — the embedded close-paren terminates the if-block early, producing "syntactisch nicht verarbeitbar" / "syntactically unprocessable" errors before the OTP download even begins. Two complementary fixes match the existing patterns: - Quote the path argument in curl.exe / del (lines 148, 205) — the Elixir-side curl at line 192 was already correctly quoted; this restores symmetry with the OTP-side calls. - Use delayed expansion `!tmp_dir!\!otp_zip!` (lines 150, 194) — both are inside if-blocks where %tmp_dir% would expand at parse time. Delayed expansion expands at execution time, after the parser has already matched the if-block parens. Verified locally on a Windows account with parenthesized username: unpatched `install.bat elixir@latest otp@latest` fails before OTP download; patched version completes both downloads cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) --- install.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.bat b/install.bat index a6e88101c..fd65b83d9 100755 --- a/install.bat +++ b/install.bat @@ -145,9 +145,9 @@ if not exist "%otp_dir%\bin" ( set otp_url=https://github.com/erlang/otp/releases/download/OTP-!otp_version!/%otp_zip% echo downloading !otp_url!... - curl.exe -fsSLo %tmp_dir%\%otp_zip% "!otp_url!" || exit /b 1 + curl.exe -fsSLo "%tmp_dir%\%otp_zip%" "!otp_url!" || exit /b 1 - echo unpacking %tmp_dir%\%otp_zip% + echo unpacking !tmp_dir!\!otp_zip! powershell -NoProfile -Command ^ "$ErrorActionPreference='Stop';" ^ "try {" ^ @@ -191,7 +191,7 @@ if not exist "%elixir_dir%\bin" ( echo downloading !elixir_url!... curl.exe -fsSLo "%tmp_dir%\%elixir_zip%" "!elixir_url!" || exit /b 1 - echo unpacking %tmp_dir%\%elixir_zip% + echo unpacking !tmp_dir!\!elixir_zip! powershell -NoProfile -Command ^ "$ErrorActionPreference='Stop';" ^ "try {" ^ @@ -202,6 +202,6 @@ if not exist "%elixir_dir%\bin" ( " Expand-Archive -LiteralPath '%tmp_dir%\%elixir_zip%' -DestinationPath '%elixir_dir%' -Force" ^ " }" ^ "} catch { Write-Error $_; exit 1 }" - del /f /q %tmp_dir%\%elixir_zip% + del /f /q "%tmp_dir%\%elixir_zip%" ) goto :eof