ProjectArcade

Форк
0
/
build.bat 
734 строки · 19.1 Кб
1
@echo off
2
setlocal EnableDelayedExpansion
3

4
goto:rem
5
---------------------------------------
6
build.bat
7
---------------------------------------
8
This batch script is made to help download all the required software for RetroBat,
9
to set the default configuration and to build the setup from sources.
10
---------------------------------------
11
:rem
12

13
:: ---- BUILDER OPTION ----
14

15
set retrobat_version=6.0.1
16
set retroarch_version=1.16.0
17

18
set get_batgui=0
19
set get_batocera_ports=1
20
set get_bios=1
21
set get_decorations=1
22
set get_default_theme=1
23
set get_emulationstation=1
24
set get_emulators=0
25
set get_lrcores=0
26
set get_retroarch=0
27
set get_retrobat_binaries=1
28
set get_system=1
29
set get_wiimotegun=1
30

31
:: ---- ARCHIVE OPTIONS ----
32

33
:: archive_format: zip|7z
34
:: archive_compression: 0|1|3|5|7|9
35

36
set archive_format=zip
37
set archive_compression=3
38

39
:: ---- LOOP LIST ----
40

41
set setup_compiler=ISCC
42

43
set deps_list=(git !setup_compiler! 7za wget curl)
44
set submodules_list=(bios decorations system)
45
set packages_list=(retrobat_binaries batgui emulationstation default_theme batocera_ports mega_bezels retroarch roms wiimotegun)
46
set legacy_cores_list=(4do emuscv fake08 hatarib imageviewer mame2014 mame2016)
47
set emulators_black_list=(3dsen magicengine pico8 retroarch ryujinx steam teknoparrot yuzu yuzu-early-access)
48

49
:: ---- GET STARTED ----
50

51
set script_type=builder
52
set user_choice=0
53
set git_branch=master
54
set branch=stable
55
set release_version=null
56
set log_file=build.log
57
set exit_timeout=0
58

59
:loop_arg
60

61
if not "%1"=="" (
62

63
	if "%1"=="-config" (
64

65
		set custom_config=%2
66
		shift
67
	)
68

69
	shift
70
	goto :loop_arg
71
)
72

73
call :set_root
74
call :set_install
75
call :set_builder
76

77
if %user_choice% NEQ 0 (
78

79
	if %user_choice% EQU 1 (
80
		call :get_packages
81
		call :set_config
82
		call :build_setup
83
		call :create_archive
84
		call :exit_door
85
		goto :eof
86
	)
87
	
88
	if %user_choice% EQU 2 (
89
		call :get_packages
90
		call :set_config
91
		call :exit_door
92
		goto :eof
93
	)
94
	
95
	if %user_choice% EQU 3 (
96
		call :build_setup
97
		call :exit_door
98
		goto :eof
99
	)
100
	
101
	if %user_choice% EQU 4 (
102
		call :create_archive
103
		call :exit_door
104
		goto :eof
105
	)
106
	
107
	if %user_choice% EQU 5 (
108
		call :butler_push
109
		call :exit_door
110
		goto :eof
111
	)
112
)
113

114
:: ---- UI ----
115

116
call :banner
117

118
echo  This script can help you to download all the required 
119
echo  softwares and build the RetroBat Setup with the NullSoft 
120
echo  Scriptable Install System.
121
echo +===========================================================+
122
echo  (1) - full compilation
123
echo  (2) - download, configure
124
echo  (3) - build setup executable
125
echo  (4) - archive
126
if exist "!buildtools_path!\butler.exe" echo  (5) - push
127
echo  (Q) - Quit
128
echo +===========================================================+
129
if not exist "!buildtools_path\butler.exe" choice /C 1234Q /N /T 20 /D 1 /M "Please type your choice here: "
130
if exist "!buildtools_path\butler.exe" choice /C 12345Q /N /T 20 /D 1 /M "Please type your choice here: "
131
echo +===========================================================+
132
set user_choice=%ERRORLEVEL%
133

134
if %user_choice% EQU 1 (
135

136
	call :get_packages
137
	call :set_config
138
	call :build_setup
139
	call :create_archive
140
	call :exit_door
141
	goto :eof
142
)
143

144
if %user_choice% EQU 2 (
145

146
	call :get_packages
147
	call :set_config
148
	call :exit_door
149
	goto :eof
150
)
151

152
if %user_choice% EQU 3 (
153

154
	call :build_setup
155
	call :exit_door
156
	goto :eof
157
)
158

159
if %user_choice% EQU 4 (
160

161
	call :create_archive
162
	call :exit_door
163
	goto :eof
164
)
165

166
if not exist "!buildtools_path\butler.exe" if %user_choice% EQU 5 (
167

168
	(set exit_code=0)
169
	call :exit_door
170
	goto :eof
171
)
172

173
if exist "!buildtools_path\butler.exe" if %user_choice% EQU 5 (
174

175
	call :butler_push
176
	call :exit_door
177
	goto :eof
178
)
179

180
if exist "!buildtools_path\butler.exe" if %user_choice% EQU 6 (
181

182
	(set exit_code=0)
183
	call :exit_door
184
	goto :eof
185
)
186

187
:: ---- LABELS ----
188

189
:: ---- SET ROOT PATH ----
190

191
:set_root
192

193
set task=set_root
194

195
set current_file=%~nx0
196
set current_drive="%cd:~0,2%"
197
set current_dir="%cd:~3%"
198
set current_drive=%current_drive:"=%
199
set current_dir=%current_dir:"=%
200
set current_path=!current_drive!\!current_dir!
201
set root_path=!current_path!
202

203
if not "%log_file%" == "" if exist "!root_path!\%log_file%" del/Q "!root_path!\%log_file%" >nul
204
(echo %date% %time% [START] Run: !current_file!)>> "!root_path!\%log_file%"
205
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
206
(echo %date% %time% [INFO] Current Path: "!current_path!")>> "!root_path!\%log_file%"
207

208
goto :eof
209

210
:: ---- SET INSTALL INFOS ----
211

212
:set_install
213

214
set task=set_install
215
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
216

217
:: ---- SET CUSTOM OPTIONS ----
218

219
if not "!custom_config!" == "" if exist "!root_path!\!custom_config!" (
220

221
	for /f "delims=" %%x in (!root_path!\!custom_config!) do (set %%x)
222
	(echo %date% %time% [INFO] Using build config file: "!custom_config!")>> "!root_path!\%log_file%"
223
)
224

225
:: ---- SET TMP FILE ----
226

227
set tmp_infos_file=!root_path!\rb_infos.tmp
228
if not "%tmp_infos_file%" == "" if exist "!tmp_infos_file!" del/Q "!tmp_infos_file!"
229

230
:: ---- CALL SHARED VARIABLES SCRIPT ----
231

232
if exist "!root_path!\system\scripts\shared-variables.cmd" (
233

234
	cd "!root_path!\system\scripts"
235
	call shared-variables.cmd	
236
	
237
) else (
238

239
	(set exit_code=2)
240
	call :exit_door
241
	goto :eof
242
)
243

244
:: ---- GET INFOS STORED IN TMP FILE ----
245

246
if exist "!tmp_infos_file!" (
247

248
	for /f "delims=" %%x in ('type "!tmp_infos_file!"') do (set "%%x") 
249
	if not "%tmp_infos_file%" == "" del/Q "!tmp_infos_file!"
250
	
251
) else (
252

253
	(set/A exit_code=2)
254
	call :exit_door
255
	goto :eof
256
)
257

258
(echo %date% %time% [INFO] Version: %name%-%retrobat_version%-%branch%)>> "!root_path!\%log_file%"
259
(echo %date% %time% [INFO] Build Path: "!build_path!")>> "!root_path!\%log_file%"
260
(echo %date% %time% [INFO] Download Path: "!download_path!")>> "!root_path!\%log_file%"
261

262
:: ---- WINDOW TITLE ----
263

264
title !name! builder script
265

266
goto :eof
267

268
:: ---- DEPENDENCIES CHECKING ----
269

270
:set_builder
271

272
set task=set_builder
273
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
274

275
call :banner
276

277
echo :: SETTING BUILD ENVIRONMENT...
278

279
if not exist "!build_path!\." md "!build_path!"
280
if not exist "!download_path!\." md "!download_path!"
281

282
(set/A found_total=0)
283

284
if "%archx%"=="x86_64" (set "git_path=%ProgramFiles%\Git\cmd") else (set "git_path=%ProgramFiles(x86)%\Git\cmd")
285

286
for %%i in %deps_list% do (
287

288
	(set/A found_%%i=0)
289
	(set/A found_total=!found_total!+1)
290
	(set package_name=%%i)
291
	(set buildtools_path=!root_path!\system\tools)
292
	
293
	if "!package_name!"=="git" (set buildtools_path=!git_path!)
294
	if "!package_name!"=="makensis" (set "buildtools_path=%ProgramFiles(x86)%\NSIS" & set "compiler_path=!buildtools_path!")
295
	if "!package_name!"=="ISCC" (set "buildtools_path=%ProgramFiles(x86)%\Inno Setup 6" & set "compiler_path=!buildtools_path!")
296
	
297
	if exist "!buildtools_path!\!package_name!.exe" (
298
	
299
		(set/A found_%%i=!found_%%i!+1)
300
		(echo %%i: found)
301
		(echo %date% %time% [INFO] %%i: found)>> "!root_path!\%log_file%"
302
		
303
	) else (
304
	
305
		(echo %%i: not found)
306
		(echo %date% %time% [INFO] %%i: not found)>> "!root_path!\%log_file%"
307
	)
308
	
309
	(set/A found_total=!found_total!-!found_%%i!)		
310
)
311

312
if !found_total! NEQ 0 (
313
	
314
	(set/A exit_code=2)
315
	call :exit_door
316
	goto :eof
317
)
318
	
319
timeout /t 3 >nul
320

321
goto :eof
322

323
:: ---- GET PACKAGES ----
324

325
:get_packages
326

327
set task=get_packages
328
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
329

330
echo :: GETTING REQUIRED PACKAGES...
331

332
cd !root_path!
333
git submodule update --init
334

335
if %ERRORLEVEL% NEQ 0 (
336

337
	(set/A exit_code=%ERRORLEVEL%)
338
	call :exit_door
339
	goto :eof
340
)
341

342
if "%get_retrobat_binaries%"=="1" (
343
	for %%i in (txt) do (xcopy "!root_path!\*.%%i" "!build_path!" /v /y)
344
	if exist "!build_path!\butler.exe" del/Q "!build_path!\butler.exe"
345
	
346
	(echo %date% %time% [INFO] retrobat_binaries copied to "!build_path!")>> "!root_path!\%log_file%"
347
)
348

349
for %%i in %submodules_list% do (
350

351
	if "!get_%%i!"=="1" (
352
	
353
		(set package_name=%%i)
354
		(set destination_path=!%%i_path!)
355
	
356
		if "!package_name!"=="bios" (set folder=bios)
357
		if "!package_name!"=="default_theme" (set folder=emulationstation\.emulationstation\themes\es-theme-carbon)
358
		if "!package_name!"=="decorations" (set folder=system\decorations)
359
		if "!package_name!"=="system" (set folder=system)
360
		
361
		xcopy "!root_path!\!folder!" "!destination_path!\" /s /e /v /y
362
		
363
		(echo %date% %time% [INFO] !package_name! copied to "!destination_path!")>> "!root_path!\%log_file%"		
364
	)
365
)
366

367
for %%i in %packages_list% do (
368

369
	if "!get_%%i!"=="1" (
370
		
371
		(set package_name=%%i)
372
		(set package_file=%%i.7z)
373
		(set download_url=!%%i_url!)
374
		(set destination_path=!%%i_path!)
375

376
		if "!package_name!"=="retrobat_binaries" (set package_file=%%i_%git_branch%.7z)
377
		if "!package_name!"=="emulationstation" (set package_file=EmulationStation-Win32.zip)
378
		if "!package_name!"=="batocera_ports" (set package_file=batocera-ports.zip)
379
		if "!package_name!"=="retroarch" (set package_file=RetroArch.7z)
380
		if "!package_name!"=="wiimotegun" (set package_file=WiimoteGun.zip)
381
		if "!package_name!"=="default_theme" (set package_file=master.zip)
382
		
383
		call :download
384
		call :hash_file
385
		call :extract
386
	)
387
)
388

389
if "%get_lrcores%"=="1" (
390

391
	for /f "usebackq delims=" %%x in ("%system_path%\configgen\lrcores_names.lst") do (
392

393
		(set package_name=%%x)
394
		(set package_file=%%x_libretro.dll.zip)
395
		(set download_url=%lrcores_url%/!package_file!)
396
		(set destination_path=%lrcores_path%)
397

398
		call :download
399
		call :hash_file
400
		call :extract	
401
	)
402
)
403

404
if "%get_emulators%"=="1" (
405

406
	for /f "usebackq delims=" %%x in ("%system_path%\configgen\emulators_names.lst") do (
407

408
		(set package_name=%%x)
409
		(set package_file=%%x.7z)
410
		(set download_url=%emulators_url%)
411
		(set destination_path=!emulators_path!\%%x)
412
		
413
		set skip=0
414
		
415
		for %%i in %emulators_black_list% do (
416
		
417
			if "!package_name!"=="%%i" (set skip=1)
418
		)
419
		
420
		if "!skip!"=="0" (
421

422
			call :download
423
			call :hash_file
424
			call :extract
425
		)
426
	)
427
)
428

429
goto :eof
430

431
:: ---- SET RETROBAT CONFIG ----
432

433
:set_config
434

435
set task=set_config
436
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
437

438
echo :: SETTING CONFIG FILES...
439

440
for /f "usebackq delims=" %%x in ("%system_path%\configgen\retrobat_tree.lst") do (if not exist "!build_path!\%%x\." md "!build_path!\%%x")
441
for /f "usebackq delims=" %%x in ("%system_path%\configgen\emulators_names.lst") do (if not exist "!build_path!\emulators\%%x\." md "!build_path!\emulators\%%x")
442
for /f "usebackq delims=" %%x in ("%system_path%\configgen\systems_names.lst") do (if not exist "!build_path!\roms\%%x\." md "!build_path!\roms\%%x")
443
for /f "usebackq delims=" %%x in ("%system_path%\configgen\systems_names.lst") do (if not exist "!build_path!\saves\%%x\." md "!build_path!\saves\%%x")
444

445
if exist "!build_path!\retrobat.exe" (
446

447
	"!build_path!\retrobat.exe" /NOF #GetConfigFiles
448
	"!build_path!\retrobat.exe" /NOF #SetEmulationStationSettings
449
	"!build_path!\retrobat.exe" /NOF #SetEmulatorsSettings
450
	
451
	if %ERRORLEVEL% NEQ 0 (
452
		(set/A exit_code=%ERRORLEVEL%)
453
		call :exit_door
454
		goto :eof
455
	)
456

457
) else (
458

459
	(set/A exit_code=2)
460
	call :exit_door
461
	goto :eof	
462
)
463

464
if exist "!build_path!\retrobat.ini" del/Q "!build_path!\retrobat.ini"
465

466
if exist "!system_path!\templates\emulationstation\es_features.locale\." xcopy "!system_path!\templates\emulationstation\es_features.locale" "!emulationstation_path!\es_features.locale\" /s /e /v /y
467

468
if exist "!system_path!\resources\emulationstation\video\*.mp4" xcopy /v /y "!system_path!\resources\emulationstation\video\*.mp4" "!build_path!\emulationstation\.emulationstation\video"
469
if exist "!system_path!\resources\emulationstation\music\*.ogg" xcopy /v /y "!system_path!\resources\emulationstation\music\*.ogg" "!build_path!\emulationstation\.emulationstation\music"
470

471
if not exist "!build_path!\system\version.info" (
472

473
	(set timestamp=%date:~6,4%%date:~3,2%%date:~0,2%)
474
	
475
	if "%branch%" == "stable" (
476
		(set release_version=%retrobat_version%-%branch%-%arch%)
477
	) else (
478
		(set release_version=%retrobat_version%-!timestamp!-%branch%-%arch%)
479
	)
480
	
481
	(echo|set/P=!release_version!)> "!build_path!\system\version.info"	
482
)
483

484
echo build version is: !release_version!
485

486
(set/A exit_code=0)
487

488
goto :eof
489

490
:: ---- BUILD RETROBAT SETUP ----
491

492
:build_setup
493

494
set task=build_setup
495
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
496

497
echo :: BUILDING RETROBAT SETUP...
498

499
call :check_version
500

501
set package_file=%name%-v%release_version%-setup.exe
502

503
if not exist "!build_path!\%package_file%" (
504

505
	if "%setup_compiler%"=="makensis" ("!compiler_path!\makensis.exe" /V4 /DRELEASE_VERSION=%release_version%  "!root_path!\installer\setup.nsi")
506
	if "%setup_compiler%"=="ISCC" if "%archx%"=="x86_64" ("!compiler_path!\ISCC.exe" /DMyAppVersion=%release_version% /DMyAppArchitecture=x64 /DSourceDir="!build_path!" /DInstallRootUrl="%installroot_url%/repo/%arch%" "!root_path!\installer\installer.iss")
507
	if "%setup_compiler%"=="ISCC" if "%archx%"=="x86" ("!compiler_path!\ISCC.exe" /DMyAppVersion=%release_version% /DMyAppArchitecture=x86 /DSourceDir="!build_path!" /DInstallRootUrl="%installroot_url%/repo/%arch%" "!root_path!\installer\installer.iss")
508
)
509

510
timeout/t 2 >nul
511
 
512
if exist "!root_path!\installer\%package_file%" (
513

514
	(set/A exit_code=0)
515
	move /Y "!root_path!\installer\%package_file%" "!build_path!"
516
	(echo %date% %time% [INFO] Build "%package_file%" in "!build_path!")>> "!root_path!\%log_file%"
517
)
518

519
call :hash_file	
520

521
goto :eof
522

523
:: ---- CREATE ARCHIVE ----
524

525
:create_archive
526

527
set task=create_archive
528
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
529

530
echo :: CREATING ARCHIVE...
531

532
call :check_version
533

534
set package_file=%name%-v%release_version%.%archive_format%
535
set exclude_list=(exclude.lst hash_list.txt %name%-v%release_version%-setup.exe %name%-v%release_version%-setup.exe.sha256.txt %name%-v%release_version%.%archive_format% %name%-v%release_version%.%archive_format%.sha256.txt)
536

537
if not exist "!build_path!\%package_file%" (
538

539
	if exist "!build_path!\exclude.lst" del/Q "!build_path!\exclude.lst"	
540
	for %%i in %exclude_list% do ((echo "%%i")>> "!build_path!\exclude.lst")
541

542
	!buildtools_path!\7za.exe a -t%archive_format% "!build_path!\%package_file%" "!build_path!\*" -xr@"!build_path!\exclude.lst" -mx=%archive_compression%	
543
	if exist "!build_path!\exclude.lst" del/Q "!build_path!\exclude.lst"
544
)
545

546
if exist "!build_path!\%package_file%" (
547

548
	(set/A exit_code=0)
549
	(echo %date% %time% [INFO] Created "%package_file%" in "!build_path!")>> "!root_path!\%log_file%"
550
)
551

552
call :hash_file
553

554
goto :eof
555

556
:: ---- BUTLER PUSH ----
557

558
:: need butler installed
559

560
:butler_push
561

562
set task=butler_push
563
(echo %date% %time% [LABEL] :!task!)>> "!root_path!\%log_file%"
564

565
echo :: Butler push...
566

567
call :check_version
568

569
if exist "!build_path!\system\version.info" (
570

571
	if exist "!build_path!\%name%-v%release_version%-setup.exe" (
572

573
		"!buildtools_path\butler.exe" push "!build_path!\%name%-v%release_version%-setup.exe" retrobatofficial/retrobat:%arch%-%branch% --userversion-file "!build_path!\system\version.info"
574
		rem "!buildtools_path\butler.exe" butler push --ignore "!build_path!\%name%-v%release_version%-setup.exe" --ignore "!build_path!\%name%-v%release_version%-setup.exe.sha256.txt" --ignore "%name%-v%release_version%.%archive_format%" --ignore "%name%-v%release_version%.%archive_format%.sha256" --ignore "!build_path!\*.log" --ignore "!build_path!\hash_list.txt" --ignore "!build_path!\emulationstation\.emulationstation\es_settings.cfg" "!build_path!\" retrobatofficial/retrobat:%arch%-%branch% --userversion-file "!build_path!\system\version.info"
575
		(set/A exit_code=%ERRORLEVEL%)
576
	)
577
	
578
	if exist "!build_path!\%name%-v%release_version%-full-setup.exe" (
579

580
		"!buildtools_path\butler.exe" push "!build_path!\%name%-v%release_version%-full-setup.exe" retrobatofficial/retrobat:%arch%-%branch% --userversion-file "!build_path!\system\version.info"
581
		rem "!buildtools_path\butler.exe" push --ignore "!build_path!\%name%-v%release_version%-full-setup.exe" --ignore "!build_path!\%name%-v%release_version%-full-setup.exe.sha256.txt" --ignore "%name%-v%release_version%.%archive_format%" --ignore "%name%-v%release_version%.%archive_format%.sha256" --ignore "!build_path!\*.log" --ignore "!build_path!\hash_list.txt" --ignore "!build_path!\emulationstation\.emulationstation\es_settings.cfg" "!build_path!\" retrobatofficial/retrobat:%arch%-%branch% --userversion-file "!build_path!\system\version.info"
582
		(set/A exit_code=%ERRORLEVEL%)
583
	)
584
)
585

586
if %exit_code% EQU 0 ((echo %date% %time% [INFO] Pushed "%name%-v%release_version%")>> "!root_path!\%log_file%")
587

588
goto :eof
589

590
:: ---- BANNER ----
591

592
:banner
593

594
cls
595
echo +===========================================================+
596
echo  !name! builder script
597
echo +===========================================================+
598
goto :eof
599

600
:: ---- DOWNLOAD PACKAGES ----
601

602
:download
603

604
echo *************************************************************
605

606
for %%j in %legacy_cores_list% do (
607

608
	if "!package_name!"=="%%j" (set download_url=https://www.retrobat.ovh/repo/%arch%/legacy/lrcores)
609
)
610

611
if exist "%download_path%\%package_file%" goto :eof
612

613
"%buildtools_path%\wget" --continue --no-check-certificate --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 3 -P "%download_path%" !download_url!/!package_file! -q --show-progress
614
(set/A exit_code=%ERRORLEVEL%)
615

616
if not exist "%download_path%\%package_file%" (
617

618
	call :exit_door
619
	goto :eof
620
)
621

622
(echo %date% %time% [INFO] Get !package_name! from !download_url!)>> "!root_path!\%log_file%"
623

624
goto :eof
625

626
:: ---- EXTRACT PACKAGES ----
627

628
:extract
629

630
echo *************************************************************
631

632
if not exist "%extraction_path%\." md "%extraction_path%"
633
"%buildtools_path%\7za.exe" -y x "%download_path%\%package_file%" -aoa -o"%extraction_path%"
634

635
set true=1
636

637
if "!package_name!"=="retroarch" (
638

639
	set true=0
640
	
641
	if "%archx%"=="x86_64" (
642
				
643
		xcopy "%extraction_path%\RetroArch-Win64" "%destination_path%\" /s /e /v /y
644
		rmdir /s /q "%download_path%\extract\RetroArch-Win64"
645
	)
646
	
647
	if "%archx%"=="x86" (
648
	
649
		xcopy "%extraction_path%\RetroArch" "%destination_path%\" /s /e /v /y
650
		rmdir /s /q "%download_path%\extract\RetroArch"
651
	)	
652
) 
653

654
if "%true%"=="1" (
655

656
	xcopy "%extraction_path%" "%destination_path%\" /e /v /y
657
)
658
 
659
rmdir /s /q "%download_path%\extract"
660
if not "%package_file%" == "" del/Q "%download_path%\%package_file%"
661

662
(echo %date% %time% [INFO] Copy !package_name! to !destination_path!)>> "!root_path!\%log_file%"
663

664
goto :eof
665

666
:: ---- CHECK VERSION ----
667

668
:check_version
669

670
if "%release_version%"=="null" (
671

672
	if exist "!build_path!\system\version.info" (
673
	
674
		set/P release_version=<"!build_path!\system\version.info"
675
		
676
	) else (
677
	
678
		(set/A exit_code=2)
679
		goto :eof
680
	)
681
)
682

683
goto :eof
684

685
:: ---- HASH FILE ----
686

687
:hash_file
688

689
if "!task!" == "get_packages" (
690

691
	set hash_path=!download_path!
692
	
693
) else (
694

695
	set hash_path=!build_path!
696

697
)
698

699
if exist "!hash_path!\!package_file!" (
700

701
	(set "first_line=1")
702
	for /f "skip=1 delims=" %%i in ('certutil -hashfile "!hash_path!\!package_file!" SHA256') do (
703
		if [!first_line!]==[1] (
704
			(set file_hash=%%i)
705
			(set "first_line=0")
706
		)
707
	)
708

709
	if "!task!" == "get_packages" (
710
REM		(echo !package_name!_sha256=!file_hash!)>> "!build_path!\hash_list.txt"
711
REM		(echo %date% %time% [INFO] !package_name!_sha256=!file_hash! ^> "!build_path!\hash_list.txt")>> "!root_path!\%log_file%"
712
	)
713
	
714
	if not "!task!" == "get_packages" (
715
		(echo|set/P=!file_hash!)> "!build_path!\!package_file!.sha256.txt"
716
		(echo %date% %time% [INFO] Created "!package_file!.sha256.txt" in "!build_path!")>> "!root_path!\%log_file%"
717
	)
718
)
719

720
goto :eof
721

722
:: ---- EXIT ----
723

724
:exit_door
725

726
echo :: EXITING...
727

728
if "%exit_code%" == "" (set/A exit_code=2)
729
(echo %date% %time% [EXIT] !exit_code!)>> "!root_path!\build.log"
730

731
if %exit_timeout% GTR 0 (timeout /t %exit_timeout%)>nul
732
if %exit_timeout% EQU 0 (pause)
733

734
exit !exit_code!

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.