Search code examples
pythonwindowswinapipy2exe

How can I determine the windows libraries required for a specific win32 api call?


I'm using several windows api modules like win32wnet, win32file, win32con, and others but only a few methods from these.

I'm packaging my app with py2exe (bundle_files==3) and it is hit-and-miss if they run on other windows platforms.

I'd like to: 1) package all the required and only the appropriate libraries. I don't want to rely on what is already supposed to be installed on the OS if at all possible.

Or: 2) I would like to write manifests to connect my app to the approprate versions of existing dlls. (if packaging the dll is not legal)

errors provided by python at runtime are vague:

ImportError: DLL load failed: The specified procedure could not be found.

the docs (ex: help(win32wnet)) don't seem to be of much use.

How can I identify which native windows libraries are required by my app?


Solution

  • I think you might find that shipping core windows dlls as part of your app is not allowed by Microsoft.

    You should write your software to work with whats available on the machine unless its something like comctrls32 which has several versions.