Files
aza/APP/spotify-recorder - Kopie/Reset & Neustart.bat
2026-03-25 14:14:07 +01:00

79 lines
1.9 KiB
Batchfile

@echo off
title Spotify Recorder - Reset
cd /d "%~dp0"
echo.
echo ====================================
echo Spotify Recorder - Komplett-Reset
echo ====================================
echo.
echo Alle Python-Prozesse werden beendet
echo und die Umgebung wird neu erstellt.
echo.
echo Druecke eine Taste zum Starten
echo oder schliesse das Fenster zum Abbrechen.
echo.
pause >nul
echo.
echo [1/5] Beende Python-Prozesse...
taskkill /F /IM python.exe >nul 2>&1
taskkill /F /IM pythonw.exe >nul 2>&1
timeout /t 2 /nobreak >nul
echo Fertig.
echo [2/5] Loesche alte Umgebung (venv)...
if exist "venv" (
rmdir /s /q "venv" >nul 2>&1
if exist "venv" (
timeout /t 2 /nobreak >nul
rmdir /s /q "venv" >nul 2>&1
)
if exist "venv" (
echo [!] Einige Dateien konnten nicht geloescht werden.
echo Bitte starte den PC neu und versuche es erneut.
pause
exit /b 1
)
)
echo Fertig.
echo [3/4] Erstelle neue Umgebung...
where python >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo [FEHLER] Python nicht gefunden!
echo Bitte installiere Python von https://www.python.org
echo WICHTIG: "Add Python to PATH" anhaken!
pause
exit /b 1
)
python -m venv venv
if %errorlevel% neq 0 (
echo [FEHLER] Umgebung konnte nicht erstellt werden.
pause
exit /b 1
)
call venv\Scripts\activate.bat
echo Fertig.
echo [4/4] Installiere Pakete...
pip install -r requirements.txt --disable-pip-version-check
if %errorlevel% neq 0 (
echo.
echo [FEHLER] Installation fehlgeschlagen.
echo Hast du eine Internetverbindung?
pause
exit /b 1
)
echo.
echo ====================================
echo Reset abgeschlossen!
echo ====================================
echo.
echo App wird gestartet...
echo.
start "" "%~dp0venv\Scripts\pythonw.exe" "%~dp0main.py"