Board index » delphi » Reducing EXE size

Reducing EXE size

Ive been using Delphi 1 and 2 for a while now and Ive seen a little
information on how to reduce the size of your Delphi EXE files but not
much.

w8loss.exe is pretty good for delphi 1 apps but what about delphi 2 ?

Any way to get the EXE <100k ? Even a simple program which does
nothing can be pretty big in filesize.

If you have any info, links to sites with info or whatever then please
let me know.

Barry

 

Re:Reducing EXE size


On Mon, 09 Feb 1998 02:36:58 GMT, rbjo...@therightside.demon.co.uk

Quote
(Arbie) wrote:
>Ive been using Delphi 1 and 2 for a while now and Ive seen a little
>information on how to reduce the size of your Delphi EXE files but not
>much.

>w8loss.exe is pretty good for delphi 1 apps but what about delphi 2 ?

>Any way to get the EXE <100k ? Even a simple program which does
>nothing can be pretty big in filesize.

>If you have any info, links to sites with info or whatever then please
>let me know.

I've seen a product called Shrinker mentioned in a brochure sometime -
I think it's the one included with D3Pro. Shrinker will (allegedly)
shrink your .exe size by up to 60%. One day when I have time I'll have
a look at that. You may try to find the product at

http://www.InstantSoftware.com

Re:Reducing EXE size


Quote
rbjo...@REMOVETHIStherightside.demon.co.uk (Arbie) wrote:
>Any way to get the EXE <100k ? Even a simple program which does
>nothing can be pretty big in filesize.

Do everything with straight API calls.  If you include the Forms unit
in your project and use the VCL, your program will immediately inflate
to 200k.

On the surface, your program may not do anything, but that 200k gives
you error handling, easy ways to deal (cleanly) with most Windows API
calls, etc.  The house may not look like much, but it's sitting on one
hell of a foundation.

(Since the initial filesize is almost entirely infrastructure for GUI
support, you'll find in bigger projects that your .exe grows very
slowly after that initial 200k investment.)

--
To a man who only has Visual Basic, everything looks like a control array.

Re:Reducing EXE size


In article <34e4aa32.14786...@news.usinternet.com>, Dave Sherohman
<es...@corlabs.com> scribbled :

Quote
>rbjo...@REMOVETHIStherightside.demon.co.uk (Arbie) wrote:
>>Any way to get the EXE <100k ? Even a simple program which does
>>nothing can be pretty big in filesize.

>Do everything with straight API calls.  If you include the Forms unit
>in your project and use the VCL, your program will immediately inflate
>to 200k.

>On the surface, your program may not do anything, but that 200k gives
>you error handling, easy ways to deal (cleanly) with most Windows API
>calls, etc.  The house may not look like much, but it's sitting on one
>hell of a foundation.

>(Since the initial filesize is almost entirely infrastructure for GUI
>support, you'll find in bigger projects that your .exe grows very
>slowly after that initial 200k investment.)

Or link dynamically to the Delphi RTL if you've got v3.0 :)
You could also compile as a console app {$APPTYPE=CONSOLE}.

Also, you should not only nuke the Forms unit but everything else you
don't need (remove includes one by one until you get an error).

Remember that SysUtils can also boost your program to 40K as opposed to
a 20K console/GUI app.

Have you considered Borland Pascal, or Watcom C [ouch]?
These are better suited to WinAPI programming than Delphi, really, and
produce smaller executables too.

--
UK Area Codes for Win32 - find any UK Area Code!
Soon to be released. Mail for more information!

# SHA in perl5 (echo CryptoIsCool | sha)
#!/bin/perl -iD9T4C`>_-JXF8NMS^$#)4=L/2X?!:@GF9;MGKH8\;O-S*8L'6 -SHA in perl5
@A=unpack"N*",unpack u,$^I;@K=splice@A,5,4;sub M{($x=pop)-($m=1+~0)*int$x/$m};
sub L{$n=pop;($x=pop)<<$n|2**$n-1&$x>>32-$n}@F=(sub{$b&($c^$d)^$d},$S=sub{$b^$c
^$d},sub{($b|$c)&$d|$b&$c},$S);do{$l+=$r=read STDIN,$_,64;$r++,$_.="\x80"if$r<
64&&!$p++;@W=unpack N16,$_."\0"x7;$W[15]=$l*8 if$r<57;for(16..79){push@W,L$W[$_
-3]^$W[$_-8]^$W[$_-14]^$W[$_-16],1}($a,$b,$c,$d,$e)=@A;for(0..79){$t=M&{$F[$_/
20]}+$e+$W[$_]+$K[$_/20]+L$a,5;$e=$d;$d=$c;$c=L$b,30;$b=$a;$a=$t}$v='a';@A=map{
M$_+${$v++}}@A}while$r>56;printf'%.8x 'x5 ."\n",@A

Re:Reducing EXE size


In article <JgXgcXAMHa50E...@netbook.demon.co.uk>, James MacDonald
<tr...@netbook.demon.co.uk> scribbled :

Quote
>In article <34e4aa32.14786...@news.usinternet.com>, Dave Sherohman
><es...@corlabs.com> scribbled :
>>rbjo...@REMOVETHIStherightside.demon.co.uk (Arbie) wrote:
>>>Any way to get the EXE <100k ? Even a simple program which does
>>>nothing can be pretty big in filesize.

>>Do everything with straight API calls.  If you include the Forms unit
>>in your project and use the VCL, your program will immediately inflate
>>to 200k.

>>On the surface, your program may not do anything, but that 200k gives
>>you error handling, easy ways to deal (cleanly) with most Windows API
>>calls, etc.  The house may not look like much, but it's sitting on one
>>hell of a foundation.

>>(Since the initial filesize is almost entirely infrastructure for GUI
>>support, you'll find in bigger projects that your .exe grows very
>>slowly after that initial 200k investment.)

>Or link dynamically to the Delphi RTL if you've got v3.0 :)
>You could also compile as a console app {$APPTYPE=CONSOLE}.

>Also, you should not only nuke the Forms unit but everything else you
>don't need (remove includes one by one until you get an error).

>Remember that SysUtils can also boost your program to 40K as opposed to
>a 20K console/GUI app.

>Have you considered Borland Pascal, or Watcom C [ouch]?
>These are better suited to WinAPI programming than Delphi, really, and
>produce smaller executables too.

Oops.. another followup!

You could also use wwPack32 if your image is PE, and then top it off
with PE-CRYPT by rand0m to add anti-debug code and CRC checking.

Don't use STNPEE or PESHIELD, because these can be unpacked with the
greatest of ease, they're not worth the extra 800 bytes or so :)

Other Threads