Recent

Author Topic: Reduce size of EXE  (Read 22521 times)

Zaher

  • Hero Member
  • *****
  • Posts: 683
    • parmaja.org
Reduce size of EXE
« on: December 02, 2006, 10:37:40 am »
Hi, i am new to lazarus/fpc i am porting small project from delphi, and it is done in minutes, but exe size with delphi about 500K and in Lazarus after strip the symbols 1600K is any article can i read or some notes to know how to reduce the size?

Thanks

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1946

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538

Zaher

  • Hero Member
  • *****
  • Posts: 683
    • parmaja.org
RE: Reduce size of EXE
« Reply #3 on: December 03, 2006, 12:01:58 am »
Thanks, but 500->1600 3 time i think that make a pain :) BTW i fall in love with Lazarus.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: RE: Reduce size of EXE
« Reply #4 on: December 03, 2006, 01:38:45 pm »
Quote from: "zaher"
Thanks, but 500->1600 3 time i think that make a pain :)

Yes, it does, if you distribute your software on diskette.  :D

Zaher

  • Hero Member
  • *****
  • Posts: 683
    • parmaja.org
RE: Re: RE: Reduce size of EXE
« Reply #5 on: December 04, 2006, 01:47:42 pm »
Quote from: Vincent

if you distribute your software on diskette
Quote

Yah, i still thinhing like that,  i still have 5.25 diskette some where here ;)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: RE: Reduce size of EXE
« Reply #6 on: December 05, 2006, 01:47:30 am »
Quote from: "zaher"
Thanks, but 500->1600 3 time i think that make a pain :) BTW i fall in love with Lazarus.


You need to take into accound that those 1600 contain a lot of things the 500 don´t contain, like:

PNG support, XML library, Cross-platform, etc.

Christian

  • New Member
  • *
  • Posts: 37
RE: Re: RE: Reduce size of EXE
« Reply #7 on: December 05, 2006, 11:12:01 am »
Quote

Yah, i still thinhing like that, i still have 5.25 diskette some where here Wink


Right, and i love it to use them single sided :p

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
RE: Re: RE: Reduce size of EXE
« Reply #8 on: June 06, 2007, 09:55:59 am »
Why don't we make an option during the compilation, where you can choose the EXE size, the very small, or the very large EXE.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2687
RE: Re: RE: Reduce size of EXE
« Reply #9 on: June 06, 2007, 02:24:15 pm »
if it was possible it would already be there (don't you think ?)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
RE: Re: RE: Reduce size of EXE
« Reply #10 on: June 06, 2007, 02:27:47 pm »
I think it is possible, you must just let execute the strip.exe after the first compiling, and then also the upx compression. Like this
Compile project /: Project is compiled, but not visible, executes strip on the exe created, executes upx on the exe created, starts the executeble.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2687
RE: Re: RE: Reduce size of EXE
« Reply #11 on: June 06, 2007, 02:37:31 pm »
The use of upx has only some artificial gain, I won't recomment in using it (I could also store it on a compressed disk, it has the same effect)
What you describe is already possible, look at the last (compilation) tab of the project settings. However we wont add strip as a default option, since in our opinion debug info is way more important during development than one single strip during release.
We are currently thinking on how to implement different projectoption settings (like Debug or Release)
In that case a user can easely swich between for instance Debug and Release build.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Zaher

  • Hero Member
  • *****
  • Posts: 683
    • parmaja.org
RE: Re: RE: Reduce size of EXE
« Reply #12 on: June 06, 2007, 11:51:03 pm »
Quote

We are currently thinking on how to implement different projectoption settings (like Debug or Release).

Yes we need it especially after Delphi2007 have it finally, but after i moved to Lazarus :P .
BTW i use external batch file to build my projects with switches for release, include making the setup.

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
RE: Re: RE: Reduce size of EXE
« Reply #13 on: July 26, 2007, 06:22:26 pm »
I´m trying to create an integrated way of finalizing the exe with strip and upx. So I created a simple generic batch file based on a personalized (working) file I have on my project:

Code: [Select]
@echo off
copy %1.exe %1t.exe > nul:
strip -s %1t.exe
upx %1t.exe
del %1.exe
ren %1t.exe %1.exe


I put this file (prod.bat) in the Lazarus dir, and configure a Custom Tool directed to it with $ProjFile() as parameter and $ProjPath() as working dir. I got only "The system cannot find the file specified." as return. Has anyone tryed to do something similiar and knows what I´m doing wrong ? Doesn´t Custom Tools work with .bat files ?

Nelson

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: Re: RE: Reduce size of EXE
« Reply #14 on: July 27, 2007, 07:44:15 pm »
Why don't you simply create a shortcut on your desktop?

If you use UPX  intensively, soon you will know why it is not recommended.

 

TinyPortal © 2005-2018