Changeset 332

Show
Ignore:
Timestamp:
Tue Nov 20 07:32:54 2007
Author:
giovannibajo
Message:

Let the windows loader try to open myprog.pkg before myprog.exe.

From: Anton Gyllenberg <anton@iki.fi>

Having the archive in an external file makes it possible to work around some
problems stemming from the process opening its own executable and keeping it
open.

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/source/windows/winmain.c

    r330 r332  
    97 97         char here[_MAX_PATH + 1];  
    98 98         char thisfile[_MAX_PATH + 1];  
      99         char pkgfile[_MAX_PATH + 1];  
    99 100         int rc = 0;  
    100 101         char *workpath = NULL;  
     
    126 127         len = p - here;  
    127 128  
      129         strcpy(pkgfile, thisfile);  
      130         strcpy(pkgfile+strlen(pkgfile)-3, "pkg");  
      131  
    128 132         workpath = getenv( "_MEIPASS2" );  
    129           rc = init(here, &thisfile[len], workpath);  
    130           if (rc)  
      133         rc = init(here, &pkgfile[len], workpath);  
      134         if (rc) {  
      135                 rc = init(here, &thisfile[len], workpath);  
      136         } else {  
      137                 VS("Found separate PKG: %s\n", pkgfile);  
      138         }  
      139         if (rc) {  
    131 140                 return rc;  
      141         }  
    132 142         if (workpath) {  
    133 143                 // we're the "child" process