Skip to content
Snippets Groups Projects
Commit 5643c33d authored by Boris Basic's avatar Boris Basic
Browse files

Use a better method to set TELEMAC-MASCARET Python as the default one

parent 960c0cf9
No related branches found
No related tags found
No related merge requests found
......@@ -14,31 +14,24 @@ set SYSTELCFG=%HOMETEL%\configs\systel.edf.cfg
rem Name of the configuration to use
set USETELCFG=win.gnu
rem Add TELEMAC-MASCARET Python to PATH, its modules to PYTHONPATH and set it
rem as the default one by updating the registry and setting-up a py.ini local
rem file. This file will need to be removed manually to restore the default
rem Python version, if any.
rem Add Python to PATH, its modules to PYTHONPATH and set it as the
rem default one to launch Python scripts from the command line
setlocal enabledelayedexpansion
set python=python-3.7.9
endlocal & (
set "PATH=%TELEMACDEPS%\%python%;%TELEMACDEPS%\%python%\Scripts;%PATH%"
set "PYTHONPATH=%TELEMACDEPS%\%python%\Lib\site-packages"
reg add HKCU\SOFTWARE\Python\PythonCore\3.7_otm\InstallPath /ve /d %TELEMACDEPS%\%python% /f 1>null
reg add HKCU\SOFTWARE\Python\PythonCore\3.7_otm\InstallPath /v ExecutablePath /d %TELEMACDEPS%\%python%\python.exe /f 1>null
reg delete HKCU\SOFTWARE\Classes\.py\OpenWithProgids /f 1>null
reg add HKCU\SOFTWARE\Classes\.py\shell\open\command /ve /f /d "%TELEMACDEPS%\%python%\python.exe \"%%1\" %%*" 1>null
)
(
echo [defaults]
echo python=3.7_otm
echo python3=3.7_otm
) > %LOCALAPPDATA%\py.ini
rem Add Mingw to PATH if found
rem Add Mingw to PATH is it is found
call :find_mingw
rem Add TELEMAC binaries and scripts directories to PATH
rem Add TELEMAC binaries directory to PATH
set PATH=%HOMETEL%\builds\%USETELCFG%\lib;%PATH%
rem Add TELEMAC Python scripts to PATH and to Python environment
set PATH=%HOMETEL%\scripts\python3;%PATH%
rem Add TELEMAC Python scripts to the Python environment
set PYTHONPATH=%HOMETEL%\scripts\python3;%PYTHONPATH%
set PYTHONPATH=%HOMETEL%\builds\%USETELCFG%\wrap_api\lib;%PYTHONPATH%
......
......@@ -14,31 +14,24 @@ set SYSTELCFG=%HOMETEL%\configs\systel.edf.cfg
rem Name of the configuration to use
set USETELCFG=win.gnu.debug
rem Add TELEMAC-MASCARET Python to PATH, its modules to PYTHONPATH and set it
rem as the default one by updating the registry and setting-up a py.ini local
rem file. This file will need to be removed manually to restore the default
rem Python version, if any.
rem Add Python to PATH, its modules to PYTHONPATH and set it as the
rem default one to launch Python scripts from the command line
setlocal enabledelayedexpansion
set python=python-3.7.9
endlocal & (
set "PATH=%TELEMACDEPS%\%python%;%TELEMACDEPS%\%python%\Scripts;%PATH%"
set "PYTHONPATH=%TELEMACDEPS%\%python%\Lib\site-packages"
reg add HKCU\SOFTWARE\Python\PythonCore\3.7_otm\InstallPath /ve /d %TELEMACDEPS%\%python% /f 1>null
reg add HKCU\SOFTWARE\Python\PythonCore\3.7_otm\InstallPath /v ExecutablePath /d %TELEMACDEPS%\%python%\python.exe /f 1>null
reg delete HKCU\SOFTWARE\Classes\.py\OpenWithProgids /f 1>null
reg add HKCU\SOFTWARE\Classes\.py\shell\open\command /ve /f /d "%TELEMACDEPS%\%python%\python.exe \"%%1\" %%*" 1>null
)
(
echo [defaults]
echo python=3.7_otm
echo python3=3.7_otm
) > %LOCALAPPDATA%\py.ini
rem Add Mingw to PATH if found
rem Add Mingw to PATH is it is found
call :find_mingw
rem Add TELEMAC binaries and scripts directories to PATH
rem Add TELEMAC binaries directory to PATH
set PATH=%HOMETEL%\builds\%USETELCFG%\lib;%PATH%
rem Add TELEMAC Python scripts to PATH and to Python environment
set PATH=%HOMETEL%\scripts\python3;%PATH%
rem Add TELEMAC Python scripts to the Python environment
set PYTHONPATH=%HOMETEL%\scripts\python3;%PYTHONPATH%
set PYTHONPATH=%HOMETEL%\builds\%USETELCFG%\wrap_api\lib;%PYTHONPATH%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment