python - PyInstaller - DLL Loading behavior -


i'm using pyinstaller create windows standalone application (-onefile option) users (ie. no installation, user double clicks application , runs). works, dlls getting found , whatnot. however, i've noticed application attempts load dlls folder application started from. security risk, since lot of users running application downloads folder standalone downloadable.

the dlls being searched in these risky locations system dlls such bcrypt.dll, secur32.dll, iertutil.dll, sspicli.dll, etc. these dlls found in system32 folder, it's searches directory application launched first. python-specific dlls , wxpython related dlls being found correctly on first try in special _meixxxx folder pyinstaller creates. other system dlls such kernel32.dll , user32.dll located right away in c:\windows\system32

i've read on dll search order on windows, , suspect it's because dlls dependent dlls , therefore searched first in directory application started from. based on how pyinstaller works -onefile option, seem _meixxxx folder in appdata should directory application starts from. seems these dependent dlls, directory bootloader started directory application starts , becomes first search path dlls.

i've tried these various solutions:

1) setdefaultdlldirectories - calling load_library_search_system32 doesn't seem dependent dlls loaded dlls loaded application.

2) application manifests side-by-side assemblies - worked extremely ugly , increases application size 10 mb when dlls packed in. it's not portable , need application able run on versions of windows 7 , higher. prefer not have this.

3) using app paths registry key - same 1), didn't seem dependent dlls.

my question whether or not there's way control dll loading behavior of pyinstaller-created applications? , has done without resorting manifests , bundling bunch of system dlls application?


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -