For anybody else using Pygame + PyInstaller
The development version of PyInstaller works mostly out of the box with Pygame 1.9.2 over here on Windows 7, albeit for three problems:Using pygame.font.SysFont will crash the distributed executable.
My workaround was to simply bundle a font with an open license with my game.
Game resources are not automatically bundled.
To get around this, you have to manually edit the .spec file generated by PyInstaller.
- First, use utils\Makespec.py to generate the .spec file.
- If you're making a --onefile distribution, put the following line in the EXE entry. Otherwise, put it in the COLLECT entry.
- Tree('\\path\\to\\project\\res', prefix="res\\")
- Build your executable using utils\Build.py
Last, using the --noconsole option on the command line for utils\Makespec.py has the unexpected side effect of putting your created .exe inside a .app folder, as if you were building for Macintosh.
Instead of using the command line option, use the console=False keyword argument to EXE inside the spec file.
Hope that saves some headaches for fellow contestants!
(log in to comment)
tartley on 2012/05/08 07:25:
You might want to add these notes to the PyInstaller 3rd party packages wiki page:http://www.pyinstaller.org/wiki/SupportedPackages