Archived Forum Post

Index of archived forum posts

Question:

Zip does not compress .msi files?

Sep 24 '12 at 09:36

We are using Chilkat Zip for zipping. One of the files to be zipped is a .msi file. We do not see the .msi file being compressed. When the setup.exe created after zipping with Chilkat is opened (with tool like 7-zip) we see the .msi file is listed as "Stored" under Method hence reducing no size.

It should have been Deflate for compression to take place.

With Chilkat Zip will we not be able to zip the .msi file?


Answer

See the Chilkat Zip reference documentation for the AddNoCompressExtension and RemoveNoCompressExtension methods.

Attempting to compress already-compressed data is usually a waste of CPU cycles with little or no benefit. In fact, it is possible that attempting to compress already-compressed data results in a slightly increased size. The Zip file format allows for files to be "stored" rather than compressed. This allows the file data to be streamed directly into a .zip without compression.

An instance of the Zip object has an internal list of "no compress" extensions. A filename with a "no compress" extension is "stored" rather than compressed. Additional "no compress" extensions may be added by calling this method (once per file extension). You should pass the file extension, such as ".xyz" in fileExtension.

"no compress" extensions may be removed by calling RemoveNoCompressExtension.

The default "no compress" extensions are: .zip, .gif, .jpg, .gz, .rar, .jar, .tgz, .bz2, .z, .rpm, .msi, .png