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.
-
Thanks. How does bdist_wininst installer get called when the exe/zip is double clicked? Wait! You maintain the pre-built exe's that are so useful, thank you so much for those. – Sabuncu May 02 '12 at 19:18
-
1Related: [Can I install Python windows packages into virtualenvs?](http://stackoverflow.com/q/3271590/95735) – Piotr Dobrogost May 02 '12 at 21:50
2 Answers
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.

- 86,389
- 17
- 178
- 183
-
I am aware of the self-extraction concept, was looking for further details re: how these two folders interact with the installer. – Sabuncu May 02 '12 at 17:42
-
1@Sabuncu 'That's entirely up to the program that generated the self-extracting archive. There is no standard for it. – Gareth Latty May 02 '12 at 17:45
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.

- 41,292
- 40
- 236
- 366