2025-10-22 18:24:43 +08:00
|
|
|
|
@echo off
|
|
|
|
|
|
setlocal
|
2025-10-23 18:53:22 +08:00
|
|
|
|
cd /d E:\code\Python\iOSAi
|
2025-10-22 18:24:43 +08:00
|
|
|
|
|
2025-10-23 18:53:22 +08:00
|
|
|
|
REM ---- 1) 打包 ----
|
|
|
|
|
|
python -m nuitka Module\Main.py ^
|
2025-09-23 20:17:33 +08:00
|
|
|
|
--standalone ^
|
|
|
|
|
|
--msvc=latest ^
|
2025-09-24 16:32:05 +08:00
|
|
|
|
--windows-console-mode=disable ^
|
2025-09-23 20:17:33 +08:00
|
|
|
|
--output-filename=IOSAI ^
|
|
|
|
|
|
--include-package=Module,Utils,Entity,script ^
|
2025-11-17 17:13:22 +08:00
|
|
|
|
--include-module=flask,wda,psutil,portalocker,flask_cors,cv2,lxml.etree,requests,urllib3,certifi,idna,setuptools,asgiref,hypercorn,h2,hpack,wsproto,priority,anyio,sniffio ^
|
2025-09-23 20:17:33 +08:00
|
|
|
|
--include-data-dir=resources=resources ^
|
|
|
|
|
|
--include-data-dir=SupportFiles=SupportFiles ^
|
2025-10-23 18:53:22 +08:00
|
|
|
|
--include-data-files="resources/iproxy/*=resources/iproxy/" ^
|
2025-09-23 20:17:33 +08:00
|
|
|
|
--include-data-files=resources/icon.ico=resources/icon.ico ^
|
2025-10-23 18:53:22 +08:00
|
|
|
|
--jobs=20 ^
|
2025-10-22 18:24:43 +08:00
|
|
|
|
--windows-icon-from-ico=resources/icon.ico
|
|
|
|
|
|
|
2025-10-23 18:53:22 +08:00
|
|
|
|
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
|
|
|
|
|
|
|
|
|
|
|
|
REM 2) 复制 sidecar venv 到 Main.dist 根目录(与 IOSAI.exe 同级)
|
|
|
|
|
|
rmdir /S /Q ".\Main.dist\python-rt" 2>nul
|
2025-10-23 18:57:37 +08:00
|
|
|
|
xcopy /E /I /Y ".\Needed\mini-python" ".\Main.dist\python-rt\"
|
2025-10-23 18:53:22 +08:00
|
|
|
|
rem ---- build done above ----
|
|
|
|
|
|
|
|
|
|
|
|
rem 强制删除根目录里会污染 sys.path 的同名包(目前只遇到 simplejson)
|
|
|
|
|
|
rmdir /s /q ".\Main.dist\simplejson" 2>nul
|
|
|
|
|
|
del /f /q ".\Main.dist\simplejson.*" 2>nul
|