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 [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.
|
||||
|
||||
Reference in New Issue
Block a user