On 03/04/2007 22.57, Greg Copeland wrote:
> I would like to create a data package to be included with in single
> file executable. Thus far, I seem to be coming up empty on exactly
> how to do this. I can add data files without issue but having it
> create a package and add it is perplexing.
>
> My data looks like:
> dir/file1
> dir/file2
> dir/file3
>
> I would like the contents of dir to be packaged as dir.pkg.
You can use the PKG() command in spec files to create a package. This is
documented, and you should be able to achieve that. You will want to use the
'DATA' typecode. Something like:
pkg = PKG([(fn, fn, 'DATA') for fn in glob("dir/*")])
After that, you can add the pkg to your EXE (add it to the toc using the 'PKG'
typecode).
> The other item which seems to be lacking on my part is automatic
> extraction on start up.
I assume you're using single-file mode...
> I assume I need to openEmbedded on the
> binary, when the application is detected as frozen, and itterate
> through each item, extracting as I go? Hmm. If that is the case,
> perhaps simply not attaching the datafiles is a better direction.
Well, it depends on why you're attaching those data files in the first place.
PyInstaller is not meant to replace MSI, InnoSetup, NSIS, RPM, DEB, or any
other packaging system of your choice. PyInstaller is meant to grab every
dependency which is strictly related to Python and third party libraries and
"put them together".
If your application uses external data files (like most applications out
there), just put them next to the executable, and ship everything together
with an installer. The support for data files is actually meant for third
party libraries using data files (and it's going to be enhanced with
pkg_resources API support as soon as I find time to work on it), or for those
rare cases where you really have just one or two data files and you don't want
to setup an installer just because of that.
--
Giovanni Bajo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---