def plat_finalize(self, modules, py_files, extensions, dlls): py2exe_cmd.plat_finalize(self, modules, py_files, extensions, dlls) # Filter out system DLLs based on VersionInfo resource def get_version_string(filename, key): try: translations = win32api.GetFileVersionInfo(filename, "\\VarFileInfo\\Translation") except Exception: return u"" else: # use the first available language language, codepage = translations[0] return win32api.GetFileVersionInfo( filename, "\\StringFileInfo\\%04x%04x\\%s" % (language, codepage, key)) for dll in dlls.copy(): product_name = get_version_string(dll, "ProductName") if u"Microsoft" in product_name: dlls.remove(dll)
def plat_finalize(self, modules, py_files, extensions, dlls): BuildExe.plat_finalize(self, modules, py_files, extensions, dlls) if "Tix" in modules: # Tix adjustments tcl_version, tk_version, tix_version, tcl_dir = TixInfo() tixdll = "tix%s%s.dll" % (tix_version.replace( ".", ""), tcl_version.replace(".", "")) tcldll = "tcl%s.dll" % tcl_version.replace(".", "") tkdll = "tk%s.dll" % tk_version.replace(".", "") dlls.add(os.path.join(sys.prefix, "DLLs", tixdll)) self.dlls_in_exedir.extend([tcldll, tkdll, tixdll]) tcl_src_dir = os.path.split(tcl_dir)[0] tcl_dst_dir = os.path.join(self.lib_dir, "tcl") self.announce("Copying TIX files from %s..." % tcl_src_dir) self.copy_tree(os.path.join(tcl_src_dir, "tix%s" % tix_version), os.path.join(tcl_dst_dir, "tix%s" % tix_version))
def plat_finalize(self, modules, py_files, extensions, dlls): BuildExe.plat_finalize(self, modules, py_files, extensions, dlls) if "Tix" in modules: # Tix adjustments tcl_version,tk_version,tix_version,tcl_dir = TixInfo() tixdll="tix%s%s.dll"% (tix_version.replace(".",""), tcl_version.replace(".","")) tcldll="tcl%s.dll"%tcl_version.replace(".","") tkdll="tk%s.dll"%tk_version.replace(".","") dlls.add(os.path.join(sys.prefix,"DLLs",tixdll)) self.dlls_in_exedir.extend( [tcldll,tkdll,tixdll ] ) tcl_src_dir = os.path.split(tcl_dir)[0] tcl_dst_dir = os.path.join(self.lib_dir, "tcl") self.announce("Copying TIX files from %s..." % tcl_src_dir) self.copy_tree(os.path.join(tcl_src_dir, "tix%s" % tix_version), os.path.join(tcl_dst_dir, "tix%s" % tix_version))