Skip to content

Improve PyInstaller Hook and it's documentation #754

@SirGnip

Description

@SirGnip

Document how to create a self-contained .exe for arcade apps.

I've done some experimentation and have been able to build a redistributable, self-contained single .exe with this command:

pyinstaller src\myapp.py --add-binary "venv\Lib\site-packages\pymunk\chipmunk.dll;." --add-binary "venv\Lib\site-packages\arcade\soloud\soloud*.dll;.\arcade\soloud" --add-data "venv\Lib\site-packages\arcade\resources;.\arcade\resources" --windowed --onefile

I'll write up a "how to package your game to distribute..." doc and add it under the "Tutorial" section of: https://arcade.academy/.

Note: this requires Pymunk 5.7.0 (released a couple days ago) to work properly. I chimed in on a Pymunk issue dealing with better pyinstaller support. A fix got merged and released with 5.7.0 which makes the pyinstaller command above possible. There were issues surrounding Pymunks handling of chipmunk.dll.

Also looking to add a basic pyinstaller call to build.bat so that it is executed as a part of the Travis CI run (resulting .exe will not be used for anything). This will alert us when anything is changed in the repo that breaks compatibility with pyinstaller.

  • create functional Windows-centric PyInstaller hook file
  • add a couple notes for Arcade developers about how to locally edit and test PyInstaller hook files
  • write a "how do I package up my game so I can distribute it easily?" tutorial for users
  • add a section to tutorial that explains how to package up resource files with PyInstaller and make sure your code can read them
  • do a PyInstaller run in .travis.yaml for CI
  • make hook file work for mac and linux (I can't do this as I don't have the hardware)
  • do some better testing to make sure there are no assumptions about current working directory, resource directories used by the game, etc.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions