Tags: 7zip, app, application, developing, distributing, including, libraries, libraryzip, programming, pysqlite, python, therei, wxpython

library.zip and 7zip

On Programmer » Python

5,040 words with 7 Comments; publish: Tue, 29 Apr 2008 18:42:00 GMT; (200203.13, « »)

Hello there

I am developing an application using wxPython and some other libraries

(including, now pysqlite 0.5.1).

I am distributing this app using py2exe and innosetup

I'm trying to reduce the size of my distribution (the setup.exe file as

well as the final install size)

I am using upx to reduce the size of my executables (not a clue how it

works, but it does reduce the size significantly)

Now I am trying to use 7 zip to reduce the size of my library.zip file,

but this seems to break the application.

I am trying to do this: (from

http://starship.python.net/crew/the...tterCompression)

7z.exe -aoa x library.zip -olibrary\

del library.zip

cd library\

7z.exe a -tzip -mx9 ..\library.zip -r

cd..

rd library /s /q

upx.exe --best *.*

which works fine when I skip the 7z bit, but that breaks it?

Any advice ?

thanks

jaco

All Comments

Leave a comment...

  • 7 Comments
    • Jaco Smuts wrote:

      > Now I am trying to use 7 zip to reduce the size of my library.zip

      > file, but this seems to break the application.

      Describing a failure in such a vague manner as 'seems to break' is

      not likely to help us help you.

      Can you be more specific? Exception traceback? Error messages?

      Anything?

      -Peter

      #1; Tue, 29 Apr 2008 18:43:00 GMT
    • Jaco Smuts wrote:

      > which works fine when I skip the 7z bit, but that breaks it?

      7z uses LZMA, which is a different compression method.

      Tim Delaney

      #2; Tue, 29 Apr 2008 18:44:00 GMT
    • Delaney, Timothy C (Timothy) wrote:

      > Jaco Smuts wrote:

      >

      > 7z uses LZMA, which is a different compression method.

      I was going to say the same thing, until I checked the

      7zip web page and found that the -tzip option specifies

      a standard zip file, not the 7z format. Interestingly,

      7zip claims to improve on the compression ratio even

      for the standard format (e.g. about 7% better on the

      Canterbury Corpus file set).

      -Peter

      #3; Tue, 29 Apr 2008 18:45:00 GMT
    • Peter Hansen wrote:

      > Delaney, Timothy C (Timothy) wrote:

      >=20

      >=20

      > I was going to say the same thing, until I checked the

      > 7zip web page and found that the -tzip option specifies

      > a standard zip file, not the 7z format. Interestingly,

      > 7zip claims to improve on the compression ratio even

      > for the standard format (e.g. about 7% better on the

      > Canterbury Corpus file set).

      Ah - I missed the -tzip option :( Hmm - so it *should* work -

      technically.

      Jaco - are you *absolutely* positive that you are using -tzip? Just in

      case it's a simple mistake (typo, etc).

      Tim Delaney

      #4; Tue, 29 Apr 2008 18:47:00 GMT
    • Delaney, Timothy C (Timothy) wrote:

      > Ah - I missed the -tzip option :( Hmm - so it *should* work -

      > technically.

      > Jaco - are you *absolutely* positive that you are using -tzip? Just in

      > case it's a simple mistake (typo, etc).

      Maybe trying to read the file with Python's own zipfile

      module would be a good idea. I assume that the import

      mechanism basically uses the same (de)compression engine

      (ie. zlib.pyd). If it can't read it, then obviously

      -tzip or no, the problem is with 7z compression.

      -Peter

      #5; Tue, 29 Apr 2008 18:47:00 GMT
    • Jaco Smuts wrote:

      > ... I am trying to use 7 zip to reduce the size of my library.zip file,

      > but this seems to break the application...

      > Any advice ?

      7zip uses the most recent ZIP specification, while Python's zip only

      allows access to "ZIP_STORED" and "ZIP_DEFLATED" compression. I've a

      back-burner project to add at least BZIP2 compression to zipfile, but

      I've had problems getting good small test cases using other

      compressions. I tried 7zip when I was looking, but it was pretty

      broken on Win2K at the time. Sometime this fall, the patent on

      "IMPLODE" will expire,and that may be the right time to add that

      as well to zipfile.

      -Scott David Daniels

      Scott.Daniels.python.questionfor.info.Acm.Org

      #6; Tue, 29 Apr 2008 18:48:00 GMT
    • Scott David Daniels wrote:

      > Jaco Smuts wrote:

      >

      > 7zip uses the most recent ZIP specification, while Python's zip only

      > allows access to "ZIP_STORED" and "ZIP_DEFLATED" compression. I've a

      > back-burner project to add at least BZIP2 compression to zipfile, but

      > I've had problems getting good small test cases using other

      > compressions. I tried 7zip when I was looking, but it was pretty

      > broken on Win2K at the time. Sometime this fall, the patent on

      > "IMPLODE" will expire,and that may be the right time to add that

      > as well to zipfile.

      Shouldn't somebody remove that recipe from the wiki then? Or

      can it in fact work (sometimes?), and the explanation is something

      else?

      -Peter

      #7; Tue, 29 Apr 2008 18:49:00 GMT