1 |
;--------------------------------------------------------------------- |
2 |
; ROUTINES TO DETECT PYTHON, PYGTK, PYGOBJECT, PYCAIRO and TCL/TK. |
3 |
|
4 |
;--------------------------------------------------------------------- |
5 |
; Look for Python in HKLM. No attempt to detect it in HKCU at this stage. |
6 |
|
7 |
Function DetectPython |
8 |
ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" "" |
9 |
${If} $R6 == '' |
10 |
ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" "" |
11 |
${If} $R6 == '' |
12 |
Push "No registry key found" |
13 |
Push "NOK" |
14 |
Return |
15 |
${EndIf} |
16 |
${EndIf} |
17 |
|
18 |
${If} ${FileExists} "$R6\python.exe" |
19 |
Push "$R6" |
20 |
Push "OK" |
21 |
${Else} |
22 |
Push "No python.exe found" |
23 |
Push "NOK" |
24 |
${EndIf} |
25 |
FunctionEnd |
26 |
|
27 |
;-------------------------------------------------------------------- |
28 |
; Prefer the current user's installation of GTK, fall back to the local machine |
29 |
|
30 |
Function DetectGTK |
31 |
ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath" |
32 |
${If} $R6 == '' |
33 |
ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath" |
34 |
${If} $R6 == '' |
35 |
Push "No GTK registry key found" |
36 |
Push "NOK" |
37 |
Return |
38 |
${EndIf} |
39 |
${EndIf} |
40 |
|
41 |
${If} ${FileExists} "$R6\libgtk-win32-2.0-0.dll" |
42 |
Push "$R6" |
43 |
Push "OK" |
44 |
${Else} |
45 |
Push "No libgtk-win32-2.0-0.dll found in'$R6'" |
46 |
Push "NOK" |
47 |
${EndIf} |
48 |
FunctionEnd |
49 |
|
50 |
;-------------------------------------------------------------------- |
51 |
; Are necessary PyGTK bits and pieces available? |
52 |
|
53 |
Function DetectPyGTK |
54 |
${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gtk\__init__.py" |
55 |
Push "OK" |
56 |
${Else} |
57 |
Push "NOK" |
58 |
${EndIf} |
59 |
FunctionEnd |
60 |
|
61 |
Function DetectPyCairo |
62 |
${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py" |
63 |
Push "OK" |
64 |
${Else} |
65 |
Push "NOK" |
66 |
${EndIf} |
67 |
FunctionEnd |
68 |
|
69 |
Function DetectPyGObject |
70 |
${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gobject\__init__.py" |
71 |
Push "OK" |
72 |
${Else} |
73 |
Push "NOK" |
74 |
${EndIf} |
75 |
FunctionEnd |
76 |
|
77 |
;-------------------------------------------------------------------- |
78 |
; Prefer the current user's installation of GTK, fall back to the local machine |
79 |
|
80 |
Function DetectGlade |
81 |
ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath" |
82 |
${If} $R6 == '' |
83 |
ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath" |
84 |
${If} $R6 == '' |
85 |
Push "No GTK registry key found" |
86 |
Push "NOK" |
87 |
Return |
88 |
${EndIf} |
89 |
${EndIf} |
90 |
|
91 |
${If} ${FileExists} "$R6\libglade-2.0-0.dll" |
92 |
Push "$R6" |
93 |
Push "OK" |
94 |
${Else} |
95 |
Push "No libglade-2.0-0.dll found in'$R6'" |
96 |
Push "NOK" |
97 |
${EndIf} |
98 |
FunctionEnd |
99 |
|
100 |
;-------------------------------------------------------------------- |
101 |
|
102 |
Function DetectTcl |
103 |
ReadRegStr $R6 HKCU "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion" |
104 |
${If} $R6 == '' |
105 |
ReadRegStr $R6 HKLM "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion" |
106 |
${If} $R6 == '' |
107 |
Push "No 'CurrentVersion' registry key" |
108 |
Push "NOK" |
109 |
Return |
110 |
${Else} |
111 |
StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6" |
112 |
ReadRegStr $R8 HKLM $R7 "" |
113 |
${EndIf} |
114 |
${Else} |
115 |
StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6" |
116 |
ReadRegStr $R8 HKCU $R7 "" |
117 |
${EndIf} |
118 |
|
119 |
${If} $R8 == '' |
120 |
Push "No value for $R7" |
121 |
Push "NOK" |
122 |
${Else} |
123 |
Push "$R8\bin" |
124 |
Push "OK" |
125 |
${EndIf} |
126 |
FunctionEnd |