الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف اقلل من حجم exe

مغلق
بدأه sal1150 في 27 سبتمبر 2003 · 4 رد · 1,061 مشاهدة · في لغة Delphi
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

صممت برنامج قاعدة بيانات لاتتعدى فيه النماذج الخمسة...

ولكني فوجئت بأن حجم البرنامج جدا كبير في حدود 2 ميقابايت

فهل هناك طريقة لتقليل حجم الملف التنفيذي؟

#2

أخي الكريم

السلام عليكم ورحمة الله وبركاته

يقوم هذا البرنامج بضغط ملف الـ EXE بنسبة 60% على اقل تقدير

http://www.aspack.com

تقبل تحياتي

#3

شكرا اخوي ابوهاني

كما تعلم ان اكثر المبرمجين المستقلين لا يثقوا بكود الغير...

فهل هناك خطوات برمجية للدلفي لتجنب الحجم الكبير؟

#4

سلام

هناك أستخدام افتراضي للوحدات بالائحة Uses

جرب أن تحذف الوحدة التي ليس عمل

كما أنصحك بالإقتصاد بإستخدام الموارد Resourses

سلام

#5

There are several ways to reduce a EXE's size:

1) Use a EXE-Packer (UPX, ASPack,...)

2) Write your application without VCL

3) Use KOL.

4) Use StripReloc.

5) Deactivate remote debugging information and TD32.

6) You might want to put code in a dll.

7) Don't put the same images several times on a form. Load them at runtime.

{*****************************************}

Mit Delphi erstellte Exe-Dateien sind im allgemeinen einiges gr÷sser als solche,

welche mit anderen Programmiersprachen erzeugt wurden.

Der Grund daf³r ist die VCL. (Klar, Die VCL bringt viele Vorteile...)

Es gibt verschiedene M÷glichkeiten, um die Exe-Gr÷sse zu reduzieren.

1) Einen EXE-Packer verwenden (UPX, ASPack, ....)

2) Die Anwendung ohne VCL schreiben (nur mit API, nonVCL)

3) KOL verwenden.

4) StripReloc verwenden.

5) Debug Informationen und TD32 ausschalten

6) Je nachdem Code in eine Dll auslagern.

7) Wenn Bilder mehrmals verwendet werden, dann nur einmal einbinden

und die anderen zur Laufzeit laden.

{*****************************************}

// Further descriptions and links:

// Beschreibungen in Englisch und Links:

{****************************************************************}

UPX is a free, portable, extendable, high-performance executable

packer for several different executable formats. It achieves an excellent

compression ratio and offers very fast decompression.

Your executables suffer no memory overhead or other drawbacks.

http://upx.sourceforge.net/

{****************************************************************}

ASPack is an advanced Win32 executable file compressor, capable of reducing the file size of

32-bit Windows programs by as much as 70%. (ASPack's compression ratio improves upon the

industry-standard zip file format by as much as 10-20%.) ASPack makes Windows 95/98/NT

programs and libraries smaller, and decrease load times across networks, and download

times from the internet; it also protects programs against reverse engineering

by non-professional hackers.

Programs compressed with ASPack are self-contained and run exactly as before,

with no runtime performance penalties.

http://www.aspack.com/aspack.htm

{****************************************************************}

KOL - Key Objects Library is a set of objects to develop power

(but small) 32 bit Windows GUI applications using Delphi but without VCL.

It is distributed free of charge, with source code.

http://bonanzas.rinet.ru/

{****************************************************************}

Exclude any debug information for the final build

(project-Options Compiler - Debugging and project-Options

Linker EXE and DLL options)

Dependeing on the amount of Debug information,

Debugging can take up until half of the size.

The options that are going to singificantly reduce your file size are

"Include TD32 debug info" and "Build with runtime packages". If you are

shipping commercial applications, you usually don't need the debug info

linked with your project.

{****************************************************************}

The forms in your project have any bitmaps on them, then these are

compiled into the EXE. If you use the same bitmap multiple times, don't

assign them at design-time in the IDE as it will be included in the EXE

multiple times, assign them in code instead.

This can help reduce the size of the EXE, especially if you use large

bitmaps.

Use JPEG-files instead of BMP-files. This also reduces the EXE size.

{****************************************************************}

Delphi lets you have it both ways. If you want tiny EXE's, then don't use

the VCL. Its entirely possible to use all the rich features of Delphi IDE

using 100% WinAPI calls, standard resources, etc.

http://luckie-online.de/delphi/nonvcl.shtml

http://www.erm.tu-cottbus.de/delphi/stuff/...nVCL/index.html

{****************************************************************}

StripReloc is a free (GPL license) command line utility that removes the relocation

(".reloc") section from Win32 PE EXE files, reducing their size.

Most compilers/linkers (including Delphi) put a relocation section in EXE files,

but this is actually not necessary since EXEs never get relocated.

Hence, a relocation section only wastes space.

هذا الموضوع مغلق.

مواضيع مشابهة