|
|
|
|
@ -74,17 +74,28 @@ def build_exe():
@@ -74,17 +74,28 @@ def build_exe():
|
|
|
|
|
# 收集 uiautomation 的所有子模块(确保完整打包) |
|
|
|
|
'--collect-all=uiautomation', |
|
|
|
|
|
|
|
|
|
# 添加数据文件(如果需要) |
|
|
|
|
# '--add-data=config;config', # Windows 格式 |
|
|
|
|
# '--add-data=config:config', # Linux/Mac 格式 |
|
|
|
|
|
|
|
|
|
# 工作目录设置 |
|
|
|
|
# 添加数据文件 |
|
|
|
|
# small_machine_transform.py 需要作为数据文件包含,因为它会被 Blender 作为外部脚本调用 |
|
|
|
|
# 注意:PyInstaller 会将数据文件放在 _MEIPASS 目录下 |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
# 添加 small_machine_transform.py 数据文件 |
|
|
|
|
small_transform_file = os.path.join(current_dir, "download_batch_data", "utils", "small_machine_transform.py") |
|
|
|
|
if os.path.exists(small_transform_file): |
|
|
|
|
# Windows 使用分号,Linux/Mac 使用冒号 |
|
|
|
|
path_sep = ';' if sys.platform == 'win32' else ':' |
|
|
|
|
# 添加到 utils/ 目录(get_resource_path('utils/small_machine_transform.py') 会查找这里) |
|
|
|
|
cmd.append(f'--add-data={small_transform_file}{path_sep}utils') |
|
|
|
|
# 也添加到 download_batch_data/utils/ 目录(备用路径) |
|
|
|
|
cmd.append(f'--add-data={small_transform_file}{path_sep}download_batch_data/utils') |
|
|
|
|
|
|
|
|
|
# 添加工作目录设置和主脚本 |
|
|
|
|
cmd.extend([ |
|
|
|
|
f'--workpath={os.path.join(current_dir, "build")}', |
|
|
|
|
f'--distpath={os.path.join(current_dir, "dist")}', |
|
|
|
|
f'--specpath={os.path.join(current_dir, "build")}', |
|
|
|
|
|
|
|
|
|
main_script |
|
|
|
|
] |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
print("=" * 60) |
|
|
|
|
print("开始打包 factory_sliceing 项目...") |
|
|
|
|
|