From c4279d7f05da5e15caf4a8b73b7a4fee430ae4b5 Mon Sep 17 00:00:00 2001 From: samvaio Date: Sun, 5 Mar 2017 02:17:28 +0530 Subject: [PATCH 1/4] music cache always clears on update --- scripts/Latest.bat | 18 +++++++++++------- scripts/Stable.bat | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/Latest.bat b/scripts/Latest.bat index a4f9e15b..aee58b33 100644 --- a/scripts/Latest.bat +++ b/scripts/Latest.bat @@ -65,16 +65,19 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. @@ -136,10 +139,11 @@ ECHO opus.dll downloaded. GOTO end :end ::Normal execution of end of script - TITLE Installation complete! + TITLE NadekoBot Installation complete! CD /D "%root%" RMDIR /S /Q "%installtemp%" >nul 2>&1 ECHO. - ECHO Installation complete, press any key to close this window! - timeout /t 5 - del Latest.bat + ECHO Installation complete! + ECHO. + PAUSE + del Latest.bat \ No newline at end of file diff --git a/scripts/Stable.bat b/scripts/Stable.bat index f55fc958..40673f50 100644 --- a/scripts/Stable.bat +++ b/scripts/Stable.bat @@ -65,16 +65,19 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) 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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. @@ -136,10 +139,11 @@ ECHO opus.dll downloaded. GOTO end :end ::Normal execution of end of script - TITLE Installation complete! + TITLE NadekoBot Installation complete! CD /D "%root%" RMDIR /S /Q "%installtemp%" >nul 2>&1 ECHO. - ECHO Installation complete, press any key to close this window! - timeout /t 5 - del Stable.bat + ECHO Installation complete! + ECHO. + PAUSE + del Latest.bat \ No newline at end of file From ff243f42975cfbca0c8917516590174672c41e67 Mon Sep 17 00:00:00 2001 From: samvaio Date: Sun, 5 Mar 2017 03:34:35 +0530 Subject: [PATCH 2/4] installer updated, no longer uses bitsadmin --- scripts/Latest.bat | 10 ++++++---- scripts/NadekoAutoRun.bat | 10 ++++------ scripts/Stable.bat | 10 ++++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/Latest.bat b/scripts/Latest.bat index aee58b33..01890d9a 100644 --- a/scripts/Latest.bat +++ b/scripts/Latest.bat @@ -75,13 +75,13 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. ECHO bin folder copied... - DEL "%root%NadekoBot_Old\src\NadekoBot\data\musicdata" + RD /S /Q "%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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. - ECHO Old data folder copied to new folder + ECHO Old data folder copied... ::Moves the setup Nadeko folder RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1 ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 @@ -129,12 +129,14 @@ timeout /t 5 ECHO. ECHO Downloading libsodium.dll and opus.dll... SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\libsodium.dll" -bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" ECHO libsodium.dll downloaded. ECHO. timeout /t 5 SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\opus.dll" -bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" ECHO opus.dll downloaded. GOTO end :end diff --git a/scripts/NadekoAutoRun.bat b/scripts/NadekoAutoRun.bat index 90d88f4a..c9d37049 100644 --- a/scripts/NadekoAutoRun.bat +++ b/scripts/NadekoAutoRun.bat @@ -25,13 +25,12 @@ IF ERRORLEVEL 1 GOTO latestar :latestar ECHO Auto Restart and Update with Dev Build (latest) ECHO Bot will auto update on every restart! -timeout /t 3 CD /D %~dp0NadekoBot\src\NadekoBot dotnet run --configuration Release ECHO Updating... -timeout /t 3 SET "FILENAME=%~dp0\Latest.bat" -bitsadmin.exe /transfer "Downloading Nadeko (Latest)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading Nadeko (Latest)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat "%FILENAME%" ECHO NadekoBot Dev Build (latest) downloaded. SET root=%~dp0 CD /D %root% @@ -41,13 +40,12 @@ GOTO latestar :stablear ECHO Auto Restart and Update with Stable Build ECHO Bot will auto update on every restart! -timeout /t 3 CD /D %~dp0NadekoBot\src\NadekoBot dotnet run --configuration Release ECHO Updating... -timeout /t 3 SET "FILENAME=%~dp0\Stable.bat" -bitsadmin.exe /transfer "Downloading Nadeko (Stable)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading Nadeko (Stable)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat "%FILENAME%" ECHO NadekoBot Stable build downloaded. SET root=%~dp0 CD /D %root% diff --git a/scripts/Stable.bat b/scripts/Stable.bat index 40673f50..bde82049 100644 --- a/scripts/Stable.bat +++ b/scripts/Stable.bat @@ -75,13 +75,13 @@ IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. ECHO bin folder copied... - DEL "%root%NadekoBot_Old\src\NadekoBot\data\musicdata" + RD /S /Q "%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 IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) ECHO. - ECHO Old data folder copied to new folder + ECHO Old data folder copied... ::Moves the setup Nadeko folder RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1 ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 @@ -129,12 +129,14 @@ timeout /t 5 ECHO. ECHO Downloading libsodium.dll and opus.dll... SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\libsodium.dll" -bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" ECHO libsodium.dll downloaded. ECHO. timeout /t 5 SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\opus.dll" -bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile %FILENAME%" +::bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" ECHO opus.dll downloaded. GOTO end :end From 9e4cfe2a32c5b4002c8c7dcc1ce5e8f79e861316 Mon Sep 17 00:00:00 2001 From: samvaio Date: Sun, 5 Mar 2017 04:35:55 +0530 Subject: [PATCH 3/4] cleaning --- scripts/Latest.bat | 6 ++---- scripts/NadekoAutoRun.bat | 6 ++---- scripts/Stable.bat | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/Latest.bat b/scripts/Latest.bat index 01890d9a..6460a618 100644 --- a/scripts/Latest.bat +++ b/scripts/Latest.bat @@ -129,14 +129,12 @@ timeout /t 5 ECHO. ECHO Downloading libsodium.dll and opus.dll... SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\libsodium.dll" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile '%FILENAME%'" ECHO libsodium.dll downloaded. ECHO. timeout /t 5 SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\opus.dll" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile '%FILENAME%'" ECHO opus.dll downloaded. GOTO end :end diff --git a/scripts/NadekoAutoRun.bat b/scripts/NadekoAutoRun.bat index c9d37049..c1701c7c 100644 --- a/scripts/NadekoAutoRun.bat +++ b/scripts/NadekoAutoRun.bat @@ -29,8 +29,7 @@ CD /D %~dp0NadekoBot\src\NadekoBot dotnet run --configuration Release ECHO Updating... SET "FILENAME=%~dp0\Latest.bat" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading Nadeko (Latest)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Latest.bat -OutFile '%FILENAME%'" ECHO NadekoBot Dev Build (latest) downloaded. SET root=%~dp0 CD /D %root% @@ -44,8 +43,7 @@ CD /D %~dp0NadekoBot\src\NadekoBot dotnet run --configuration Release ECHO Updating... SET "FILENAME=%~dp0\Stable.bat" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading Nadeko (Stable)" /priority high https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/master/scripts/Stable.bat -OutFile '%FILENAME%'" ECHO NadekoBot Stable build downloaded. SET root=%~dp0 CD /D %root% diff --git a/scripts/Stable.bat b/scripts/Stable.bat index bde82049..26c5c422 100644 --- a/scripts/Stable.bat +++ b/scripts/Stable.bat @@ -129,14 +129,12 @@ timeout /t 5 ECHO. ECHO Downloading libsodium.dll and opus.dll... SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\libsodium.dll" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading libsodium.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/libsodium.dll -OutFile '%FILENAME%'" ECHO libsodium.dll downloaded. ECHO. timeout /t 5 SET "FILENAME=%~dp0\NadekoBot\src\NadekoBot\opus.dll" -powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile %FILENAME%" -::bitsadmin.exe /transfer "Downloading opus.dll" /priority high https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll "%FILENAME%" +powershell -Command "Invoke-WebRequest https://github.com/Kwoth/NadekoBot/raw/dev/src/NadekoBot/_libs/32/opus.dll -OutFile '%FILENAME%'" ECHO opus.dll downloaded. GOTO end :end From e44a2bd384f9903ad8d77eade3ddf9658dad0389 Mon Sep 17 00:00:00 2001 From: samvaio Date: Sun, 5 Mar 2017 05:37:05 +0530 Subject: [PATCH 4/4] fixo --- scripts/Stable.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Stable.bat b/scripts/Stable.bat index 26c5c422..b2f6a9eb 100644 --- a/scripts/Stable.bat +++ b/scripts/Stable.bat @@ -146,4 +146,4 @@ GOTO end ECHO Installation complete! ECHO. PAUSE - del Latest.bat \ No newline at end of file + del Stable.bat \ No newline at end of file