Recent

Author Topic: Much larger .exe's than 2.0.0  (Read 18237 times)

Aries-Belgium

  • Guest
Much larger .exe's than 2.0.0
« Reply #15 on: October 18, 2005, 04:12:56 pm »
If I create an empty application project and compile it. The exe-file is almost 6MB.

How can I fix it?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Much larger .exe's than 2.0.0
« Reply #16 on: October 19, 2005, 05:21:41 am »
Are you on Windows or on Linux???

The executable is this size because it contains a lot of debug info, something you don't need to send to your customers.

1 - Open a shell or terminal on Linux or a DOS Prompt on Windows or a Cygwin Prompt on Windows. Cygwin is a terminal that emulates the linux command line on Windows. Really great. You can download and install Cygwin here: http://www.cygwin.com/

2 - Write "strip --strip-all myapplication.exe"

3 - Write "upx myapplication.exe"

This way I get a somewhat complex app with a form to get down to:

700 kb on Linux

400 kb on Windows

MarMin__

  • Guest
Much larger .exe's than 2.0.0
« Reply #17 on: October 28, 2005, 05:09:19 am »
I've found a way, to eat some extra size of an application in Lazarus!




First:
____
Rebuild Lazarus LCL with options -CX -XX

Second:
____
Put this after each of your unit name (tedious process, but works:)
 {$SMARTLINKING ON}

Third:
____
Build your game/application/whatever. :evil:

Fourth:
___
Use Strip in a command line,go to directory of you exe,  and remove the Debug info.


Now, an empty form in win32 is only 1.29 Mb (and extra code adds very little so for larger projects the size will not increase much).



After this you can use UPX, or Zip the file to get very small sizes.

eom.

Marmin__

  • Guest
Much larger .exe's than 2.0.0
« Reply #18 on: October 28, 2005, 05:22:25 am »
Correction: the size will be only 1.17 Mb. Acceptable, isn't it, for such a cool cross- platform RAD tool.
I might add this to wiki after I have tested it further.

Anonymous

  • Guest
Much larger .exe's than 2.0.0
« Reply #19 on: November 01, 2005, 12:09:26 pm »
If you want still decrease the size of your program tray UPX (http://upx.sourceforge.net/#download) for non comecrial use is on GPL in comercial you mast bay license (2 licenses) - goodbay.

Phil H.

  • Guest
Run strip from IDE?
« Reply #20 on: November 10, 2005, 08:57:28 pm »
Quote from: "sekel"

1 - Open a shell or terminal on Linux or a DOS Prompt on Windows or a Cygwin Prompt on Windows. Cygwin is a terminal that emulates the linux command line on Windows. Really great. You can download and install Cygwin here: http://www.cygwin.com/

2 - Write "strip --strip-all myapplication.exe"


Strip.exe works very well, but is there some way to run it automatically from the Laz IDE? I'm not sure what the settings on the Compilation tab in the Compiler Options dialog are supposed to do, but it looks as though you can specify a program to run after building a project. How is this supposed to work? Is there documentation anywhere? Playing around with this didn't appear to do anything.

Thanks.

-Phil

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Run strip from IDE?
« Reply #21 on: November 15, 2005, 10:20:27 am »
Yes you can put the command "on run" in compiler options. Note that strip.exe has to be in path. Note also that lazarus would strip it manualy if you selectes -Xs option in linker tab BUT ld is bugged (not a lazarus bug)
Note3: if you strip on run, debugger won't work.

Note4: You don't need to use {$smartlink on} in sources, go to compiler options/linking and use "link smart".

Note5: http://members.chello.sk/ales/guide.html

Phil H.

  • Guest
Re: RE: Run strip from IDE?
« Reply #22 on: November 15, 2005, 03:03:50 pm »
Quote from: "Almindor2"
Yes you can put the command "on run" in compiler options.


Sorry, this doesn't appear to work. Could you please try it and let me know exactly what options you selected in the Compiler Options dialog?

Thanks.

-Phil

wes12

  • New Member
  • *
  • Posts: 21
Re: Run strip from IDE?
« Reply #23 on: December 08, 2005, 06:22:30 pm »
Quote from: "Phil H."
Quote from: "sekel"

1 - Open a shell or terminal on Linux or a DOS Prompt on Windows or a Cygwin Prompt on Windows. Cygwin is a terminal that emulates the linux command line on Windows. Really great. You can download and install Cygwin here: http://www.cygwin.com/

2 - Write "strip --strip-all myapplication.exe"
....


Strip.exe works very well, but is there some way to run it automatically from the Laz IDE? ...
-Phil

Alternatively (not quite automatic, but without all the shell and text hassles) you could add strip as a custom tool under the Tools Menu. Using the $(TargetFile) macro in the Parameters box makes it operate on whatever exe your project produces. I've done the same with UPX.

 

TinyPortal © 2005-2018