Reputation: 5264
The setuptools installer for Windows 7 x86 is named an exe file, but can be opened as a zip file. When I peek into it, there are two top level folders: PURELIB and SCRIPTS. What are these, and how is it that when I double click on this exe, Windows runs it for me, although it's a zip file? That is, how does Windows know what to run inside this zip/exe? Thanks.
Upvotes: 1
Views: 276
Reputation: 42435
What are these, and how is it that when I double click on this exe, Windows runs it for me, although it's a zip file?
From http://zziplib.sourceforge.net/sfx-make.html
The basic scheme goes like this: the final file will have an EXE starting at offset null, followed by the data entries of a ZIP archive. The last part of the ZIP archive is the ZIP central-directory which ends at the end of the file.
The magic is possible because exe format allows any data to be appended to the executable and zip format allows any data to be prepended to the archive.
Upvotes: 1
Reputation: 89027
It's a self-extracting archive.
A self-extracting archive is a computer application which contains a file archive, as well as programming to extract this information. Such file archives do not require a second executable file or program to extract from the archive, as archive files usually require. The files in an archive can thus be extracted by anyone, whether they possess the appropriate decompression program or not, as long as the program can run on their computer platform.
It is an executable, it's just that your extraction software knows to look for self-extracting archives, and treats it as a normal archive.
Upvotes: 2