Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat Can I Do To Reduce My Executable's Size (Delphi)?
    primarykey
    data
    text
    <p>I release a single executable (.EXE) for a desktop program using Delphi 2009. I have no external DLLs or resources that I need for the program to run.</p> <p>I use two components: <a href="http://www.lmdinnovative.com/products/lmdelpack/" rel="nofollow noreferrer">LMD Innovative's ELPack</a> and <a href="http://www.trichview.com/" rel="nofollow noreferrer">Sergey Tkachenko's TRichView</a> that are compiled into my executable.</p> <p>When I build my production version, using the "Release" build configuration, the executable file produced is 13,533 KB. </p> <p>Prior to using Delphi 2009, I was using Delphi 4. The executable it produced was only 2,671 KB while incorporating the same two components and basically having the same code as my current version.</p> <p>I do understand that Delphi 2009 is completely Unicode (which is the main reason why I upgraded), and being Unicode can cause up to a doubling of size. But this is about 5 times larger.</p> <p>Is there a reason why my executable has to remain 5 times larger? Or are there some simple ways to cut down a significant chunk of the executable size?</p> <hr> <p>Please note. Some people are answering with ways to compress the Delphi EXE. That is not what I am trying to do. I am trying to simply see why so much space is being used to remove what might not be necessary. If that is done, compression can still be done afterwards if so desired.</p> <p>It really doesn't matter how big or small the executable is once it is installed. It is for downloading purposes and to minimize server load and download times that you want to compress it. I prefer to use <a href="http://www.jrsoftware.org/isinfo.php" rel="nofollow noreferrer">Inno Setup</a> and compress the program inside the install routine itself. Then when it is installed, it is expanded to full size. That both prevents possible detection as a virus and eliminates the extra startup time needed to uncompress the program in memory. Also I code sign both my executable and my install routine and some compression techniques are incompatible with that.</p> <p>For more info about compressing, see the StackOverflow question: <a href="https://stackoverflow.com/questions/800505/delphi-exe-compressor/800553">Delphi EXE compressor?</a></p> <hr> <p>ldsandon asked me to provide exactly what options I'm using, so here they are:</p> <p><a href="http://www.beholdgenealogy.com/img/compilingoptions.jpg" rel="nofollow noreferrer">Compiling Options http://www.beholdgenealogy.com/img/compilingoptions.jpg</a></p> <p><a href="http://www.beholdgenealogy.com/img/linkingoptions.jpg" rel="nofollow noreferrer">Linking Options http://www.beholdgenealogy.com/img/linkingoptions.jpg</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload