From 10ceab0f8799289fdcab10fef8036a4ebfbad144 Mon Sep 17 00:00:00 2001 From: Danny Tsai Date: Wed, 14 Aug 2024 14:17:43 +0800 Subject: [PATCH 1/2] Update MSET9-Windows.bat Try to check common python launcher path to avoid missing PATH issue --- MSET9_installer_script/MSET9-Windows.bat | 30 +++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/MSET9_installer_script/MSET9-Windows.bat b/MSET9_installer_script/MSET9-Windows.bat index a7929bf..25ca389 100644 --- a/MSET9_installer_script/MSET9-Windows.bat +++ b/MSET9_installer_script/MSET9-Windows.bat @@ -1,12 +1,24 @@ @echo off chcp 65001 > nul -py -V > nul -if %errorlevel% NEQ 0 ( - echo Python 3 is not installed. - echo Please install Python 3 and try again. - echo https://www.python.org/downloads/ - echo. - pause - exit + +set PY1="py" +set PY2="%WINDIR%\py" +set PY3="%LOCALAPPDATA%\Programs\Python\Launcher\py" + +setlocal enableDelayedExpansion +for /l %%x in (1, 1, 3) do ( + set PY=!PY%%x! + !PY! -V > nul 2> nul + if !errorlevel! EQU 0 goto found ) -py -3 mset9.py \ No newline at end of file +endlocal + +echo Python 3 is not installed. +echo Please install Python 3 and try again. +echo https://www.python.org/downloads/ +echo. +pause +exit + +:found +%PY% -3 mset9.py From 3a34d00b741c23f4aca987ce5408fc2641c1c4c1 Mon Sep 17 00:00:00 2001 From: Danny Tsai Date: Mon, 16 Sep 2024 01:55:48 +0800 Subject: [PATCH 2/2] Add pause when python error out --- MSET9_installer_script/MSET9-Windows.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/MSET9_installer_script/MSET9-Windows.bat b/MSET9_installer_script/MSET9-Windows.bat index 25ca389..307a281 100644 --- a/MSET9_installer_script/MSET9-Windows.bat +++ b/MSET9_installer_script/MSET9-Windows.bat @@ -22,3 +22,4 @@ exit :found %PY% -3 mset9.py +if %errorlevel% NEQ 0 pause