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 |
!if ${INST64} |
9 |
SetRegView 64 |
10 |
!endif |
11 |
ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" "" |
12 |
${If} $R6 == '' |
13 |
;MessageBox MB_OK "No Python in HKCU" |
14 |
ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" "" |
15 |
${If} $R6 == '' |
16 |
;MessageBox MB_OK "No Python in HKLM" |
17 |
Push "No registry key found" |
18 |
Push "NOK" |
19 |
Return |
20 |
${EndIf} |
21 |
${EndIf} |
22 |
|
23 |
${If} ${FileExists} "$R6\python.exe" |
24 |
Push "$R6" |
25 |
Push "OK" |
26 |
${Else} |
27 |
;MessageBox MB_OK "No python.exe in $R6" |
28 |
Push "No python.exe found" |
29 |
Push "NOK" |
30 |
${EndIf} |
31 |
FunctionEnd |
32 |
|
33 |
;-------------------------------------------------------------------- |
34 |
; Prefer the current user's installation of GTK, fall back to the local machine |
35 |
|
36 |
Function DetectGTK |
37 |
${If} ${FileExists} "${GTKSEARCHPATH}\manifest\gtk+-bundle_2.22.1-20101229_win64.mft" |
38 |
MessageBox MB_OK "GTK OK in ${GTKSEARCHPATH}\manifest" |
39 |
Push "${GTKSEARCHPATH}\bin" |
40 |
Push "OK" |
41 |
${Else} |
42 |
MessageBox MB_OK "gtk+-bundle_2.22.1-20101229_win64.mft not found in ${GTKSEARCHPATH}\manifest" |
43 |
Push "gtk+-bundle_2.22.1-20101229_win64.mft not found in ${GTKSEARCHPATH}\manifest" |
44 |
Push "NOK" |
45 |
${EndIf} |
46 |
FunctionEnd |
47 |
|
48 |
;-------------------------------------------------------------------- |
49 |
; Are necessary PyGTK bits and pieces available? |
50 |
|
51 |
Function DetectPyGTK |
52 |
${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gtk\__init__.py" |
53 |
Push "OK" |
54 |
${Else} |
55 |
MessageBox MB_OK "No PyGTK in $PYPATH" |
56 |
Push "NOK" |
57 |
${EndIf} |
58 |
FunctionEnd |
59 |
|
60 |
Function DetectPyCairo |
61 |
${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py" |
62 |
Push "OK" |
63 |
${Else} |
64 |
MessageBox MB_OK "No PyCairo in $PYPATH" |
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 |
MessageBox MB_OK "No PyGObject in $PYPATH" |
74 |
Push "NOK" |
75 |
${EndIf} |
76 |
FunctionEnd |
77 |
|
78 |
;-------------------------------------------------------------------- |
79 |
; Prefer the current user's installation of GTK, fall back to the local machine |
80 |
|
81 |
; don't need glade any more, we converted to gtkbuilder. |
82 |
;Function DetectGlade |
83 |
; ${If} $PYOK == "OK" |
84 |
; ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\runtime\bin\libglade-2.0-0.dll" |
85 |
; Push "$PYPATH\Lib\site\packages\gtk-2.0\runtime\bin" |
86 |
; Push "OK" |
87 |
; ${Else} |
88 |
; Push "libglade-2.0-0.dll not found in $PYPATH\Lib\site\packages\gtk-2.0\runtime\bin" |
89 |
; Push "NOK" |
90 |
; ${EndIf} |
91 |
; ${Else} |
92 |
; Push "Python not detected (we are looking for PyGTK All-in-one package)" |
93 |
; Push "NOK" |
94 |
; ${EndIf} |
95 |
;FunctionEnd |
96 |
|
97 |
;-------------------------------------------------------------------- |
98 |
|
99 |
;Function DetectTcl |
100 |
;!if ${INST64} |
101 |
; SetRegView 64 |
102 |
;!endif |
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 |