From c6195a9a39d42cc81baf783294f921c3bb80c3f7 Mon Sep 17 00:00:00 2001 From: Jules Date: Fri, 20 Mar 2026 11:49:39 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20install.bat=20=E2=80=94=20supprime=20tous?= =?UTF-8?q?=20les=20&&=20chain=C3=A9s=20qui=20crashent=20batch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les && sur une ligne avec where/set/goto causent des erreurs de syntaxe en batch Windows. Remplacé par des if/else classiques. Co-Authored-By: Claude Opus 4.6 (1M context) --- install.bat | 76 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/install.bat b/install.bat index 985f653..2511564 100644 --- a/install.bat +++ b/install.bat @@ -65,8 +65,17 @@ if not exist "%INSTALL_DIR%\temp" mkdir "%INSTALL_DIR%\temp" echo. echo [1/7] Git... set "GIT_CMD=" -where git >nul 2>&1 && set "GIT_CMD=git" && echo [OK] Git systeme && goto INSTALL_STEP2 -if exist "%INSTALL_DIR%\git\cmd\git.exe" set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe" && echo [OK] Git portable && goto INSTALL_STEP2 +where git >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "GIT_CMD=git" + echo [OK] Git systeme + goto INSTALL_STEP2 +) +if exist "%INSTALL_DIR%\git\cmd\git.exe" ( + set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe" + echo [OK] Git portable + goto INSTALL_STEP2 +) echo Telechargement de Git portable... if not exist "%INSTALL_DIR%\git" mkdir "%INSTALL_DIR%\git" @@ -91,9 +100,23 @@ echo [OK] Git portable installe echo. echo [2/7] Python... set "PYTHON_CMD=" -where python >nul 2>&1 && set "PYTHON_CMD=python" && echo [OK] Python systeme && goto INSTALL_STEP3 -where py >nul 2>&1 && set "PYTHON_CMD=py" && echo [OK] py launcher && goto INSTALL_STEP3 -if exist "%PYTHON_DIR%\python.exe" set "PYTHON_CMD=%PYTHON_DIR%\python.exe" && echo [OK] Python embarque && goto INSTALL_STEP3 +if exist "%PYTHON_DIR%\python.exe" ( + set "PYTHON_CMD=%PYTHON_DIR%\python.exe" + echo [OK] Python embarque + goto INSTALL_STEP3 +) +where python >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "PYTHON_CMD=python" + echo [OK] Python systeme + goto INSTALL_STEP3 +) +where py >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "PYTHON_CMD=py" + echo [OK] py launcher + goto INSTALL_STEP3 +) echo Telechargement de Python %PYTHON_VERSION%... if not exist "%PYTHON_DIR%" mkdir "%PYTHON_DIR%" @@ -245,26 +268,43 @@ if not exist "%APP_DIR%\main.py" ( :: Trouver Git set "GIT_CMD=" -where git >nul 2>&1 && set "GIT_CMD=git" -if not defined GIT_CMD if exist "%INSTALL_DIR%\git\cmd\git.exe" set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe" -if not defined GIT_CMD ( - echo [ERREUR] Git introuvable. Utilisez l'option 3 (Reparer). +where git >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "GIT_CMD=git" + echo [OK] Git systeme +) else if exist "%INSTALL_DIR%\git\cmd\git.exe" ( + set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe" + echo [OK] Git portable +) else ( + echo [ERREUR] Git introuvable. Utilisez l'option 3 ^(Reparer^). pause goto MENU ) -echo [OK] Git: %GIT_CMD% :: Trouver Python set "PYTHON_CMD=" -where python >nul 2>&1 && set "PYTHON_CMD=python" -if not defined PYTHON_CMD where py >nul 2>&1 && set "PYTHON_CMD=py" -if not defined PYTHON_CMD if exist "%PYTHON_DIR%\python.exe" set "PYTHON_CMD=%PYTHON_DIR%\python.exe" -if not defined PYTHON_CMD ( - echo [ERREUR] Python introuvable. Utilisez l'option 3 (Reparer). - pause - goto MENU +if exist "%PYTHON_DIR%\python.exe" ( + set "PYTHON_CMD=%PYTHON_DIR%\python.exe" + echo [OK] Python embarque + goto UPDATE_PULL ) -echo [OK] Python: %PYTHON_CMD% +where python >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "PYTHON_CMD=python" + echo [OK] Python systeme + goto UPDATE_PULL +) +where py >nul 2>&1 +if %ERRORLEVEL%==0 ( + set "PYTHON_CMD=py" + echo [OK] py launcher + goto UPDATE_PULL +) +echo [ERREUR] Python introuvable. Utilisez l'option 3 ^(Reparer^). +pause +goto MENU + +:UPDATE_PULL :: Pull echo.