-
Notifications
You must be signed in to change notification settings - Fork 7
/
VFF-Downloader-for-Dolphin.bat
380 lines (316 loc) · 18.9 KB
/
VFF-Downloader-for-Dolphin.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
::[Bat To Exe Converter]
::
::YAwzoRdxOk+EWAnk
::fBw5plQjdG8=
::YAwzuBVtJxjWCl3EqQJgSA==
::ZR4luwNxJguZRRnk
::Yhs/ulQjdF+5
::cxAkpRVqdFKZSTk=
::cBs/ulQjdF+5
::ZR41oxFsdFKZSDk=
::eBoioBt6dFKZSDk=
::cRo6pxp7LAbNWATEpCI=
::egkzugNsPRvcWATEpSI=
::dAsiuh18IRvcCxnZtBJQ
::cRYluBh/LU+EWAnk
::YxY4rhs+aU+JeA==
::cxY6rQJ7JhzQF1fEqQJQ
::ZQ05rAF9IBncCkqN+0xwdVs0
::ZQ05rAF9IAHYFVzEqQJQ
::eg0/rx1wNQPfEVWB+kM9LVsJDGQ=
::fBEirQZwNQPfEVWB+kM9LVsJDGQ=
::cRolqwZ3JBvQF1fEqQJQ
::dhA7uBVwLU+EWDk=
::YQ03rBFzNR3SWATElA==
::dhAmsQZ3MwfNWATElA==
::ZQ0/vhVqMQ3MEVWAtB9wSA==
::Zg8zqx1/OA3MEVWAtB9wSA==
::dhA7pRFwIByZRRnk
::Zh4grVQjdCSDJH6N4GolKicaeiKkcU2zCrBRzOfs4eaIo0kYRq85d52W/ruCMOga5HnSU7Bg8nVNlscDDR9dbF+tYR15jWFOpmyMOYmZqwqB
::YB416Ek+ZG8=
::
::
::978f952a14a936cc963da21a135fa983
@echo off
setlocal enableextensions
setlocal enableDelayedExpansion
cd /d "%~dp0"
:: ===========================================================================
:: .VFF File Downloader for Dolphin - main script
set version=1.1.1
:: AUTHORS: KcrPL
:: ***************************************************************************
:: Copyright (c) 2020-2022 KcrPL, RiiConnect24 and it's (Lead) Developers
:: ===========================================================================
set last_build=2022/02/20
set at=00:47
:: Unattended mode
:: This script is meant to be running in the background.
if exist update_assistant.bat del /q update_assistant.bat
if exist VFF-Downloader-for-DolphinTEMP.exe (
taskkill /im VFF-Downloader-for-DolphinTEMP.exe /f
del /q VFF-Downloader-for-DolphinTEMP.exe
)
:: Whoops
if exist "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Install.bat" del /q "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Install.bat"
echo Running VFF File Downloader for Dolphin...
if exist update_assistant.bat del /q update_assistant.bat
set /a alternative_curl=0
set /a first_start=0
set /a run_once=0
set /a retry=3
set header=.VFF File Downloader for Dolphin - (C) KcrPL v%version% (Compiled on %last_build% at %at%)
:: Arguments
if "%1"=="-first_start" set /a first_start=1
if "%1"=="-run_once" set /a run_once=1
:: Check for updates -> Download and put the file -> Countdown -> Repeat step 2
::
set /a Update_Activate=1
set /a offlinestorage=0
set FilesHostedOn=https://patcher.rc24.xyz/update/VFF-Downloader-for-Dolphin/v1
set MainFolder=%appdata%\VFF-Downloader-for-Dolphin
set TempStorage=%appdata%\VFF-Downloader-for-Dolphin\internet\temp
set config=%appdata%\VFF-Downloader-for-Dolphin\config
set alternative_curl_path=%MainFolder%\curl.exe
cls
echo %header%
echo ---------------------------------------------------------------------------------------
echo.
goto startup_wait
:startup_wait
if %run_once%==1 goto check_for_update
echo --- [%date%] [%time:~0,8%] The program is probably sitting in the background as startup.
echo Waiting 30 seconds to free CPU resources and continuing.
echo If you can see this, pressing any key will skip the 30 seconds wait time.
call "%windir%\system32\timeout.exe" 30 >NUL
goto check_for_internet
:no_internet_wait
echo --- [%date%] [%time:~0,8%] Error while checking for internet connection - waiting 3 minutes and trying again ---
call "%windir%\system32\timeout.exe" 180>NUL
goto check_for_internet
:check_for_internet
echo --- [%date%] [%time:~0,8%] Checking for Internet connection... ---
curl -s http://www.msftncsi.com/ncsi.txt>NUL
if not %errorlevel%==0 goto no_internet_wait
echo .
echo .
echo .: OK^^!
call :check_rc24_connection
if %errorlevel%==1 goto server_dead
goto check_for_update
:check_rc24_connection
echo.
echo --- [%date%] [%time:~0,8%] Checking connection to RiiConnect24... ---
For /F "Delims=" %%A In ('call curl -f -L -s --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "https://patcher.rc24.xyz/connection_test.txt"') do set "connection_test=%%A"
if not "%connection_test%"=="OK" exit /b 1
set ip_to_ping=patcher.rc24.xyz
for /F "tokens=1-9 delims==< " %%a in ('PING -n 1 -w 2500 %ip_to_ping%') do if "%%h"=="TTL" set network_latency=%%g
echo .
echo .
echo .: OK^^! (%network_latency%)
exit /b 0
:server_dead
echo .
echo .
echo .: Error^^! RiiConnect24 is currently under maintenance or unavailable.
echo Continuing to try, please be patient.
echo Check https://status.rc24.xyz for details.
echo.
echo --- [%date%] [%time:~0,8%] Waiting 180 seconds (3 minutes) ---
call "%windir%\system32\timeout.exe" 180 >NUL
goto check_for_internet
:error_no_work_folder
echo x=MsgBox("There was an error while reading configuration files. Please run Install.bat and reconfigure the program. The program will now exit.",16,"RiiConnect24 .VFF Downloader for Dolphin")>"%appdata%\warning.vbs"
start "" "%appdata%\warning.vbs"
del "%config%\warning.vbs"
exit
:check_for_update
echo.
curl -s ""
if not %errorlevel%==3 set /a alternative_curl=1
echo --- [%date%] [%time:~0,8%] First update check ---
:: Update script.
set updateversion=0.0.0
:: Delete version.txt and whatsnew.txt
if %offlinestorage%==0 if exist "%TempStorage%\version.txt" del "%TempStorage%\version.txt" /q
if %offlinestorage%==0 if exist "%TempStorage%\whatsnew.txt" del "%TempStorage%\whatsnew.txt" /q
if not exist "%TempStorage%" goto error_no_work_folder
:: Commands to download files from server.
if %Update_Activate%==1 if %offlinestorage%==0 if %alternative_curl%==0 call curl -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/whatsnew_vff_downloader.txt" --output "%TempStorage%\whatsnew.txt"
if %Update_Activate%==1 if %offlinestorage%==0 if %alternative_curl%==0 call curl -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/version_vff_downloader.txt" --output "%TempStorage%\version.txt"
if %Update_Activate%==1 if %offlinestorage%==0 if %alternative_curl%==1 call %alternative_curl_path% -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/whatsnew_vff_downloader.txt" --output "%TempStorage%\whatsnew.txt"
if %Update_Activate%==1 if %offlinestorage%==0 if %alternative_curl%==1 call %alternative_curl_path% -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/version_vff_downloader.txt" --output "%TempStorage%\version.txt"
set /a temperrorlev=%errorlevel%
set /a updateserver=1
::Bind exit codes to errors here
if "%temperrorlev%"=="6" goto no_internet_connection
if not %temperrorlev%==0 set /a updateserver=0
if exist "%TempStorage%\version.txt`" ren "%TempStorage%\version.txt`" "version.txt"
if exist "%TempStorage%\whatsnew.txt`" ren "%TempStorage%\whatsnew.txt`" "whatsnew.txt"
:: Copy the content of version.txt to variable.
if exist "%TempStorage%\version.txt" set /p updateversion=<"%TempStorage%\version.txt"
if not exist "%TempStorage%\version.txt" set /a updateavailable=0
if %Update_Activate%==1 if exist "%TempStorage%\version.txt" set /a updateavailable=1
:: If version.txt doesn't match the version variable stored in this batch file, it means that update is available.
if %updateversion%==%version% set /a updateavailable=0
if %Update_Activate%==1 if %updateavailable%==1 set /a updateserver=2
if %Update_Activate%==1 if %updateavailable%==1 goto run_update
goto read_config
:run_update
if %alternative_curl%==0 curl -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "https://patcher.rc24.xyz/update/RiiConnect24-Patcher/v1/UPDATE/update_assistant.bat" --output "update_assistant.bat"
if %alternative_curl%==1 %alternative_curl_path% -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "https://patcher.rc24.xyz/update/RiiConnect24-Patcher/v1/UPDATE/update_assistant.bat" --output "update_assistant.bat"
set temperrorlev=%errorlevel%
if not %temperrorlev%==0 goto error_updating
if "%run_once%"=="0" start "" update_assistant.bat -VFF_Downloader_Main_Exec
if "%run_once%"=="1" start "" update_assistant.bat -VFF_Downloader_Main_Exec -run_once
exit
:error_updating
::echo [%date%] [%time:~0,5%] ERROR: Updating failed with exit code: %temperrorlev%>>"%MainFolder%\log.txt"
goto read_config
:error_cannot_copy
if not %retry%==0 set /a retry=%retry%-1
if /i %retry% GTR 0 goto download_files
echo x=MsgBox("There was an error while copying files. This may happen due to incorrect configuration. Please run Install.bat and reconfigure the program. The program will now exit. Error code - %temperrorlev%",16,"RiiConnect24 .VFF Downloader for Dolphin")>"%appdata%\warning.vbs"
start "" "%appdata%\warning.vbs"
del "%config%\warning.vbs"
exit
:read_config
echo --- [%date%] [%time:~0,8%] Reading configuration ---
if not exist "%config%\forecast_region.txt" goto error_config
if not exist "%config%\forecast_language.txt" goto error_config
if not exist "%config%\news_region.txt" goto error_config
if not exist "%config%\evc_country_code.txt" >"%config%\evc_country_code.txt" echo 0
set /p forecast_region=<"%config%\forecast_region.txt"
set /p templanguage=<"%config%\forecast_language.txt"
set forecast_language=%templanguage:~9,1%
set /p news_region=<"%config%\news_region.txt"
set /p evc_country_code=<"%config%\evc_country_code.txt"
set /p dolphin_installation=<"%config%\path_to_install.txt".
goto download_files
:waiting_for_internet
echo No internet connection/could not connect to remote host.
timeout 360 /nobreak >NUL
goto download_files
:error_curl_shutdown
if not %retry%==0 set /a retry=%retry%-1
if /i %retry% GTR 0 goto download_files
echo x=MsgBox("There was an error while downloading files. The program will now exit. Error code - %temperrorlev%",16,"RiiConnect24 .VFF Downloader for Dolphin")>"%appdata%\warning.vbs"
start "" "%appdata%\warning.vbs"
del "%config%\warning.vbs"
exit
:download_files
call :check_rc24_connection
if %errorlevel%==1 goto server_dead
echo.
echo --- [%date%] [%time:~0,8%] Cleaning old files [Forecast Channel] ---
::Clean forecast channel data
if exist "%dolphin_installation%\48414645\data\wc24dl.vff" del /q "%dolphin_installation%\48414645\data\wc24dl.vff"
if exist "%dolphin_installation%\4841464a\data\wc24dl.vff" del /q "%dolphin_installation%\4841464a\data\wc24dl.vff"
if exist "%dolphin_installation%\48414650\data\wc24dl.vff" del /q "%dolphin_installation%\48414650\data\wc24dl.vff"
echo --- [%date%] [%time:~0,8%] Cleaning old files [News Channel] ---
::Clean news channel data
if exist "%dolphin_installation%\48414745\data\wc24dl.vff" del /q "%dolphin_installation%\48414745\data\wc24dl.vff"
if exist "%dolphin_installation%\4841474a\data\wc24dl.vff" del /q "%dolphin_installation%\4841474a\data\wc24dl.vff"
if exist "%dolphin_installation%\48414750\data\wc24dl.vff" del /q "%dolphin_installation%\48414750\data\wc24dl.vff"
echo --- [%date%] [%time:~0,8%] Cleaning old files [Everybody Votes Channel] ---
::Clean EVC data
if exist "%dolphin_installation%\..\00010001\48414a45\data\wc24dl.vff" del /q "%dolphin_installation%\..\00010001\48414a45\data\wc24dl.vff"
if exist "%dolphin_installation%\..\00010001\48414a50\data\wc24dl.vff" del /q "%dolphin_installation%\..\00010001\48414a50\data\wc24dl.vff"
if exist "%dolphin_installation%\..\00010001\48414a4a\data\wc24dl.vff" del /q "%dolphin_installation%\..\00010001\48414a4a\data\wc24dl.vff"
echo.
echo --- [%date%] [%time:~0,8%] Downloading files ---
::Forecast
:: Sending debug info from now on
if %alternative_curl%==0 curl -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %forecast_region% / %forecast_language%" --insecure "http://weather.wii.rc24.xyz/%forecast_language%/%forecast_region%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_forecast.vff"
if %alternative_curl%==1 %alternative_curl_path% -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %forecast_region% / %forecast_language%" --insecure "http://weather.wii.rc24.xyz/%forecast_language%/%forecast_region%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_forecast.vff"
echo Done: 1/3 ^| Forecast Channel
::News
if %alternative_curl%==0 curl -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %news_region%" --insecure "http://news.wii.rc24.xyz/v2/%news_region%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_news.vff"
if %alternative_curl%==1 %alternative_curl_path% -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %news_region%" --insecure "http://news.wii.rc24.xyz/v2/%news_region%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_news.vff"
echo Done: 2/3 ^| News Channel
::EVC
if not "%evc_country_code%"=="0" if not "%evc_country_code%"=="1" if %alternative_curl%==0 curl -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %evc_country_code%" --insecure "http://vt.wii.rc24.xyz/%evc_country_code%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_evc.vff"
if not "%evc_country_code%"=="0" if not "%evc_country_code%"=="1" if %alternative_curl%==1 %alternative_curl_path% -s -S -L --user-agent "VFF-Downloader-for-Dolphin v%version% / %evc_country_code%" --insecure "http://vt.wii.rc24.xyz/%evc_country_code%/wc24dl.vff" --output "%dolphin_installation%\wc24dl_evc.vff"
if "%evc_country_code%"=="0" echo .. EVC Skipping
if "%evc_country_code%"=="1" echo .. EVC Skipping
if not "%evc_country_code%"=="0" if not "%evc_country_code%"=="1" echo Done: 3/3 ^| Everybody Votes Channel
if not exist "%dolphin_installation%\48414645\data" md "%dolphin_installation%\48414645\data"
if not exist "%dolphin_installation%\4841464a\data" md "%dolphin_installation%\4841464a\data"
if not exist "%dolphin_installation%\48414650\data" md "%dolphin_installation%\48414650\data"
if not exist "%dolphin_installation%\48414745\data" md "%dolphin_installation%\48414745\data"
if not exist "%dolphin_installation%\4841474a\data" md "%dolphin_installation%\4841474a\data"
if not exist "%dolphin_installation%\48414750\data" md "%dolphin_installation%\48414750\data"
if not exist "%dolphin_installation%\..\00010001\48414a45\data" md "%dolphin_installation%\..\00010001\48414a45\data"
if not exist "%dolphin_installation%\..\00010001\48414a50\data" md "%dolphin_installation%\..\00010001\48414a50\data"
if not exist "%dolphin_installation%\..\00010001\48414a4a\data" md "%dolphin_installation%\..\00010001\48414a4a\data"
echo.
echo --- [%date%] [%time:~0,8%] Copying files into directory ---
copy "%dolphin_installation%\wc24dl_forecast.vff" "%dolphin_installation%\48414645\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 1st file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
copy "%dolphin_installation%\wc24dl_forecast.vff" "%dolphin_installation%\4841464a\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 2nd file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
copy "%dolphin_installation%\wc24dl_forecast.vff" "%dolphin_installation%\48414650\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 3rd file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
copy "%dolphin_installation%\wc24dl_news.vff" "%dolphin_installation%\48414745\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 4th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
copy "%dolphin_installation%\wc24dl_news.vff" "%dolphin_installation%\4841474a\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 5th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
copy "%dolphin_installation%\wc24dl_news.vff" "%dolphin_installation%\48414750\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 6th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
if not %evc_country_code%==0 if not %evc_country_code%==1 copy "%dolphin_installation%\wc24dl_evc.vff" "%dolphin_installation%\..\00010001\48414a45\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 7th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
if not %evc_country_code%==0 if not %evc_country_code%==1 copy "%dolphin_installation%\wc24dl_evc.vff" "%dolphin_installation%\..\00010001\48414a50\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 8th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
if not %evc_country_code%==0 if not %evc_country_code%==1 copy "%dolphin_installation%\wc24dl_evc.vff" "%dolphin_installation%\..\00010001\48414a4a\data\wc24dl.vff"
set /a temperrorlev=%errorlevel%
if not %temperrorlev%==0 echo --- [%date%] [%time:~0,8%] DEBUG: 9th file copy fail - waiting and trying later ---
if not %temperrorlev%==0 goto error_wait
echo --- [%date%] [%time:~0,8%] Delete temporary files ---
del /q "%dolphin_installation%\wc24dl_news.vff"
del /q "%dolphin_installation%\wc24dl_forecast.vff"
if not %evc_country_code%==0 if not %evc_country_code%==1 del /q "%dolphin_installation%\wc24dl_evc.vff"
if %first_start%==1 echo x=MsgBox("First configuration is done. Please run Dolphin and check for yourself :)",64,"RiiConnect24 .VFF Downloader for Dolphin")>"%appdata%\warning.vbs"
if %first_start%==1 start "" "%appdata%\warning.vbs"
if %first_start%==1 set /a first_start=0
set last_hour_download=%time:~0,2%
set /a already_checked_this_hour=1
if %run_once%==1 echo x=MsgBox("Done successfully - the program will now exit.",64,"RiiConnect24 .VFF Downloader for Dolphin"^)>"%appdata%\warning.vbs"
if %run_once%==1 start "" "%appdata%\warning.vbs"
if %run_once%==1 exit
::Reset retry counter
title %retry%
set /a retry=3
goto count_time
:count_time
if not "%last_hour_download%"=="%time:~0,2%" set /a already_checked_this_hour=0
if %already_checked_this_hour%==0 if /i "%time:~3,2%" GEQ "10" goto download_files
echo --- [%date%] [%time:~0,8%] Waiting 600 seconds (10 minutes) ---
call "%windir%\system32\timeout.exe" 600 /nobreak >NUL
echo --- [%date%] [%time:~0,8%] Checking for update ---
::Check for update
if %alternative_curl%==0 call curl -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/version_vff_downloader.txt" --output "%TempStorage%\version.txt"
if %alternative_curl%==1 call %alternative_curl_path% -s -S --user-agent "VFF-Downloader-for-Dolphin v%version%" --insecure "%FilesHostedOn%/UPDATE/version_vff_downloader.txt" --output "%TempStorage%\version.txt"
if exist "%TempStorage%\version.txt" set /p updateversion=<"%TempStorage%\version.txt"
if not %updateversion%==%version% goto run_update
echo --- [%date%] [%time:~0,8%] Done checking for update ---
goto count_time
:error_wait
echo --- [%date%] [%time:~0,8%] Waiting 180 seconds (3 minutes) ---
call "%windir%\system32\timeout.exe" 180 /nobreak >NUL
goto download_files