diff --git a/build_client.spec b/build_client.spec index fcfb5a2..f7b0ace 100644 --- a/build_client.spec +++ b/build_client.spec @@ -1,6 +1,6 @@ # -*- mode: python ; coding: utf-8 -*- -# 客户端 GUI 打包配置 -# 用法: 在项目根目录 (boss_dp) 执行: pyinstaller build_client.spec +# 客户端 GUI 打包配置(单文件) +# 用法: 在项目根目录 (boss_dp) 执行: pyinstaller --clean build_client.spec import os _spec_dir = os.path.dirname(os.path.abspath(SPECPATH)) @@ -56,8 +56,11 @@ pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE( pyz, a.scripts, + a.binaries, + a.zipfiles, + a.datas, [], - exclude_binaries=True, + exclude_binaries=False, name='BOSS直聘Worker客户端', debug=False, bootloader_ignore_signals=False, @@ -70,14 +73,3 @@ exe = EXE( codesign_identity=None, entitlements_file=None, ) - -coll = COLLECT( - exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='BOSS直聘Worker客户端', -) diff --git a/部署说明.md b/部署说明.md index 4388e77..b3aac1a 100644 --- a/部署说明.md +++ b/部署说明.md @@ -25,8 +25,8 @@ python app.py ### 方式 B:打包为 exe(推荐,无需 Python) 1. 安装 PyInstaller:`pip install pyinstaller` -2. 在项目根目录执行打包:`pyinstaller build_client.spec` -3. 将 `dist/BOSS直聘Worker客户端/` 文件夹发给客户,客户双击 `BOSS直聘Worker客户端.exe` 即可使用(GUI 与 Worker 已合并为同一程序,无需 worker.exe) +2. 在项目根目录执行打包:`pyinstaller --clean build_client.spec` +3. 将 `dist/BOSS直聘Worker客户端.exe` 发给客户,下载后先保存到本地文件夹(如桌面),再双击运行(GUI 与 Worker 已合并为同一程序,无需 worker.exe) ### GUI 功能说明 @@ -43,4 +43,5 @@ python app.py > **说明**: > - 若使用「更新」功能,需在客户电脑安装 Git,并将 exe 放在项目(git 仓库)目录内。 -> - 若不使用「更新」,可只分发打包后的 exe,客户只需填写服务器地址等信息后点击「启动」即可。 +> - 若不使用「更新」,可只分发打包后的 exe,客户只需填写服务器地址等信息后点击「启动」即可。 +> - 不要直接在浏览器下载弹窗里点“打开”,请先保存到本地后再运行,避免在临时目录运行导致依赖加载失败。