1
0
forked from Mirrors/RGSX

correction fichier bat windows

This commit is contained in:
skymike03
2025-07-30 11:47:20 +02:00
parent 5819021da4
commit bcc91f8e03

View File

@@ -9,8 +9,8 @@ echo [%DATE% %TIME%] Démarrage du script >> "%LOG_FILE%"
:: Afficher un message de démarrage
cls
echo Exécution de __main__.py pour Windows...
echo [%DATE% %TIME%] Exécution de __main__.py pour Windows >> "%LOG_FILE%"
echo Exécution de __main__.py pour RetroBat...
echo [%DATE% %TIME%] Exécution de __main__.py pour RetroBat >> "%LOG_FILE%"
:: Définir les chemins relatifs
set TOOLS_FOLDER=..\..\..\system\tools
@@ -110,63 +110,9 @@ if %ERRORLEVEL% equ 0 (
:end
echo Tâche terminée.
echo [%DATE% %TIME%] Tâche terminée avec succès. >> "%LOG_FILE%"
:: Vérifier si Python est installé
echo Vérification de la présence de Python...
where python >nul 2>&1
if %ERRORLEVEL% equ 0 (
echo Python est déjà installé.
python --version
goto :end
)
:: Python non trouvé, procéder au téléchargement
echo Python non trouvé. Téléchargement en cours...
set PYTHON_VERSION=3.13.5
set PYTHON_INSTALLER=python-%PYTHON_VERSION%-amd64.exe
set DOWNLOAD_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER%
:: Créer un dossier temporaire
set TEMP_DIR=%TEMP%\PythonInstall
mkdir "%TEMP_DIR%"
:: Télécharger l'installateur
echo Téléchargement de Python %PYTHON_VERSION%...
powershell -Command "Invoke-WebRequest -Uri %DOWNLOAD_URL% -OutFile %TEMP_DIR%\%PYTHON_INSTALLER%"
:: Vérifier si le téléchargement a réussi
if not exist "%TEMP_DIR%\%PYTHON_INSTALLER%" (
echo Erreur : Échec du téléchargement de l'installateur.
goto :error
)
:: Installer Python
echo Installation de Python...
start /wait "" "%TEMP_DIR%\%PYTHON_INSTALLER%" /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
:: Vérifier si l'installation a réussi
where python >nul 2>&1
if %ERRORLEVEL% equ 0 (
echo Python a été installé avec succès.
python --version
) else (
echo Erreur : L'installation de Python a échoué.
goto :error
)
:: Nettoyage
echo Nettoyage des fichiers temporaires...
rd /s /q "%TEMP_DIR%"
:end
echo Script terminé. Lancement de RGSX
python __main__.py
pause
>>>>>>> d5d5fa0991ce487dc11335a0d27345e48fa2ac4c
exit /b 0
:error
echo Une erreur s'est produite.
echo [%DATE% %TIME%] Une erreur s'est produite. >> "%LOG_FILE%"
rd /s /q "%TEMP_DIR%"
pause
exit /b 1