forked from acidcoke/Grimassist
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_executable.bat
58 lines (47 loc) · 1.84 KB
/
build_executable.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
@echo off
setlocal
rem Capture the Poetry environment path
for /f "delims=" %%i in ('poetry env info --path') do set venv_path=%%i
rem Construct the site-packages path
set site_packages=%venv_path%\Lib\site-packages
rem Convert the path to forward slashes for Nuitka compatibility
set site_packages=%site_packages:\=/%
rem Initialize SIGNED_FLAG to 0 (unsigned by default)
set SIGNED_FLAG=0
rem Loop through the arguments and check if --signed is present
for %%a in (%*) do (
if "%%a"=="--signed" (
set SIGNED_FLAG=1
)
)
rem Set the UAC_FLAG conditionally based on --signed flag
set UAC_FLAG=
if %SIGNED_FLAG%==1 (
set UAC_FLAG=--windows-uac-uiaccess
)
rem Capture the Python version from the Poetry environment
for /f "delims=" %%v in ('poetry run python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')"') do set python_version=%%v
rem Echo the constructed site-packages path and Python version for debugging
echo Site packages path: %site_packages%
echo Python version: %python_version%
rem Compile with Nuitka
poetry run python -m nuitka ^
--standalone ^
--onefile ^
--windows-icon-from-ico=assets/images/icon.ico ^
%UAC_FLAG% ^
--output-dir=dist ^
--enable-plugin=tk-inter ^
--nofollow-import-to=unittest ^
--nofollow-import-to=setuptools ^
--include-data-dir=assets=assets ^
--include-data-dir=configs=configs ^
--include-data-dir="%site_packages%/mediapipe/modules=mediapipe/modules" ^
--include-package=mediapipe ^
--include-data-file="%site_packages%/mediapipe/python/_framework_bindings.cp%python_version%-win_amd64.pyd=mediapipe/python/_framework_bindings.cp%python_version%-win_amd64.pyd" ^
--include-module=comtypes ^
--include-module=comtypes.stream ^
--include-module=comtypes.client ^
--assume-yes-for-downloads ^
FaceCommander.py
endlocal