File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ setlocal enabledelayedexpansion
44set " icongray = [7;90m"
55set " iconyellow = [7;33m"
66set " icongreen = [7;32m"
7+ set " iconred = [7;31m"
78set " textgray = [90m"
89set " textgreen = [32m"
910set " textred = [31m"
@@ -58,7 +59,7 @@ if /i "%1"=="--silent" (
5859 echo %icongray% i %formatend% Downloading information...
5960 set " updateFileName = batch_update.json"
6061 curl --silent -L -H " Accept: application/vnd.github+json" -o %updateFileName% https://api.github.com/repos/Adam-Kay/Batch-Encoder/releases/latest
61- rem curl --silent -o batch_update.txt https://gist.githubusercontent.com/Adam-Kay/ec5da0ff40e8eb14beee2242161f5191/raw
62+ if not exist " %updateFileName% " (goto AutoUpdateError)
6263
6364 > %TEMP% \batch_update.tmp findstr " tag_name" %updateFileName%
6465 < %TEMP% \batch_update.tmp set /p " ver_entry = "
@@ -80,6 +81,15 @@ if /i "%1"=="--silent" (
8081 echo Downloading files...
8182 curl --silent -L -H " Accept: application/octet-stream" -o " batch encoder %UpdateVersion% .bat" %UpdateAPIURL%
8283 echo .
84+ if not exist " batch encoder %UpdateVersion% .bat" (
85+ echo %iconred% ^^! %formatend% Download failed. & echo . & echo Attempting alternate download...
86+ curl --silent --ssl-no-revoke -L -H " Accept: application/octet-stream" -o " batch encoder %UpdateVersion% .bat" %UpdateAPIURL%
87+ echo .
88+ if not exist " batch encoder %UpdateVersion% .bat" (
89+ echo %iconred% ^^! %formatend% Alternate download failed.
90+ goto AutoUpdateError
91+ )
92+ )
8393 if " %par_silent% " == " true" (
8494 echo %icongreen% i %formatend% Download complete. The program will now clean up and exit.
8595 ) else (
Original file line number Diff line number Diff line change 77set " icongray = [7;90m"
88set " iconyellow = [7;33m"
99set " icongreen = [7;32m"
10+ set " iconred = [7;31m"
1011set " textgray = [90m"
1112set " textgreen = [32m"
1213set " textred = [31m"
@@ -77,6 +78,7 @@ if defined par_updated-from (
7778 echo %icongray% i %formatend% Downloading information...
7879 set " updateFileName = batch_update.json"
7980 curl --silent -L -H " Accept: application/vnd.github+json" -o %updateFileName% https://api.github.com/repos/Adam-Kay/Batch-Encoder/releases/latest
81+ if not exist " %updateFileName% " (goto AutoUpdateError)
8082
8183 > %TEMP% \batch_update.tmp findstr " tag_name" %updateFileName%
8284 < %TEMP% \batch_update.tmp set /p " ver_entry = "
@@ -119,6 +121,15 @@ if defined par_updated-from (
119121 echo Downloading files...
120122 curl --silent -L -H " Accept: application/octet-stream" -o " batch encoder %UpdateVersion%%append% .bat" %UpdateAPIURL%
121123 echo .
124+ if not exist " batch encoder %UpdateVersion%%append% .bat" (
125+ echo %iconred% ^^! %formatend% Download failed. & echo . & echo Attempting alternate download...
126+ curl --silent --ssl-no-revoke -L -H " Accept: application/octet-stream" -o " batch encoder %UpdateVersion%%append% .bat" %UpdateAPIURL%
127+ echo .
128+ if not exist " batch encoder %UpdateVersion%%append% .bat" (
129+ echo %iconred% ^^! %formatend% Alternate download failed.
130+ goto AutoUpdateError
131+ )
132+ )
122133 echo %icongreen% i %formatend% Download complete. The program will now clean up and restart.
123134 call :GrayPause
124135 del " %updateFileName% "
You can’t perform that action at this time.
0 commit comments