root/Softs/py2exe-0.6.6_one_exe.diff
| リビジョン 41, 4.5 kB (コミッタ: mtamaki, 3 年 前) |
|---|
-
py2exe/build_exe.py
diff -ur py2exe-0.6.6_src/py2exe/build_exe.py py2exe-0.6.6_one_exe/py2exe/build_exe.py
old new 464 464 if base.lower() in self.dlls_in_exedir: 465 465 # pythonXY.dll must be bundled as resource. 466 466 # w9xpopen.exe must be copied to self.exe_dir. 467 if base.lower() == python_dll.lower() and self.bundle_files < 2:467 if (base.lower() == python_dll.lower() or base.lower() == "msvcr71.dll") and self.bundle_files < 2: 468 468 dst = os.path.join(self.bundle_dir, base) 469 469 else: 470 470 dst = os.path.join(self.exe_dir, base) … … 789 789 790 790 # add the pythondll as resource, and delete in self.exe_dir 791 791 if self.bundle_files < 2 and self.distribution.zipfile is None: 792 # bundle pythonxy.dll 793 dll_path = os.path.join(self.bundle_dir, python_dll) 794 bytes = open(dll_path, "rb").read() 795 # image, bytes, lpName, lpType 792 def add_resource_dll( name ): 793 # bundle pythonxy.dll 794 dll_path = os.path.join(self.bundle_dir, name) 795 bytes = open(dll_path, "rb").read() 796 # image, bytes, lpName, lpType 796 797 797 print "Adding %s as resource to %s" % (python_dll, exe_path)798 add_resource(unicode(exe_path), bytes,798 print "Adding %s as resource to %s" % (name, exe_path) 799 add_resource(unicode(exe_path), bytes, 799 800 # for some reason, the 3. argument MUST BE UPPER CASE, 800 801 # otherwise the resource will not be found. 801 unicode(python_dll).upper(), 1, False) 802 unicode(name).upper(), 1, False) 803 add_resource_dll( "msvcr71.dll" ) 804 add_resource_dll( python_dll ) 802 805 803 806 if self.compressed and self.bundle_files < 3 and self.distribution.zipfile is None: 804 807 zlib_file = imp.find_module("zlib")[0] -
py2exe-0.6.
diff -ur py2exe-0.6.6_src/setup.py py2exe-0.6.6_one_exe/setup.py
old new 52 52 del kw['target_desc'] 53 53 else: 54 54 self.target_desc = "executable" 55 kw['extra_compile_args'] = ["/MT"] 55 56 Extension.__init__(self, *args, **kw) 56 57 57 58 … … 345 346 "source/_memimporter_module.c"], 346 347 depends=depends + ["source/_memimporter.c"], 347 348 define_macros=macros, 349 extra_compile_args=["/MT"] 348 350 ) 349 351 350 352 run = Interpreter("py2exe.run", … … 446 448 ext_modules = [_memimporter, 447 449 Extension("py2exe.py2exe_util", 448 450 sources=["source/py2exe_util.c"], 449 libraries=["imagehlp"]), 451 libraries=["imagehlp"], 452 extra_compile_args=["/MT"]), 450 453 ], 451 454 py_modules = ["zipextimporter"], 452 455 scripts = ["py2exe_postinstall.py"], -
source/start.c
diff -ur py2exe-0.6.6_src/source/start.c py2exe-0.6.6_one_exe/source/start.c
old new 160 160 return data; 161 161 } 162 162 163 void _TryLoadCRTDLLFromResource(HMODULE hmod, char* dllName) 164 { 165 HRSRC hrsrc = FindResource(hmod, MAKEINTRESOURCE(1), dllName); 166 if (hrsrc) { 167 int i; 168 HMODULE hmod = NULL; 169 struct IMPORT *p = imports; 170 HGLOBAL hgbl = LoadResource(hmod, hrsrc); 171 char *bytes = LockResource(hgbl); 172 if (!bytes) 173 return; 174 hmod = MemoryLoadLibrary(dllName, bytes); 175 if (hmod) { 176 for (i = 0; p->name; ++i, ++p) { 177 p->proc = (void (*)())MemoryGetProcAddress(hmod, p->name); 178 if (p->proc == NULL) { 179 break; 180 } 181 } 182 } 183 } 184 } 185 163 186 BOOL _LoadPythonDLL(HMODULE hmod) 164 187 { 165 188 HRSRC hrsrc; … … 169 192 if (!dirname[0]) 170 193 calc_dirname(hmod); 171 194 195 _TryLoadCRTDLLFromResource(hmod, "MSVCR71.DLL"); 196 172 197 // Try to locate pythonxy.dll as resource in the exe 173 198 hrsrc = FindResource(hmod, MAKEINTRESOURCE(1), PYTHONDLL); 174 199 if (hrsrc) {
Note: リポジトリブラウザについてのヘルプは TracBrowser
を参照してください。