-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
132 lines (98 loc) · 5.27 KB
/
build.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
@ECHO OFF
TITLE Aetherx - Build xSum
SETLOCAL ENABLEDELAYEDEXPANSION
MODE con:cols=125 lines=30
MODE 125,30
GOTO comment_end
-----------------------------------------------------------------------------------------------------
Build Script for xsum.exe
-----------------------------------------------------------------------------------------------------
:comment_end
:: -----------------------------------------------------------------------------------------------------
:: DEFINE BATCH VARS
:: -----------------------------------------------------------------------------------------------------
SET dir_home=%~dp0
:: -----------------------------------------------------------------------------------------------------
:: define: gpg library
:: -----------------------------------------------------------------------------------------------------
SET signtool=signtool
SET CERT_THUMBPRINT=58a1539d6988d76f44bae27c27ed5645d3b1222a
:: -----------------------------------------------------------------------------------------------------
:: config file
:: -----------------------------------------------------------------------------------------------------
if exist !dir_home!/!file_cfg! (
for /F "tokens=*" %%I in ( %file_cfg% ) do set %%I
)
:: -----------------------------------------------------------------------------------------------------
:: define: signtool
:: attempt to locate signtool via where command
:: -----------------------------------------------------------------------------------------------------
WHERE /Q %signtool%
IF !ERRORLEVEL! NEQ 0 (
cls
%echo% ERROR
%echo% This script has detected that the command %signtool% is not accessible.
%echo%.
TITLE Aetherx - Signtool Missing [Error]
%echo% Press any key to acknowledge error and try anyway ...
PAUSE >nul
cls
)
:: -----------------------------------------------------------------------------------------------------
:: remove trailing slash
:: -----------------------------------------------------------------------------------------------------
IF %dir_home:~-1%==\ SET dir_home=%dir_home:~0,-1%
:: -----------------------------------------------------------------------------------------------------
:: This script requires https://www.nuget.org/packages/ilmerge
:: set your NuGet ILMerge Version, this is the number from the package manager install, for example:
:: PM> Install-Package ilmerge -Version 3.0.41
::
:: to confirm it is installed for a given project, see the packages.config file
:: -----------------------------------------------------------------------------------------------------
SET ILMERGE_VERSION=3.0.41
SET SN_KEY=aetherx_9a_sn.pub.snk
:: -----------------------------------------------------------------------------------------------------
:: target executable name
:: -----------------------------------------------------------------------------------------------------
SET APP_NAME=xsum.exe
:: -----------------------------------------------------------------------------------------------------
:: Set build, used for directory. Typically Release or Debug
:: -----------------------------------------------------------------------------------------------------
SET PATH_ROOT=bin\Release
SET PATH_PLATFORM=net481
SET PATH_PUBLISH=publish
:: -----------------------------------------------------------------------------------------------------
:: full ILMerge should be found here:
:: -----------------------------------------------------------------------------------------------------
SET PATH_ILMERGE=%USERPROFILE%\.nuget\packages\ilmerge\%ILMERGE_VERSION%\tools\net452
:: -----------------------------------------------------------------------------------------------------
:: batch script
:: -----------------------------------------------------------------------------------------------------
echo Merging %APP_NAME% ...
"%PATH_ILMERGE%"\ILMerge.exe %PATH_ROOT%\%PATH_PLATFORM%\%PATH_PUBLISH%\%APP_NAME% ^
/lib:%PATH_ROOT%\%PATH_PLATFORM%\%PATH_PUBLISH% ^
/out:%PATH_ROOT%\%PATH_PLATFORM%\%PATH_PUBLISH%\%APP_NAME% ^
System.Buffers.dll ^
System.Management.Automation.dll ^
System.Memory.dll ^
SauceControl.Blake2Fast.dll ^
System.Numerics.Vectors.dll
GOTO SIGN_EXE_DLL_CUROLDER
:: -----------------------------------------------------------------------------------------------------
:: sign executables
:: -----------------------------------------------------------------------------------------------------
:SIGN_EXE_DLL_CUROLDER
:: -----------------------------------------------------------------------------------------------------
:: sign EXE
:: -----------------------------------------------------------------------------------------------------
for /R %PATH_ROOT%\%PATH_PLATFORM%\%PATH_PUBLISH% %%f in ( *.exe ) do (
call signtool sign /sha1 "%CERT_THUMBPRINT%" /fd SHA256 /d "Aetherx" /du "https://github.com/Aetherinox" /t http://timestamp.comodoca.com/authenticode "%%f"
)
goto FINISH
:: -----------------------------------------------------------------------------------------------------
:: finish
:: -----------------------------------------------------------------------------------------------------
:FINISH
dir %APP_NAME%
pause
Exit /B 0