Skip to content

Commit ab15b97

Browse files
HanSur94claude
andcommitted
fix: always create _arch.txt, not just overwrite if exists
setup.py may fail to create _arch.txt during temp-dir build. Now always creates the file with the real MATLAB bin\win64 path. Uses echo|set /p= to write without trailing newline/space. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d092db4 commit ab15b97

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

install.bat

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,12 @@ if %errorlevel% equ 0 (
284284
echo Continuing with MCP server installation...
285285
) else (
286286
echo [OK] MATLAB Engine API installed.
287-
REM Fix _arch.txt — setup.py wrote the temp path into it, but at runtime
288-
REM the engine needs the real MATLAB bin directory.
289-
set "ARCH_FILE=%VENV_DIR%\Lib\site-packages\matlab\engine\_arch.txt"
290-
if exist "!ARCH_FILE!" (
291-
echo !MATLAB_ROOT!\bin\win64> "!ARCH_FILE!"
292-
echo [OK] Fixed MATLAB engine path to !MATLAB_ROOT!\bin\win64
293-
)
287+
REM Fix _arch.txt — setup.py may have written the temp path or failed to
288+
REM create this file. Create/overwrite it with the real MATLAB bin path.
289+
set "ARCH_DIR=%VENV_DIR%\Lib\site-packages\matlab\engine"
290+
if not exist "!ARCH_DIR!" mkdir "!ARCH_DIR!" 2>nul
291+
echo|set /p="!MATLAB_ROOT!\bin\win64">"!ARCH_DIR!\_arch.txt"
292+
echo [OK] Set MATLAB engine path: !MATLAB_ROOT!\bin\win64
294293
)
295294
REM Clean up — remove junctions first (rd /s /q follows junctions!)
296295
if exist "!ENGINE_TEMP!\bin" rmdir "!ENGINE_TEMP!\bin" >nul 2>nul

0 commit comments

Comments
 (0)