forked from Eomys/pyleecan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_dll.py
60 lines (57 loc) · 2.74 KB
/
add_dll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from ctypes import CDLL
from os.path import exists
from shutil import copyfile
import platform
if __name__ == "__main__":
print(platform.architecture())
copyfile(".\\dlls\\glu32.dll", "C:\\WINDOWS\\system32\\glu32.dll")
copyfile(".\\dlls\\opengl32.dll", "C:\\WINDOWS\\system32\\opengl32.dll")
print(
"gmsh dll "
+ str(
exists(
"C:\\Python\\Lib\\site-packages\\gmsh-4.7.1-Windows64-sdk\\lib\\gmsh-4.7.dll"
)
)
)
print("advapi32.dll " + str(exists("C:\\WINDOWS\\system32\\advapi32.dll")))
print("COMDLG32.dll " + str(exists("C:\\WINDOWS\\system32\\COMDLG32.dll")))
print("COMCTL32.dll " + str(exists("C:\\WINDOWS\\system32\\COMCTL32.dll")))
print("gdi32.dll " + str(exists("C:\\WINDOWS\\system32\\gdi32.dll")))
print("glu32.dll " + str(exists("C:\\WINDOWS\\system32\\glu32.dll")))
print("kernel32.dll " + str(exists("C:\\WINDOWS\\system32\\kernel32.dll")))
print("WSOCK32.dll " + str(exists("C:\\WINDOWS\\system32\\WSOCK32.dll")))
print("WS2_32.dll " + str(exists("C:\\WINDOWS\\system32\\WS2_32.dll")))
print("WINMM.dll " + str(exists("C:\\WINDOWS\\system32\\WINMM.dll")))
print("SHELL32.dll " + str(exists("C:\\WINDOWS\\system32\\SHELL32.dll")))
print("PSAPI.DLL " + str(exists("C:\\WINDOWS\\system32\\PSAPI.dll")))
print("user32.dll " + str(exists("C:\\WINDOWS\\system32\\user32.dll")))
print("opengl32.dll " + str(exists("C:\\WINDOWS\\system32\\opengl32.dll")))
print("ole32.dll " + str(exists("C:\\WINDOWS\\system32\\ole32.dll")))
print("MSVCRT.dll " + str(exists("C:\\WINDOWS\\system32\\MSVCRT.dll")))
try:
CDLL(
"C:\\Python\\Lib\\site-packages\\gmsh-4.7.1-Windows64-sdk\\lib\\gmsh-4.7.dll"
)
CDLL("C:\\WINDOWS\\system32\\advapi32.dll")
CDLL("C:\\WINDOWS\\system32\\COMCTL32.dll")
CDLL("C:\\WINDOWS\\system32\\COMCTL32.dll")
CDLL("C:\\WINDOWS\\system32\\gdi32.dll")
CDLL("C:\\WINDOWS\\system32\\glu32.dll")
CDLL("C:\\WINDOWS\\system32\\kernel32.dll")
CDLL("C:\\WINDOWS\\system32\\WSOCK32.dll")
CDLL("C:\\WINDOWS\\system32\\WS2_32.dll")
CDLL("C:\\WINDOWS\\system32\\WINMM.dll")
CDLL("C:\\WINDOWS\\system32\\SHELL32.dll")
CDLL("C:\\WINDOWS\\system32\\PSAPI.dll")
CDLL("C:\\WINDOWS\\system32\\user32.dll")
CDLL("C:\\WINDOWS\\system32\\opengl32.dll")
CDLL("C:\\WINDOWS\\system32\\ole32.dll")
CDLL("C:\\WINDOWS\\system32\\MSVCRT.dll")
except Exception as e:
print(e)
print(exists("C:\\Python\\Lib\\site-packages\\vtkmodules\\vtkRenderingOpenGL2.dll"))
try:
CDLL("C:\\Python\\Lib\\site-packages\\vtkmodules\\vtkRenderingOpenGL2.dll")
except Exception as e:
print(e)