• Advertisement

Archived

This topic is now archived and is closed to further replies.

OT: maximum .exe size

This topic is 5980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
32MB is a huge executable. How''d you manage to pull that off? lots of resources compiled into the exe?

The largest executable file that I''ve seen was around 8MB that I can recall. If that is mainly code, then the project probably needs to be broken up into a few different dll''s and stuff. I wouldn''t be too surprised if there was some sort of limit, because, if I remember correctly, the earliest versions of DOS had an exe size limit.

J.W.

Share this post


Link to post
Share on other sites
quote:
Original post by jwace81
I wouldn''t be too surprised if there was some sort of limit, because, if I remember correctly, the earliest versions of DOS had an exe size limit.



The largest executable you could have in DOS was 64 KB''s, and that was because it was a 16 bit OS. Now you''re able to (in theory) have an executable of over 2 GB''s. Although, an executable over 32 MB is huge! The largest I''ve seen is 35 MB (it worked in Win98 as well as Win2K), and that was a install file for a demo, I guess they didn''t want you to rip their data files.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Installers regularly have massive executables. 32 Megs shouldn''t be a problem, even in Win9x.


~~~~~~~~~~
Martee

Share this post


Link to post
Share on other sites
quote:
The largest I''ve seen is 35 MB (it worked in Win98 as well as Win2K), and that was a install file for a demo, I guess they didn''t want you to rip their data files.


The executable itself wouldn''t have been 35mb - self-contained installation programs are generally just a small program with a large datafile appended to them.

Share this post


Link to post
Share on other sites
Ive never seen an accual .exe that big


When you hit that point, i would break it into several .dll''s like someone else said.

Share this post


Link to post
Share on other sites
i have a resource which i compile into the exe: it is a .raw file of about 4Mbytes, but i don''t know which is the equivalent of:

char *pMap = (char *)LockResource(LoadResource(NULL, FindResource(NULL, MAKEINTRESOURCE(IDR_RAW), "RAW")));

to let me read the .raw file instead of compiling it into the .exe

glHorizon_Project



www.web-discovery.net


Share this post


Link to post
Share on other sites
There''s this video codec called BINK that can make your video into an .exe with the player built in.

http://www.radgametools.com

I''ve seen executable made with this that have sizes of 100+ mb.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:

i have a resource which i compile into the exe: it is a .raw file of about 4Mbytes, but i don''t know which is the equivalent of:
char *pMap = (char *)LockResource(LoadResource(NULL, FindResource(NULL, MAKEINTRESOURCE(IDR_RAW), "RAW")));
to let me read the .raw file instead of compiling it into the .exe



Well, easy, in plain C that would be (''size'' is your raw file size)

char *pMap = (char *) malloc( size );
fp = fopen( "MYFILE.RAW", "rb" );
fread( pMap, 1, size, fp );
fclose( fp );

Share this post


Link to post
Share on other sites
quote:

There''s this video codec called BINK that can make your video into an .exe with the player built in.

http://www.radgametools.com

I''ve seen executable made with this that have sizes of 100+ mb.



Remember what happened when you tried to run a windows program under DOS? a message of the likes of
"this program can only be run under windows, bugger off!!"

that was what is called a Stub, and its a quite small DOS/CONSOLE program that is appended at the beginin of all windows executables, so you can inform a user that the program wont run in DOS, so the computer doesnt crash trying to run the windows program.

the same principle is applied on self extracting EXE, video EXEs and so on, but this time the stub is actually the player or extractor that is applied to the Data segment.

now this will sound like an echo, but 32 MB for a different kind of exectable as the ones mentioned above is way too much, keep your big resources out of the executable (It just CANT be only code).

Share this post


Link to post
Share on other sites
quote:
The largest executable you could have in DOS was 64 KB''s, and that was because it was a 16 bit OS.


You are not correct about this, imho. This restriction only applies to .com files, which can be loaded only into one segment. Normal .exe files could be loaded to more segments, so they can be >64k.

Regards,
m.

Share this post


Link to post
Share on other sites
As far as I know, there are no limitations on the size of an executable in windows. At work, we have compiled COBOL programs to > 400MB (and that's only code, no resources) and they've run without problems (mind you, it takes about 2 hours and 1GB of memory to link it!)

Edit: I've just had a look in the PE format specification, and the size of the code segment is described by a 4 byte integer, meaning the maximum size is 4GB. Pretty much given in a 32-bit operating system, and seeing as how by default, a 32-bit executable can't access more than 2GB of memory, then you will reach the limit imposed by the hardware before you reach the limit imposed by Windows.

(Technically, the 2GB limit is imposed by Windows, which reserves the upper 2GB of address space for itself, but you know...)

Also, it's possible to access more than 2GB of address space with Windows 2000 Advanced Server and Datacenter Server (don't know about the other flavours) - up to 32GB, in fact. Still, 4GB of code is quite a lot...


codeka.com - Just click it.

Edited by - Dean Harding on September 9, 2001 2:18:53 AM

Share this post


Link to post
Share on other sites
Most installers, BINK videos, etc. are just a regular executable with data appended to the end of the file. The entire file is not loaded into memory, only the code and data segments. The appended data is not included with the data segment since it was appended after the PE header was created. The actual program reads the executable file and loads the additional data as needed. So 100 megabyte executables does not load 100 megs of data into memory.

Share this post


Link to post
Share on other sites
The biggest .exe I''ve ever seen was about 22mb. It was a Mech game. And there were lots of files outside the .exe too O.O.

Share this post


Link to post
Share on other sites

  • Advertisement