Reduce size of EXE lazarus / 7-LCL ---------------------------------------------------------------------- Zaher · 2006-12-02 09:37 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 · 2006-12-02 14:05 http://wiki.lazarus.freepascal.org/File_size_and_smartlinking ---------------------------------------------------------------------- felipemdc · 2006-12-02 15:46 Also: http://wiki.lazarus.freepascal.org/Lazarus_Faq#Why_are_the_gener ated_binaries_so_big.3F ---------------------------------------------------------------------- Zaher · 2006-12-02 23:01 Thanks, but 500->1600 3 time i think that make a pain BTW i fall in love with Lazarus. ---------------------------------------------------------------------- Vincent Snijders · 2006-12-03 12:38 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. ---------------------------------------------------------------------- Zaher · 2006-12-04 12:47 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 · 2006-12-05 00:47 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 · 2006-12-05 10:12 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 · 2007-06-06 07:55 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 · 2007-06-06 12:24 if it was possible it would already be there (don't you think ?) ---------------------------------------------------------------------- LazaruX · 2007-06-06 12:27 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 · 2007-06-06 12:37 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. ---------------------------------------------------------------------- Zaher · 2007-06-06 21:51 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 . BTW i use external batch file to build my projects with switches for release, include making the setup. ---------------------------------------------------------------------- nelson777 · 2007-07-26 16:22 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 · 2007-07-27 17:44 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. ---------------------------------------------------------------------- nelson777 · 2007-07-27 20:43 And why is that ? ---------------------------------------------------------------------- antonio · 2007-07-27 23:00 Because it fails.