🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Important NSIS tip

Published June 12, 2006
Advertisement
If you're using NSIS as your installer, here's an option that can potentially save you a ton of space, especially if you have redundant data.

The "SetCompressor" option in your script has a few new options in it. The old options of what compression type to use (gzip vs lzma vs BZIP2) is still there, but there's an important option that's appeared since I last used the program. That's the /SOLID option.

What that does is compress all of your installable files together rather than separately. Sorta like if you had three files to compress, you could make three ZIP files or one ZIP containing all three files. Compiling the three files together is more efficient because there's a better chance of it finding redundant (i.e. easily compress-able) data.

And this makes a HUGE difference if you have stuff that packs runtime information in. My current standalone games EXE files clock in at a little over 2 meg each, but about 1.5 meg of that bulk is the Flash runtime engine. Since the runtime chunk of the game EXE files are all the same in each file, any compressor worth its salt can compress the large amount of redundant information down to almost nothing.

The upshot is that my SETUP.EXE was 13.5 meg without the /SOLID option set, but it shrank down to 3.4 meg with the option on because it compressed all the redundant runtime stuff down to nil.

Oh, and this improvement was only visible when using the LZMA compression. The other included compressors (BZIP2 and ZLIB) weren't worth a damn.

And, just to make Bryan happy (because he's helping me beta-test), I made a table. Unfortunately, the table HTML is turned off for journals (so people can't write malicious tables that'll delete files on your machine, I guess), so here it is in longhand.


ZLIB:
no /SOLID = 13,463,552 bytes
/SOLID = 13,466,361 bytes

BZIP2
no /SOLID = 13,623,296 bytes
/SOLID = 13,640,910 bytes

LZMA
no /SOLID = 13,430,784 bytes
/SOLID = 3,549,884 BYTES DAMN!!!


That's right, putting LZMA and /SOLID together gave me an almost four-fold improvement over the others. In fact, the first time I turned the option on, I was pretty skeptical. I had to run the SETUP.EXE on another machine just to make sure I actually got the compression that I was seeing.
0 likes 4 comments

Comments

MauMan
/me wipes a tear from my eye at the sight of the beautiful ascii table...
June 13, 2006 08:09 AM
Pouya
This is an unrelated reply.

John, your games have been distracting me at work for the past couple of weeks. I'm going to sue you for lost productivity.
June 13, 2006 02:19 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement