forked from ihopenot/LpkUnpacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.bat
More file actions
68 lines (61 loc) · 1.84 KB
/
compile.bat
File metadata and controls
68 lines (61 loc) · 1.84 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
61
62
63
64
65
66
67
68
@echo off
REM filepath: d:\Python_Project\LpkUnpackerGUI\compile.bat
echo ===== LpkUnpackerGUI Compiler =====
echo Starting compilation process...
REM Activate Conda base environment
echo Activating Conda base environment...
call conda activate base
if %ERRORLEVEL% neq 0 (
echo Error: Failed to activate Conda base environment!
echo Make sure Conda is properly installed and initialized.
pause
exit /b 1
)
REM Check if Python is available
where python >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo Error: Python not found in Conda environment!
pause
exit /b 1
)
REM Check if nuitka is installed
python -c "import nuitka" >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo Warning: Nuitka not found. Attempting to install it...
conda install -c conda-forge nuitka -y
if %ERRORLEVEL% neq 0 (
echo Failed to install Nuitka through Conda. Trying pip...
pip install nuitka
if %ERRORLEVEL% neq 0 (
echo Failed to install Nuitka. Aborting compilation.
pause
exit /b 1
)
)
)
echo Compiling application with Nuitka in Conda base environment...
echo This may take several minutes. Please be patient...
REM Main compilation command
python -m nuitka --onefile ^
--enable-plugin=pyqt5 ^
--output-dir=build ^
--windows-disable-console ^
--include-data-dir=./Img=Img ^
--include-package=qfluentwidgets ^
--include-package=filetype ^
--windows-icon-from-ico=Img/icon.ico ^
--nofollow-import-to=numpy,matplotlib,scipy,pandas,tkinter ^
--python-flag=no_site ^
--python-flag=no_docstrings ^
--remove-output ^
LpkUnpackerGUI.py
if %ERRORLEVEL% neq 0 (
echo Compilation failed with error code %ERRORLEVEL%.
pause
exit /b %ERRORLEVEL%
)
echo.
echo Compilation completed successfully!
echo Executable can be found in the 'build' directory.
echo.
pause