JAR equivalent in Gordon McMillan's Installer

Chris Liechti cliechti at gmx.net
Thu Feb 14 17:34:12 EST 2002


Paul Moore <gustav at morpheus.demon.co.uk> wrote in
news:efao6us1tt3ut2hp6aor19p7qfqad3k4t1 at 4ax.com: 
...
> Hmm. Looks more messy than I'd hoped. Needs a bootstrap module, and
> then extra hacking to handle open/read. And I guess the fact that 
> I'm doing this manually means that there's not much chance of 
> something like a wxPython toolbar "just working" with icons stored
> in the archive. 

well you could pack the stuff in a zipfile and retreive the data with 
the zipfile module. you get the data as string but you can wrap that 
again in a cStringIO object to get a file-like object.

but then wxWindows Bitmap.LoadFile wants real file...
but: """wxBitmapFromXPMData(listOfStrings)  Create a bitmap from a 
Python list of strings whose contents are XPM data""" so you would be 
limited to XPM images.

py2exe uses a zip as storage and adds a loader in front of it a la 
self-extract zip. those files can be opened with e.g with WinZip maybe 
you could add files this way too (never tried myself)?

as described above getting data from a file-like object to an 
extestion in c isn't that painless. of course you could allways create 
a temp file (os.tmpfile()), copy the stuff from the zip to that file 
and use it (Bitmap.LoadFile(temp)) etc.


> I guess it's not worth the hassle.

the following could be worth a try:
  -make a py2exe dist
  -add data files

the running programm does:
  -extract data to a temp file for extensions that need a file
   (i.e. for Bitmap.LoadFile())
  -store thedata in a cStringIO object for pure python stuff
   (config files, readme.txt for an help dialog etc.)

> The reason I liked the Java approach, BTW, is that a complete
> application comes in a single file, which you can just double click 
> on and it works. Nothing to unpack, put it anywhere you like, run 
> off a floppy/CD/zip disk, no dependencies (other than needing Java
> installed). But it's just a convenience thing - not enough to endure
> writing all my code in Java :-)

yes its easy when you have a jar but i don't understand why "java" 
just doesn't cut off ".class" so that you could launch those files by 
doubleklick too....

> Nice to keep an eye on what the competition can do, though...

<sarcasm>
yeah, they finaly made it to include it a select like interface for 
e.g. sockets "to write high performace/scalable servers" and regex'es 
are now included in the 1.4 release thats out these days, wow. again 
ten years and they *might* catch up to python...
</sarcasm> ;-)

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list