-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
60 lines (49 loc) · 1.62 KB
/
build.bat
File metadata and controls
60 lines (49 loc) · 1.62 KB
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
setlocal enabledelayedexpansion
:: Upgrade pip
echo Upgrading pip...
python -m pip install --upgrade pip
:: Install required packages
echo Installing required packages...
pip install -r requirements.txt
:: Install PyInstaller if not installed
pip show pyinstaller >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Installing PyInstaller...
pip install pyinstaller
)
:: Install PyInstaller hooks
pip install pyinstaller-hooks-contrib
:: Create necessary directories
echo Creating build directories...
if not exist "dist" mkdir dist
if not exist "build" mkdir build
:: Clean previous builds
echo Cleaning previous builds...
if exist "build\*" rmdir /s /q build
if exist "dist\*" rmdir /s /q dist
:: Build the executable
echo Building executable...
pyinstaller --clean --noconfirm build.spec
:: Check if build was successful
if %ERRORLEVEL% EQU 0 (
echo.
echo =========================================
echo Build successful!
echo Executable is in the 'dist\MalwareDetectionSystem' folder
echo =========================================
:: Create a zip file for distribution
echo Creating distribution zip...
powershell Compress-Archive -Path "dist\MalwareDetectionSystem\*" -DestinationPath "dist\MalwareDetectionSystem.zip" -Force
echo.
echo =========================================
echo Distribution zip created: dist\MalwareDetectionSystem.zip
echo =========================================
) else (
echo.
echo =========================================
echo Build failed. Check the error messages above.
echo =========================================
)
echo.
pause