-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpack.bat
38 lines (30 loc) · 970 Bytes
/
pack.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
@echo on
if not defined OutDir echo error: OutDir is not defined >&2 && exit /b 1
if not defined ProjectName echo error: ProjectName is not defined >&2 && exit /b 1
if not defined PlatformTarget echo error: PlatformTarget is not defined >&2 && exit /b 1
if not defined BuildVersion echo warning: BuildVersion is not defined >&2
setlocal enabledelayedexpansion
set ZipName=%ProjectName%_
if defined BuildVersion set ZipName=!ZipName!v%BuildVersion%_
set ZipName=!ZipName!%PlatformTarget%.zip
cd /D %OutDir% 2>&1 > NUL
if errorlevel 1 (
echo error: Failed change directory to "%OutDir%" >&2
endlocal
exit /b 1
)
if exist ZipName del /Q !ZipName! 2>&1 > NUL
if errorlevel 1 (
echo error: Failed to remove existing file "!ZipName!" >&2
endlocal
exit /b 1
)
7z a "!ZipName!" "*.exe" && ^
7z l "!ZipName!" && ^
7z h -scrcSHA256 "*.exe" "!ZipName!"
if errorlevel 1 (
echo error: Failed to create archieve "!ZipName!" >&2
endlocal
exit /b 1
)
endlocal