Is there a way to add a folder in the support directory to the Max dll search path?

Shakeeb Alireza's icon

One of the long-standing objectives in my py-js (python3 externals for Max) project is to have a way for Windows user of the library to build relocatable python3 externals which can be used in standalone and packages. Various methods for doing this are already provided for macOS users, but presently, Windows users are only able to link python3 externals to local python3 installations.

Recently, I've been chipping away at this problem and have just developed a way to link a python3 dll to its dependent dlls in the support folder of a package which is along the lines of the dllexample example in the max-sdk.

Everything works as it should except for one thing: I had to basically treat the support folder as the direct container for the dlls. So instead of <package_name>/support/python/python313.dll+related files it only works if organized as <package_name>/support/python313.dll+related files .

Is there any way to specify a subfolder of the support folder to be searchable for dlls without disrupting the dll search order of the Max application?

I tried using AddDllDirectory without much success, and as I am far from being knowledgeable about windows, I would appreciate any help that would bring me closer to a solution.

S