From 45f8464155d6c60e2b99f5048167ce09adbb64cc Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 5 Aug 2024 11:30:56 +0200 Subject: [PATCH] spns #42665: MeshIO: GMSH and ANSYS - ensure meshio-script bootstraps Python --- products/compil_scripts/meshio-5.3.5.bat | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/products/compil_scripts/meshio-5.3.5.bat b/products/compil_scripts/meshio-5.3.5.bat index 457c21c..49818d9 100644 --- a/products/compil_scripts/meshio-5.3.5.bat +++ b/products/compil_scripts/meshio-5.3.5.bat @@ -14,6 +14,9 @@ cd %SOURCE_DIR% xcopy * %BUILD_DIR%\ /E /I /Q cd %BUILD_DIR% +REM Ensure that meshio is not present. +%PYTHON_ROOT_DIR%\python.exe -m pip uninstall -y meshio + %PYTHON_ROOT_DIR%\python.exe setup.py install if NOT %ERRORLEVEL% == 0 ( echo ERROR on python setup.py @@ -24,5 +27,13 @@ echo. echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt +REM Fix Python path +cd %PYTHONHOME%\Scripts +powershell -Command "(Get-Content meshio-script.py).replace('%PYTHONBIN%','python3.exe') |Set-Content meshio-script.py" +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on powershell command. + exit 3 +) + echo. echo ########## END -- 2.39.2