• Advertisement

Archived

This topic is now archived and is closed to further replies.

Reducing Size of Delphi Executables

This topic is 5777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not that Delphi doesn't already compile nice tight binaries, but what is the best way to shave of some of those bytes (If you really needed to). I'm speaking specifically any compiler switches I should have off or on. Currently when I unselect all the debug options my binary stays the same size, does this mean it's unlikely to get any smaller? [edited by - Xorcist on April 18, 2002 3:12:45 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Unless you really need VCL, write the UI in Win32 API instead. Or use runtime packages. As you probably know, the Forms unit is usually what makes Delphi EXEs huge.

Share this post


Link to post
Share on other sites
depends on how much size we''re talking. The vcl obviously adds a lot (about 150k.) The compilier switch don''t seem to do all that much maybe 1k or so here or there. I have noticed that if you have debugging on it will only increase your size if you have warnings in your code, so make sure you don''t have any of those.

Also one of the biggest none vcl units is SysUtils if you can do away that you can sometimes save as much as 50k on a console app.

Share this post


Link to post
Share on other sites
You can also use a packer like ASPack (written in Delphi) , UPX or PECompact.

ASPack and UPX should reduce the file size to about 40% of the original size.

Share this post


Link to post
Share on other sites
Thanks guys, I appreciate the input. I assume then that it is possible to write a program in Delphi (or rather just Object Pascal), similar to the way I would in C, with a main and a WinProc etc. (thus excluding the VCL entirely). The question now becomes, does anyone know of any good tutorials / books / resources I can browse over to get me started.

Share this post


Link to post
Share on other sites
quote:
Original post by Xorcist
Thanks guys, I appreciate the input. I assume then that it is possible to write a program in Delphi (or rather just Object Pascal), similar to the way I would in C, with a main and a WinProc etc. (thus excluding the VCL entirely). The question now becomes, does anyone know of any good tutorials / books / resources I can browse over to get me started.

This tutorial on my site should get you started. It talks about writing API stuff about half-way through.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Check ->

Key Objects Library
http://bonanzas.rinet.ru/

You make still design the Delphi form graphically but the exe ends up 90k (60k compressed) instead of 300k.


quote:
Original post by Xorcist
Very cool, thanks.


Share this post


Link to post
Share on other sites

  • Advertisement