Shrink .EXE???

Miscellaneous Forums/General Discussion/Shrink .EXE???

This has probably been asked before, but is there ANY WAY to shrink a .EXE file made by Blitz and have it work???

I did a search on the forums under SHRINK and had no luck!

UPX?
http://upx.sourceforge.net/

Definitely UPX.

A handy tip (that I'm sure I picked up from these very forums) is to add a shortcut to it in your SendTo directory in Windows (the details of which elude me right now as I type on my Linux box) so all you need do then is right-click on your compiled .exe and select Send To -> UPX in order to UPX it instantly. :o)

when using UPX, make sure to also use the -9 parameter for maximum compression:

upx -9 ips3.exe

Ultimate Packer for eXecutables
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
UPX 1.25w Markus F.X.J. Oberhumer & Laszlo Molnar Jun 29th 2004

File size Ratio Format Name
-------------------- ------ ----------- -----------
80384 -> 28672 35.67% win32/pe ips3.exe

There's a couple of other ones as well (PECompact2, WWPack32) but UPX seems to get the best overall compression ratio and it's free.

(And of course -- if you're using BlitzMax, make sure to also use a framework and only import the modules that your program actually uses, that by itself can cut the size of your app down trememdously. Then run UPX on the resulting exe, and make it even smaller.)

Even better than "-9" is using upx 2.91 with the newly introduced "-brute" parameter. Give it a try.

Brute?! I was going to post about the --best setting but 'brute' totally trounces it. :D

I like it brutal... Muhaha...:D

"-brute" saved around 400kb on my exe (was using "-9" for the compression before!).

It sure takes a lot longer to find the optimal compression.
For maior releases it's definately worth the time!

"-brute" saved around 400kb on my exe (was using "-9" for the compression before!).


Interesting, thanks for pointing that out. I grabbed 2.90 just two weeks ago, didn't know 2.91 was out. I just downloaded the 2.91, and found that the command line help doesn't make any mention of --brute... but it does indeed work.

when I compress a 92Kb blitzmax generated exe it turns into 33,792 bytes with -9, or 33,280 bytes with --brute... But when I throw a larger file at it, the differences get much more pronounced: (Note that a good chunk of that filesize is due to incbinned JPG and PNG images, which are near impossible to compress further)

original: 717,312
-9: 460,288
--brute: 423,424

which means that the brute option shaved off an additional 10%, which certainly is impressive considering I haven't seen another executable packer come by yet that could beat upx -9 in the first place. :-?

So... thanks for bringing up the --brute flag, Grisu!

Your're welcome.

My exe includes a lot of media (~5 MB uncompressed), so this explains (as you already have noticed) why I gain more KB from using the newer upx version.

.

Only tested this under Windows without any issues.

Don't know for Linux or Mac. :(