diff --git a/realesrgan-gui-macos.spec b/realesrgan-gui-macos.spec index 35715a8..4d1f5d8 100644 --- a/realesrgan-gui-macos.spec +++ b/realesrgan-gui-macos.spec @@ -8,14 +8,20 @@ import subprocess commit_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('utf-8').strip() version = "0.2.5." + commit_hash +# 判断是否存在 upscayl-bin 文件 +if os.path.exists('upscayl-bin'): + # 存在 upscayl-bin,只需要打包 upscayl-bin + bin = [('upscayl-bin', '.')] +else: + # 不存在 upscayl-bin,打包 realesrgan-ncnn-vulkan + bin = [('realesrgan-ncnn-vulkan', '.')] + # PyInstaller分析脚本 # 指定主入口文件 a = Analysis( ['main.py'], # 需要打包的二进制 - binaries=[ - ('realesrgan-ncnn-vulkan', '.'), - ], + binaries=bin, # 需要打包的数据文件 datas=[ ('models', 'models'),