Archive: how to less size of NSIS file?


how to less size of NSIS file?
i already compress files by UPX.
and but, how to more less size of nsis installer file?
NSIS exe -> SFX ?
or using tools like zipdll?
i saw a file which make by NSIS.
this file size is 7MB, but execute file, and check all sectionm, required HDD size is 50MB!!!
how to less size like this?
i really want know.

###see attached file


NSIS compression works best on files that are not already compressed.

Example : If nsis compresses a 5mb .zip file full of 10mb .txt it wont go much smaller than 5mb.

Example : If nsis compresses the 10mb .txt's it should go lower than 5mb - maybe as low as 2 - 3mb.

So dont compress with UPX.


Sorry, I've tried to make this as simple as possible. I hope you understand it.


Always compress files only once.

The latest NSIS 2 version support LZMA compression, which performs very well.


afaik, upx doesn't compress txt files, only exes.

I just tested with the program DC++ and using UPX made the installer 21kB smaller, always with LZMA.


UPX should only be used to compress the exehead (use !packhdr), it will save a few KB's.


the 21kB I said was for the exe *in* the installer, nothing to do with the header.


The whole point of UPX is that it can be used to compress executables files and keep them executable. If you add files to an archive UPX won't be an efficient method.


I don't know what you mean for eficient, but if you mean 'smaller', then, it can be more eficient to compress with upx first.

UPX is designed to compress exes, LZMA is designed to compress anything. UPX can therefore be optimized for some things lzma is not.

I don't want to insist on this, but I've done various installers and upxing the exe before building the installer always gave better results.


Originally posted by n0On3
I don't know what you mean for eficient, but if you mean 'smaller', then, it can be more eficient to compress with upx first.

UPX is designed to compress exes, LZMA is designed to compress anything. UPX can therefore be optimized for some things lzma is not.

I don't want to insist on this, but I've done various installers and upxing the exe before building the installer always gave better results.
you are right in nsis zlib/lzma
not sure in bzip2
not in ms's makecab,you can find in ms's ieak

But you still end up with a compressed exe file that will start slower and use more memory.


Originally posted by Joost Verburg
But you still end up with a compressed exe file that will start slower and use more memory.
yeah, miracles do not exist ;)

anyway, what does this mean?

UPX is a free, portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers very fast decompression. Your executables suffer no memory overhead or other drawbacks because of in-place decompression.
the "no memory overhead" part. I thought it *had* overhead :eek:

If you only start one instance it won't be such a problem, but with multiple instances it will definately use more memory.

LZMA works fine for EXE files too. Because it doesn't have to create executables, the compression is usually better.