music cache always clears on update

This commit is contained in:
samvaio 2017-03-05 02:17:28 +05:30
parent b9673d5918
commit c4279d7f05
2 changed files with 22 additions and 14 deletions

View File

@ -65,16 +65,19 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO Old files backed up to NadekoBot_Old ECHO Old files backed up to NadekoBot_Old...
::Copies the credentials and database from the backed up data to the new folder ::Copies the credentials and database from the backed up data to the new folder
COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO credentials.json copied to new folder ECHO credentials.json copied...
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1 ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO Old bin folder copied to new folder ECHO bin folder copied...
DEL "%root%NadekoBot_Old\src\NadekoBot\data\musicdata"
ECHO.
ECHO music cache cleared...
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1 ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
@ -136,10 +139,11 @@ ECHO opus.dll downloaded.
GOTO end GOTO end
:end :end
::Normal execution of end of script ::Normal execution of end of script
TITLE Installation complete! TITLE NadekoBot Installation complete!
CD /D "%root%" CD /D "%root%"
RMDIR /S /Q "%installtemp%" >nul 2>&1 RMDIR /S /Q "%installtemp%" >nul 2>&1
ECHO. ECHO.
ECHO Installation complete, press any key to close this window! ECHO Installation complete!
timeout /t 5 ECHO.
PAUSE
del Latest.bat del Latest.bat

View File

@ -65,16 +65,19 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall)
ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO Old files backed up to NadekoBot_Old ECHO Old files backed up to NadekoBot_Old...
::Copies the credentials and database from the backed up data to the new folder ::Copies the credentials and database from the backed up data to the new folder
COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO credentials.json copied to new folder ECHO credentials.json copied...
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1 ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
ECHO Old bin folder copied to new folder ECHO bin folder copied...
DEL "%root%NadekoBot_Old\src\NadekoBot\data\musicdata"
ECHO.
ECHO music cache cleared...
ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1 ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1
IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror)
ECHO. ECHO.
@ -136,10 +139,11 @@ ECHO opus.dll downloaded.
GOTO end GOTO end
:end :end
::Normal execution of end of script ::Normal execution of end of script
TITLE Installation complete! TITLE NadekoBot Installation complete!
CD /D "%root%" CD /D "%root%"
RMDIR /S /Q "%installtemp%" >nul 2>&1 RMDIR /S /Q "%installtemp%" >nul 2>&1
ECHO. ECHO.
ECHO Installation complete, press any key to close this window! ECHO Installation complete!
timeout /t 5 ECHO.
del Stable.bat PAUSE
del Latest.bat