views:

272

answers:

1

There are plenty of great answers to questions about making a standalone executable, but I can't figure out how to pack art assets (or dynamically loaded files) into it as well. Why would I want to do this? Because it would be great to distribute a simple (throw away) game that lives entirely in a single executable with no installer.

As far as I can tell from searching, there are two basic approaches.

1) Avoid art assets in favor of content generation. I could have a program that turns a simple sprite into a RLE pixel-color list that lives in a python script. Since it's a script, it would get bound up into the exe with a packaging tool. Right?

2) Use some kind of self-extracting archive that can dump the directory structure into a temp directory (or maybe into memory?), then automatically run the entry point of the program.

Does what I'm trying to do make sense? The second option seems so much more sensible, but I'm not sure which tools would be used to accomplish it with python and pygame. I've used py2exe, but it only packaged python scripts and imported modules.

So what does S.O. think? Thanks a lot, y'all.

EDIT:

This thread makes me think that you can tell the packaging utility to include program data along with the dependencies. Is that true?

A: 

Game development is not field of expertise, but if you haven't already checked out py2exe, I would strongly recommend that you do. It seems to me that any and all scripting import statements will be taken care of by py2exe.

Hope this helps

inspectorG4dget
Thanks, but I've already checked out py2exe. I'm scouring their website for a way to include program data (like an image file) in with the executable, but this doesn't seem possible. Am I mistaken?
capsid
inspectorG4dget
Nice!!! That doc did it for me. Apparently, there is an option called 'data_files' that you can set in your setup function.Here's a page about it on the py2exe site:http://www.py2exe.org/index.cgi/data_filesThanks a lot.
capsid
That's great. Thanks for letting me know that it works
inspectorG4dget