Py2exe - How to reduce dll dependency?

My program depends on USER32.dll, SHELL32.dll, ADVAPI32.dll WS2_32.dll, GDI32.dll and KERNEL32.dll. All of them are in the system32 folder. Is there any way to include them in my program so that it works on all Windows computers? Or are these DLLs that can already be found on all Windows installations?

+3
source share
2 answers

When py2exe encounters a DLL file that the application requires, it decides whether the DLL file is included in the distribution directory using various criteria. Typically, it does not include DLLs if it considers them to belong to the "system" and not to the "application."

, py2exe DLL, . ,

# setup.py
from distutils.core import setup
import py2exe,sys,os

origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
        if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
                return 0
        return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

py2exe. , , .

+3

py2exe, cx_Freeze - , . , bin-includes , .exe, .

+1

All Articles