Skip to content

Commit 2dbcadb

Browse files
committed
feat: new build scripts
1 parent 3494359 commit 2dbcadb

File tree

3 files changed

+53
-53
lines changed

3 files changed

+53
-53
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ backup/base64-stats.py
1111

1212
backup/loki copy.py
1313

14-
build_sfx.bat
1514
loki.zip
1615
dist
1716
run_loki.bat

build.bat

+24-52
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,40 @@
11
@ECHO OFF
2-
:: Build script by A. Fischer and F. Roth
3-
:: November 2017
2+
REM Building LOKI
43

54
setlocal enabledelayedexpansion
65

7-
if exist "C:\Python27-x64\" (
8-
SET PY=C:\Python27-x64\python.exe
9-
SET PYI=C:\Python27-x64\Scripts\pyinstaller.exe
10-
) else (
11-
SET PY=C:\Python27\python.exe
12-
SET PYI=C:\Python27\Scripts\pyinstaller.exe
13-
if not exist "%PY%" goto ERROR
14-
if not exist "%PYI%" goto ERROR
15-
)
6+
SET PACKAGE=%CD%\loki
7+
SET DIST=%CD%\dist
8+
SET PYI=pyinstaller
169

1710
:: Cleaning all old versions
1811
RMDIR /S /Q build
1912

20-
ECHO -----------------------------------------
21-
ECHO LOKI Build Script
22-
ECHO -----------------------------------------
23-
ECHO Checking prerequisites and configuration ...
24-
25-
:: Windows 2003 Support
26-
::
27-
ECHO Checking for msvcr100.dll in order to provide Windows 2003 support ...
28-
SET WIN2003=
29-
if not exist "%SystemRoot%\System32\msvcr100.dll" (
30-
echo File %SystemRoot%\System32\msvcr100.dll not found.
31-
echo No support for Windows 2003 server systems.
32-
echo Download and install https://www.microsoft.com/en-us/download/details.aspx?id=26999 if you need that support
33-
) else (
34-
echo Required file msvcr100.dll found. Windows 2003 will be supported.
35-
SET WIN2003=-win2003sup
36-
)
37-
38-
:: Private Rules
39-
:: See https://github.com/Neo23x0/Loki/#package-loki-with-a-custom-ruleset for details
40-
SET PRIVRULES=no
41-
%PY% loki-package-builder.py --ruledir "%cd%\private-signatures" --target rules
13+
:: BUILD LOKI
14+
ECHO Compiling LOKI ...
15+
%PYI% --noupx loki.spec
4216
if !errorlevel! neq 0 GOTO ERROR
43-
if exist "%cd%\rules" (
44-
echo Private signatures directory found. The contents will be encrypted and added to the package.
45-
SET PRIVRULES=
46-
)
47-
48-
:: COMPILATION
49-
:: LOKI Upgrader
5017
ECHO Compiling LOKI UPGRADER ...
51-
%PYI% "%cd%\loki-upgrader%WIN2003%.spec"
52-
if !errorlevel! neq 0 GOTO ERROR
53-
:: LOKI
54-
ECHO Compiling LOKI ...
55-
%PYI% "%cd%\loki-%PRIVRULES%privrules%WIN2003%.spec"
18+
%PYI% --noupx loki-upgrader.spec
5619
if !errorlevel! neq 0 GOTO ERROR
57-
ECHO Check the ./dist directory for the compiled executables
58-
GOTO END
20+
21+
:: Copy Executables and other files to the package folder
22+
move .\dist\loki.exe %PACKAGE%\
23+
move .\dist\loki-upgrader.exe %PACKAGE%\
24+
mkdir %PACKAGE%\tools
25+
copy .\tools\pe-sieve32.exe %PACKAGE%\tools
26+
copy .\tools\pe-sieve64.exe %PACKAGE%\tools
27+
28+
:: Delete files
29+
REM DEL /Q %PACKAGE%\signature-base
30+
DEL /Q %PACKAGE%\*.log
31+
DEL /Q %DIST%\loki_%VER%.zip
32+
IF EXIST %PACKAGE%\signature-base (
33+
rmdir %PACKAGE%\signature-base /s /q
34+
)
5935

6036
:ERROR
61-
echo "An error occured. The build failed."
37+
ECHO An error occured. Build interrupted.
6238

6339
:END
64-
:: CLEANUP
65-
ECHO Cleaning up ...
66-
del /f "%cd%\rules"
67-
del /f "%cd%\rules.key"
6840

build_sfx.bat

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@ECHO OFF
2+
REM Building Thor and creating SFX
3+
4+
setlocal enabledelayedexpansion
5+
6+
SET PACKAGE=%CD%\loki
7+
SET DIST=%CD%\dist
8+
SET ZIPPER="c:\Program Files\7-Zip\7z.exe"
9+
10+
:: Version
11+
set /p VER="Enter Version: "
12+
13+
:: Cleaning all old versions
14+
RMDIR /S /Q build
15+
16+
:: BUILD LOKI
17+
CALL build.bat
18+
19+
:: Pack
20+
%ZIPPER% a -tzip -mm=Deflate -mmt=off -mx5 -mfb=32 -mpass=1 -sccUTF-8 -mem=AES256 -w%PACKAGE% %DIST%\loki_%VER%.zip %PACKAGE%
21+
GOTO END
22+
23+
:ERROR
24+
ECHO An error occured. Build interrupted.
25+
26+
:END
27+
28+
29+

0 commit comments

Comments
 (0)