Mega Code Archive

 
Categories / Delphi / Examples
 

How to minimize the code [exe size]

Q: Do anyone could inform me how to minimize the code? Maybe, really removing debug information? A: The only options that makes the Delphi linker include debug information into the finished executable is the option to include TD32 Debug Info. In Delphi 5 this is under menu item Project | Options on tab 'Linker' in the field 'EXE and DLL options'. Below is a little example program. The size of the output file RegistryDel.exe was.. 60 kB linked without TD32 debug info 970 kB linked including TD32 debug info program RegistryDel; uses Windows, Registry; {$R *.RES} var s : string; begin with TRegistry.Create do begin RootKey := HKEY_CURRENT_USER; s := ParamStr(1); if s='' then s := '\Software\Microsoft\MediaPlayer\Player\RecentURLList'; DeleteKey (s); Free; end; end.