Discussion:
[Py2exe-users] Behavior of a bundled executable
Jamal Mazrui
2016-03-08 17:07:01 UTC
Permalink
Using py2exe configuration options, if an executable is built to be, as much as possible, a single .exe file, does it create needed components on disk as temporary files when initially loading? Based on the documentation of alternatives to py2exe, cx_Freeze and PyInstaller, they create such temporary files. I am unclear from the documentation of py2exe whether it does so as well.

I was hoping that components bundled into a py2exe executable are accessed in memory at runtime rather than saved to disk as temporary files, thereby acting more like an executable compiled with other programming languages, even though being considerably larger in size. If that is not the case, however, I wish to be informed accurately. Can anyone shed light on this?

Jamal
Massa, Harald Armin
2016-03-08 18:10:33 UTC
Permalink
Jamal,
Post by Jamal Mazrui
Using py2exe configuration options, if an executable is built to be, as
much as possible, a single .exe file, does it create needed components on
disk as temporary files when initially loading? Based on the documentation
of alternatives to py2exe, cx_Freeze and PyInstaller, they create such
temporary files. I am unclear from the documentation of py2exe whether it
does so as well.
py2exe loads the files directly from the single file (or the additional
zip-file, when not opting for the single file version).

That includes binary files (.pyd, .dll) There is some "load dll from memory
code" included with py2exe. No temporary files are spilled to disk.

I am distributing these kind of single-file-applications to customers since
~14 years. It is not really single file, as some Micosoft C Runtime files
need to be distributed additionally.


HOWEVER: when you use Python modules that dynamically create files to
import, that may spill stuff out to disk - dynamically created bindings for
com-Modules may be that way.

Additionally, that "grab all necessary dlls and bundle them in an .exe" can
be troublesome, as sometimes to many .dlls are identified as necessary.
That takes a quite some research each time Microsoft decides to put out
different dependencies in some system areas; and then new lines in the
exclude-directive. I felt that pain with every major windows update.

Harald
--
GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607

Amtsgericht Stuttgart, HRB 734971
Loading...