Archive: Compression Methods


Compression Methods
- Is there any other compression methods available for NSIS besides zlib or bz2?

- if not how can we add other compression methods? (hope it's not too complicated)

- my last question is not NSIS related. What is the best compression method out there? personaly i think winace is the smallest.


personally i use rar. the discussion was on before, rar for instance has to licensed to be integrated into nsis . i guess its a similiar issue with ace.


kichik is working on the integration of LZMA compression (www.7-zip.org), which is about 25% smaller than BZip2 for me.


LZMA sounds cool enough :D


Wow, LZMA compression is really good (even if it's a bit slow).
Will this be integrated anytime soon in NSIS (say, before beta0 is released)?


Originally posted by Netsabes
Wow, LZMA compression is really good (even if it's a bit slow).
Will this be integrated anytime soon in NSIS (say, before beta0 is released)?
Compression is a bit slower of course, but decompression is fast. It won't be integerated in beta 0, but I hope that kichik will have it ready soon. :)

if i remember correctly, winrar's documentation describes how to compress using the rar-algorithm using winrar's very own .dll. this should at least let registered (and trial) users of winrar use rar compression. i'm not sure about legal issues, but that should be documented aswell. this could leave the option to winrar users to compress using rar.

(Win)RAR Homepage


If you want to use another compression method, it's always possible to use DLL's, but integration in NSIS makes it much easier.

Integrating RAR won't be very useful, because LZMA compresses much better.


rar.dll is only for decompression, you'd have to buy rar to compress the data, not to mention the big overhead in the installer because of that dll
using the unrar source code which is available at www.rarlabs.com would be better, additionally you'd have to build an interface to winrar.exe into makensis
unace sources aren't available afaik

lzma doesn't always compresses better than rar, because rar has special compression schemes for multimedia files, images or text files (ppmd) buildin

anyway I vote for using only opensource compression algorythms in nsis


rar is better then zip. Go with rar, my friend.


I have tested a lot of files (executables, graphics, text etc.), LZMA always gives me better results than RAR.


did you test rar 3.0?
and 7z? 7-zip also has ppmd implemented which is not part of lzma, ppmd is responsible for good compression of text files
7z uses multiple algorithms: http://www.7-zip.org/7z.html but it doesn't have special treatment for multimedia files yet

or did you force 7zip to use only lzma compression?


I used only the LZMA compression of 7-zip and RAR 3.0. I didn't use that many text files, maybe PPMD is a little better for 'em, but most software packagers don't have many text files.


Speaking of compression:

If you use the bzip2 compression, you should try to pack your installer with UPX (http://upx.sf.net/). Without it, you have to wait for the installer to have uncompressed the data (it's a bit slow because of bzip2), but with UPX, the installer is shown instantly.

This is very useful if you have a big installer (and if it takes some time to uncompress) :)


Huh? What does UPX has to do with bzip2 compression?


Hmm, I must be dumb, it works without UPX too. Did you update the bzip2 code between a7 and the current cvs? I suppose it must be that.


Yes, some bugs have been fixed in the CVS version that caused it to load slower.


Could we get some method of a "degree of compression" versus "speed" facility.

Say, if we compress the stuff with a compression level of say 5/9 then we have a trade off between size and speed.

I don't know whether different levels are possible in zlib2, bzip or lzma, but RAR does, so hey, go RAR ! :D

- Shantanu


I think decompression speed is also very important. I forgot to mention in the previous post... Why not ZIP ?

- Shantanu


ZIP gives very bad compression ratio's.

LZMA decompressses fast :D


You can change BZip2 compression ratio in config.h and recompile.

LZMA is free, RAR is not. LZMA can be integrated into NSIS, RAR will have to use an external program to compress and decompress (149KB DLL or implemented source). LZMA is already being implemented into NSIS. RAR is not free. Joost have tested a lot and says LZMA compresses better than RAR. To compress with RAR one will have to buy it and install it after he installs NSIS. Have I mentioned RAR is not free?


where can i get NSIS with LZMA intergrated?


LZMA is already being implemented into NSIS.
It is not ready yet. I am working on it ;)

Thanks :)


so, LZMA compresses better than RAR? And ACE?

I remember I tried 7-zip with disappointing results.


Are you sure you compressed using 7z and not Zip?


The 7z format (which uses LZMA) is quite new (last version I think).


I am sure I used 7z format and not zip.
The version I used was 7-Zip v2.30 beta 19, from the end of May 2002.
Now, I am going to download again and test.


Originally posted by n0On3
I am sure I used 7z format and not zip.
The version I used was 7-Zip v2.30 beta 19, from the end of May 2002.
Now, I am going to download again and test.
The comparison should be to zlib and bzip2. Rar and Ace are not free therefore are not available. Based on what I've been told, for a larger number of files, lzma is even better than zlib and bzip2.

UPX is an EXE compressor
http://upx.sourceforge.net/


OK, now I understand why NOT RAR... :up:

What I was saying about the compression level is that, how about an option to set the compression level (say CompressionLevel ?) from within the script

One more thing..._WHATEVER_ compression algorithm you guys use pleeease use whichever one is FREE :) !!!

- Shantanu