• entries
    1212
  • comments
    1738
  • views
    1140428

Important NSIS tip

Sign in to follow this  
johnhattan

90 views

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.
Sign in to follow this  


4 Comments


Recommended Comments

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.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

hi,
Its great that LZMA /SOLID gives more compression. But could you tell me what is the setting that has to be made in the LZMA exe to set it to SOLID mode. I did not find any option /SOLID in the LZMA exe by Igor Pavlov. How many files did you test with LZMA /SOLID option? Did you combine the input files or compressed it separately.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

hi,
Its great that LZMA /SOLID gives more compression. But could you tell me what is the setting that has to be made in the LZMA exe to set it to SOLID mode. I did not find any option /SOLID in the LZMA exe by Igor Pavlov. How many files did you test with LZMA /SOLID option? Did you combine the input files or compressed it separately.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now