build.py 720 B

12345678910111213141516171819202122232425
  1. from PyInstaller.__main__ import run
  2. import os
  3. # Replace 'your_script.py' with the entry point script of your PyQt application
  4. script_name = 'main.py'
  5. Version = '2.1.3'
  6. output_name = f'OPT-{Version}'
  7. # 获取当前脚本的目录
  8. current_dir = os.path.dirname(os.path.abspath(__file__))
  9. options = [
  10. '--onefile', # Create a single executable file
  11. '--hidden-import=winshell',
  12. f'--add-data={os.path.join(current_dir, "D:/project/py/opt-gitee", "Lib", "site-packages", "winshell.py")};winshell',
  13. f'--add-data={os.path.join(current_dir, "dm")};dm',
  14. f'--name={output_name}', # Specify the output file name
  15. ]
  16. datas = [
  17. ('path/to/plugin_file', 'destination_folder')
  18. ]
  19. run([script_name] + options)