|
"""
|
|
PyInstaller runtime hook for pymssql
|
|
确保pymssql的FreeTDS DLL能被正确加载
|
|
"""
|
|
import os
|
|
import sys
|
|
|
|
# 将当前目录添加到DLL搜索路径
|
|
if hasattr(os, 'add_dll_directory'):
|
|
# Windows 10+
|
|
if getattr(sys, 'frozen', False):
|
|
# 运行在打包后的环境
|
|
base_path = sys._MEIPASS
|
|
os.add_dll_directory(base_path)
|