Thanks again for helping! Following your advice, I got a test version
working by hacking winmain.c to first try to read progname.pkg and
manually copying outN.pkg to progname.pkg and the correct bootloader
run_7rc.exe to progname.exe. As anticipated, this solved the "moving
the exe while running" problem. I will test to see if it affects the
antivirus problem. It just might, as the exe is so much smaller now so
it might be easier for the broken AV program to scan.
> The Windows bootloader's winmain.c does not support it though:
>
> workpath = getenv( "_MEIPASS2" );
> rc = init(here, &thisfile[len], workpath);
> if (rc)
> return rc;
The quick patch I used for testing:
--- source/windows/winmain.c (revision 322)
+++ source/windows/winmain.c (working copy)
@@ -96,6 +96,7 @@
{
char here[_MAX_PATH + 1];
char thisfile[_MAX_PATH + 1];
+ char pkgfile[_MAX_PATH + 1];
int rc = 0;
char *workpath = NULL;
char *p;
@@ -125,10 +126,19 @@
*++p = '\0';
len = p - here;
+ strcpy(pkgfile, thisfile);
+ strcpy(pkgfile+strlen(pkgfile)-3, "pkg");
+
workpath = getenv( "_MEIPASS2" );
- rc = init(here, &thisfile[len], workpath);
- if (rc)
+ rc = init(here, &pkgfile[len], workpath);
+ if (rc) {
+ rc = init(here, &thisfile[len], workpath);
+ } else {
+ VS("Found separate PKG.\n");
+ }
+ if (rc) {
return rc;
+ }
if (workpath) {
// we're the "child" process
rc = doIt(argc, argv);
I opted to try progname.pkg first, and only if that fails test
progname.exe. This because launch.c:init() does not close the archive
on failure or return a file pointer, and I did not want to add error
handling for my quick test.
> 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 ;)
If this was done, would you see any reason why it would be preferable
to append the PKG to the exe in a one-directory setup? one-file is
clear. I mean, should this external PKG (non elf exe) be the default
for one-dir setups if this was implemented?
I did not modify Build.py for my test. I just used a standard one
dir .spec, and then used the outN.pkg and the plain bootloader without
anything appended. If testing shows that all this solves the problems
I have seen on windows, would you be interested in neater patches to
winmain.c and Build.py along the lines you suggested.
Thanks again!
Anton
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---