Aeva / nw-converter

Parser and converter for the .nw level file format
GNU General Public License v3.0
8 stars 4 forks source link

standalone windows exe distribution script #15

Open Aeva opened 7 years ago

Aeva commented 7 years ago

Create a script that generates a stand-alone windows exe file for the gui tool, using pyinstaller.

Actionable things:

Aeva commented 7 years ago

With some experimentation, I was able to get the gui to run on windows. However, the "pyinstaller" build was not successful. It did complain that it could not find "C:/Python27/share/gir-1.0.", and there is indeed no "share" directory.

The steps I've taken so far were:

  1. install 32bit python 2.7
  2. install pillow
  3. install the "all in one" windows python-gobject" bundle. Make sure that "gtk" is included for install.

From there, you can run the converter_gui.py script from this project, and the basic functionality seems to work ok. I only tested the png exporter, though.

Also note, pillow must be installed from the commandline, via easy_install or pip, so it is definitely necessary to bundle an exe, as I expect most users interested in this would not know how to do this :/

Also note, with the above it takes almost a minute for the program to start O_O wtf

Aeva commented 7 years ago

Some more progress. There is a bug in pyinstaller with regards to the gobject introspection stuff. It can be worked around by copying c:/python27/lib/site-packages/gnome/share to c:/python27/.

Second problem, is that this needs to be built with freeze, so do something like pyinstaller -F converter_gui.py.

The resulting program will still crash, unfortunately. Its hard to get the command output, but I got a screenshot D: The relevant error in the traceback is: gi.RepositoryError: Typelib file for namespace 'GdkPixbuf', version '2.0' not found

Getting warmer :O

Aeva commented 7 years ago

Ok, got it to build after some helter skelter work-arounds: