Fix install.bat — supprime tous les && chainés qui crashent batch
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) <noreply@anthropic.com>
This commit is contained in:
76
install.bat
76
install.bat
@@ -65,8 +65,17 @@ if not exist "%INSTALL_DIR%\temp" mkdir "%INSTALL_DIR%\temp"
|
|||||||
echo.
|
echo.
|
||||||
echo [1/7] Git...
|
echo [1/7] Git...
|
||||||
set "GIT_CMD="
|
set "GIT_CMD="
|
||||||
where git >nul 2>&1 && set "GIT_CMD=git" && echo [OK] Git systeme && goto INSTALL_STEP2
|
where git >nul 2>&1
|
||||||
if exist "%INSTALL_DIR%\git\cmd\git.exe" set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe" && echo [OK] Git portable && goto INSTALL_STEP2
|
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...
|
echo Telechargement de Git portable...
|
||||||
if not exist "%INSTALL_DIR%\git" mkdir "%INSTALL_DIR%\git"
|
if not exist "%INSTALL_DIR%\git" mkdir "%INSTALL_DIR%\git"
|
||||||
@@ -91,9 +100,23 @@ echo [OK] Git portable installe
|
|||||||
echo.
|
echo.
|
||||||
echo [2/7] Python...
|
echo [2/7] Python...
|
||||||
set "PYTHON_CMD="
|
set "PYTHON_CMD="
|
||||||
where python >nul 2>&1 && set "PYTHON_CMD=python" && echo [OK] Python systeme && goto INSTALL_STEP3
|
if exist "%PYTHON_DIR%\python.exe" (
|
||||||
where py >nul 2>&1 && set "PYTHON_CMD=py" && echo [OK] py launcher && goto INSTALL_STEP3
|
set "PYTHON_CMD=%PYTHON_DIR%\python.exe"
|
||||||
if exist "%PYTHON_DIR%\python.exe" set "PYTHON_CMD=%PYTHON_DIR%\python.exe" && echo [OK] Python embarque && goto INSTALL_STEP3
|
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%...
|
echo Telechargement de Python %PYTHON_VERSION%...
|
||||||
if not exist "%PYTHON_DIR%" mkdir "%PYTHON_DIR%"
|
if not exist "%PYTHON_DIR%" mkdir "%PYTHON_DIR%"
|
||||||
@@ -245,26 +268,43 @@ if not exist "%APP_DIR%\main.py" (
|
|||||||
|
|
||||||
:: Trouver Git
|
:: Trouver Git
|
||||||
set "GIT_CMD="
|
set "GIT_CMD="
|
||||||
where git >nul 2>&1 && set "GIT_CMD=git"
|
where git >nul 2>&1
|
||||||
if not defined GIT_CMD if exist "%INSTALL_DIR%\git\cmd\git.exe" set "GIT_CMD=%INSTALL_DIR%\git\cmd\git.exe"
|
if %ERRORLEVEL%==0 (
|
||||||
if not defined GIT_CMD (
|
set "GIT_CMD=git"
|
||||||
echo [ERREUR] Git introuvable. Utilisez l'option 3 (Reparer).
|
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
|
pause
|
||||||
goto MENU
|
goto MENU
|
||||||
)
|
)
|
||||||
echo [OK] Git: %GIT_CMD%
|
|
||||||
|
|
||||||
:: Trouver Python
|
:: Trouver Python
|
||||||
set "PYTHON_CMD="
|
set "PYTHON_CMD="
|
||||||
where python >nul 2>&1 && set "PYTHON_CMD=python"
|
if exist "%PYTHON_DIR%\python.exe" (
|
||||||
if not defined PYTHON_CMD where py >nul 2>&1 && set "PYTHON_CMD=py"
|
set "PYTHON_CMD=%PYTHON_DIR%\python.exe"
|
||||||
if not defined PYTHON_CMD if exist "%PYTHON_DIR%\python.exe" set "PYTHON_CMD=%PYTHON_DIR%\python.exe"
|
echo [OK] Python embarque
|
||||||
if not defined PYTHON_CMD (
|
goto UPDATE_PULL
|
||||||
echo [ERREUR] Python introuvable. Utilisez l'option 3 (Reparer).
|
|
||||||
pause
|
|
||||||
goto MENU
|
|
||||||
)
|
)
|
||||||
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
|
:: Pull
|
||||||
echo.
|
echo.
|
||||||
|
|||||||
Reference in New Issue
Block a user