Gordon McMillan's Installer - Data files in the archive

Paul Moore gustav at morpheus.demon.co.uk
Fri May 31 09:10:48 EDT 2002


I see from the documentation of Gordon McMillan's Installer that you
can include arbitrary data files in a built executable, using
something like (from the documentation)

         collect = COLLECT(a.binaries + 
                    [('readme', '/my/project/readme', 'DATA')], ...)

Given that you can do this, how do you get at the file from within
your application?

In a --onedir build, the data files are part of the directory, so you
can just find them via sys.executable. But in a --onefile build, how
do you get at them?

Also, can you make a --onedir build include data files in the
generated EXE, not as separate files?

On a (semi-) related note, is it possible to make Installer *not*
track dependencies back into the installed copy of Python, and so
produce executables which assume the existence of an installed copy of
Python on the target system? For a simple test application using
wxPython, the base EXE in a --onedir build was 350K, whereas the
support DLLs were nearly 8M. If I'm only distributing to people who I
can rely on to have Python and wxPython installed, the saving in
bandwidth is enormous. (OK, so I could send out a ZIP of the
application plus data files, but a single-file "just run this EXE"
distribution really is a good thing...)

[As you can imagine, this all sort of stems from the recent "JAR file
equivalent for Python" thread, and my wondering if Installer was a
reasonable match for the required functionality...]

Thanks,
Paul.




More information about the Python-list mailing list