On 11/6/2007 3:58 PM, Anton wrote:

> If I wished to experiment with having pyinstaller not opening its
> executable at all, I guess I would then have to hack the loader to try
> to open another file for accessing the archive?

Yes. When I was thinking at "closing the file before running the 
program" I was actually hinting at the bootloader.

Now, now.

PyInstaller does support a mode in which the .pkg file is not attached 
to the bootloader. It is called "non-ELF exe"; as the name hints, it's 
currently used only under Linux (see also the Manual, in the EXE section).

The main.c for the bootloader under Linux does pratically this:

     if (init(homepath, &thisfile[strlen(homepath)], workpath)) {
         /* no pkg there, so try the nonelf configuration */
         strcpy(archivefile, thisfile);
         strcat(archivefile, ".pkg");
         if (init(homepath, &archivefile[strlen(homepath)], workpath)) {

where &thisfile[] is pratically the name of the executable. So Linux' 
bootloader is ready for having an external .pkg: it silently fallbacks 
to it if it can't find the .pkg attached to the executable.

The Windows bootloader's winmain.c does not support it though:

        workpath = getenv( "_MEIPASS2" );
        rc = init(here, &thisfile[len], workpath);
        if (rc)
                return rc;

There are also some other problems here and there to fix to do a clean 
patch. I see that class NonELFEXE in Build.py is probably a little 
bitrot. From a quick glance, it has duplicated code to compose the 
bootloader file name, but should instead share that code with ELFEXE.

After that, one could also add an option to Makespec.py to use 
NonELFEXE, so that NonELFEXE basically becomes an user-level feature, 
instead of only a configuration option. And maybe rename NonELFEXE to 
soemthing more clear ;)

Of course, for your own application, it will be enough to modify 
winmain.c so to hardcode "program.pkg" into the init() call. This should 
remove the executable lock problem and let MSI do its job.
-- 
Giovanni Bajo


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to