first commit: 初始化项目,添加基本功能和打包脚本
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
This commit is contained in:
35
build_mac.py
Normal file
35
build_mac.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import PyInstaller.__main__
|
||||
import os
|
||||
import sys
|
||||
|
||||
# 获取当前脚本所在目录
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# 打包参数
|
||||
params = [
|
||||
'gui/main_window.py', # 主程序入口
|
||||
'--name=听泉助手', # 应用名称
|
||||
'--onefile', # 打包成单个文件
|
||||
'--windowed', # 不显示控制台窗口
|
||||
'--clean', # 清理临时文件
|
||||
'--noconfirm', # 不确认覆盖
|
||||
f'--distpath={os.path.join(current_dir, "dist")}', # 输出目录
|
||||
f'--workpath={os.path.join(current_dir, "build")}', # 工作目录
|
||||
f'--specpath={current_dir}', # spec文件目录
|
||||
'--add-data=logger.py;.', # 添加额外文件
|
||||
'--add-data=update_cursor_token.py;.',
|
||||
'--add-data=cursor_auth_manager.py;.',
|
||||
'--add-data=reset_machine.py;.',
|
||||
'--add-data=patch_cursor_get_machine_id.py;.',
|
||||
'--add-data=exit_cursor.py;.',
|
||||
'--add-data=go_cursor_help.py;.',
|
||||
'--add-data=logo.py;.',
|
||||
'--hidden-import=PyQt5',
|
||||
'--hidden-import=requests',
|
||||
'--hidden-import=urllib3',
|
||||
]
|
||||
|
||||
# 执行打包
|
||||
PyInstaller.__main__.run(params)
|
||||
|
||||
print("打包完成!可执行文件已生成在dist目录下。")
|
||||
Reference in New Issue
Block a user