diff --git a/QuestToolbox.bat b/QuestToolbox.bat index c84b8af..e1b102a 100644 --- a/QuestToolbox.bat +++ b/QuestToolbox.bat @@ -2,7 +2,7 @@ :: Developed By: :: mitchv2020 and LordNikonUK -set version=v1.5.0 +set version=v1.5.1 ::::::::::::::::::::: :::: FILE CHECKS :::: @@ -878,13 +878,11 @@ goto MainMenu :update cls -echo Opening GitHub page... -:: Opens a browser tab with the latest release -start https://www.github.com/mitchv2020/QuestToolbox/releases/latest +set update=yes +echo Checking for updates... +call checkforupdates.bat goto MainMenu - - :ADBMenu cls echo ADB Options diff --git a/Requirements/checkforupdates.bat b/Requirements/checkforupdates.bat index 240fcad..79d9d5a 100644 --- a/Requirements/checkforupdates.bat +++ b/Requirements/checkforupdates.bat @@ -1,10 +1,14 @@ @echo off + +if "%update%"=="yes" goto updateOption + +:startupCheck curl.exe -s -o "sc.txt" https://api.github.com/repos/mitchv2020/questtoolbox/releases findstr "tag_name" sc.txt > list_of_ver.txt fc list_of_ver.txt list_of_ver_fromdate.txt > nul if errorlevel 1 goto matchFail -:next +::delete temp files del list_of_ver.txt del sc.txt goto continueSetup @@ -13,16 +17,57 @@ pause :matchFail cls echo There is a new version of QuestToolBox available. -echo Do you want to update? (This will be automatic in the future) +echo Do you want to update? (This may be automatic in the future) ::options cmdMenuSel f870 "Yes (Opens default browser)" "No" if "%errorlevel%"=="1" ( + ::delete temp files + del list_of_ver.txt + del sc.txt start https://github.com/mitchv2020/QuestToolbox/releases exit ) if "%errorlevel%"=="2" ( + ::delete temp files del list_of_ver.txt del sc.txt goto continueSetup -) \ No newline at end of file +) + +:updateOption +curl.exe -s -o "sc.txt" https://api.github.com/repos/mitchv2020/questtoolbox/releases +findstr "tag_name" sc.txt > list_of_ver.txt +fc list_of_ver.txt list_of_ver_fromdate.txt > nul +if errorlevel 1 goto updateAvailable + +cls +echo You are using the latest version of QuestToolbox! +del list_of_ver.txt +del sc.txt +pause +exit /b + +:updateAvailable +cls +echo There is a new version of QuestToolBox available. +echo Do you want to update? (This may be automatic in the future) + +::options +cmdMenuSel f870 "Yes (Opens default browser)" "No" +if "%errorlevel%"=="1" ( + ::delete temp files + del list_of_ver.txt + del sc.txt + start https://github.com/mitchv2020/QuestToolbox/releases + exit +) + +if "%errorlevel%"=="2" ( + ::delete temp files + del list_of_ver.txt + del sc.txt + goto MainMenu +) + +set update = none \ No newline at end of file diff --git a/Requirements/list_of_ver_fromdate.txt b/Requirements/list_of_ver_fromdate.txt index 097c3ae..5cdb4ef 100644 --- a/Requirements/list_of_ver_fromdate.txt +++ b/Requirements/list_of_ver_fromdate.txt @@ -1,3 +1,4 @@ + "tag_name": "v1.5.1", "tag_name": "v1.5.0", "tag_name": "v1.4.9", "tag_name": "v1.4.8", @@ -27,4 +28,3 @@ "tag_name": "v1.2.5", "tag_name": "v1.2.4", "tag_name": "v1.2.3", - "tag_name": "v1.2.2",