How do you make a smaller EXE build in BlitzPlus?

Community Forums/General Help/How do you make a smaller EXE build in BlitzPlus?

Ts Inventions(Posted 2012) [#1]
Here's one thing I have been wanting to know for a long time now,
how do you make a smaller EXE file in BlitzPlus?

When you make your program into an EXE file build, no matter how small and simple your program actually is,
the created EXE file of your program always seems to be at least about 760KB.

My only guess as to why this is, is because when you create an EXE file like normal,
BlitzPlus is including all the 'resource' data for EVERY command and function that there is in BlitzPlus
in the EXE file.

So I guess what I want to do is somehow tell the BlitzPlus compiler to only include the data for all the
commands and functions that my program(s) actually use/need. This should make the EXE file size a lot smaller.

Is this even possible to do?
Any/all help for me is greatly appreciated!


GaryV(Posted 2012) [#2]
Is this even possible to do?


No.


Yasha(Posted 2012) [#3]
Is this even possible to do?


Not with the stock compiler, no.

I think, but I'm not sure (can't remember), that the compiler will strip out the graphics engine if you don't use it, but... this isn't of much use to you if you do use it. Similarly Blitz3D will produce a smaller program if you only ever use 2D commands (Blitz3D doesn't have a console mode though so you always get the 2D engine). Removing components isn't that easy since the engine is likely quite interconnected and even using a few commands means most of the code will actually end up being required anyway (most of the code is in handling the mechanics of drawing: the commands you see in the API list are all very small wrappers on top of big internal functionality).

One thing you can do is use a exe packer like UPX, which many people do. It's seamless and should not have any noticeable runtime effect (so your users don't know about it). It has a higher chance of causing virus scan false positives though, because of the self-rewriting code. UPX is popular enough that IDEal actually has built-in support for it. Another popular tool is StripReloc, which removes unnecessary data from exe files and might save another couple of KB.

In the grand scheme of things 760KB really isn't much to worry about though. Nowadays for most users the download will be finished before they finish clicking on it. Your art assets are likely to weigh in at much more than this unless it's an extremely minimal project.

Last edited 2012


xlsior(Posted 2012) [#4]
Essentially blitzplus will link in a runtime library into the exe, regardless of whether or not you are using all the components.

blitzmax is much more modular in that respect, you can exclude everything you're not using from the .exe there -- but not in Blitzplus or Blitz3D.

You may be able to shave off a little bit of space by using a 3rd party executable packer like UPX. (Free)

Downside of that is that you may run into the occasional antivirus false-positive since every once in a while an antivirus program will think it looks like some trojan or the other that also happens to be compressed with the same program.


Captain Wicker (crazy hillbilly)(Posted 2012) [#5]
Try this: http://upx.sourceforge.net/
UPX compresses executable files to make them smaller. :)

EDIT: lol xlsior beat me to the punch

Last edited 2012

Last edited 2012


Yue(Posted 2012) [#6]
yes, i am use upx! 1.36 m to 432 k


Yan(Posted 2012) [#7]
Or...You could use UPX?


Hotshot2005(Posted 2012) [#8]
Purebasic used Small executable files size but they are not free like blitz plus