forked from Neo23x0/Loki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
61 lines (51 loc) · 1.71 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
@ECHO OFF
:: Build script by A. Fischer and F. Roth
:: November 2017
setlocal enabledelayedexpansion
SET PY=C:\Python27\python.exe
SET PYI=C:\Python27\Scripts\pyinstaller.exe
:: Cleaning all old versions
RMDIR /S /Q build
ECHO -----------------------------------------
ECHO LOKI Build Script
ECHO -----------------------------------------
ECHO Checking prerequisites and configuration ...
:: Windows 2003 Support
::
ECHO Checking for msvcr100.dll in order to provide Windows 2003 support ...
SET WIN2003=
if not exist "%SystemRoot%\System32\msvcr100.dll" (
echo File %SystemRoot%\System32\msvcr100.dll not found.
echo No support for Windows 2003 server systems.
echo Download and install https://www.microsoft.com/en-us/download/details.aspx?id=26999 if you need that support
) else (
echo Required file msvcr100.dll found. Windows 2003 will be supported.
SET WIN2003=-win2003sup
)
:: Private Rules
:: See https://github.com/Neo23x0/Loki/#package-loki-with-a-custom-ruleset for details
SET PRIVRULES=no
%PI% loki-package-builder.py --ruledir "%cd%\private-signatures" --target rules
if !errorlevel! neq 0 GOTO ERROR
if exist "%cd%\rules" (
echo Private signatures directory found. The contents will be encrypted and added to the package.
SET PRIVRULES=
)
:: COMPILATION
:: LOKI Upgrader
ECHO Compiling LOKI UPGRADER ...
%PYI% "%cd%\loki-upgrader%WIN2003%.spec"
if !errorlevel! neq 0 GOTO ERROR
:: LOKI
ECHO Compiling LOKI ...
%PYI% "%cd%\loki-%PRIVRULES%privrules%WIN2003%.spec"
if !errorlevel! neq 0 GOTO ERROR
ECHO Check the ./dist directory for the compiled executables
GOTO END
:ERROR
echo "An error occured. The build failed."
:END
:: CLEANUP
ECHO Cleaning up ...
del /f "%cd%\rules"
del /f "%cd%\rules.key"