/[ascend]/trunk/nsis/detect.nsi
ViewVC logotype

Contents of /trunk/nsis/detect.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2566 - (show annotations) (download)
Sat Feb 4 00:42:53 2012 UTC (12 years, 5 months ago) by jpye
File size: 3359 byte(s)
Working on 64-bit installer.
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 ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
14 ${If} $R6 == ''
15 Push "No registry key found"
16 Push "NOK"
17 Return
18 ${EndIf}
19 ${EndIf}
20
21 ${If} ${FileExists} "$R6\python.exe"
22 Push "$R6"
23 Push "OK"
24 ${Else}
25 Push "No python.exe found"
26 Push "NOK"
27 ${EndIf}
28 FunctionEnd
29
30 ;--------------------------------------------------------------------
31 ; Prefer the current user's installation of GTK, fall back to the local machine
32
33 Function DetectGTK
34 ${If} $PYOK == "OK"
35 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\runtime\bin\libgtk-win32-2.0-0.dll"
36 Push "$PYPATH\Lib\site-packages\gtk-2.0\runtime\bin"
37 Push "OK"
38 ${Else}
39 Push "libgtk-win32-2.0-0.dll not found in $PYPATH\Lib\site\packages\gtk-2.0\runtime\bin"
40 Push "NOK"
41 ${EndIf}
42 ${Else}
43 Push "Python not detected (we are looking for PyGTK All-in-one package)"
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 Push "NOK"
56 ${EndIf}
57 FunctionEnd
58
59 Function DetectPyCairo
60 ${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py"
61 Push "OK"
62 ${Else}
63 Push "NOK"
64 ${EndIf}
65 FunctionEnd
66
67 Function DetectPyGObject
68 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gobject\__init__.py"
69 Push "OK"
70 ${Else}
71 Push "NOK"
72 ${EndIf}
73 FunctionEnd
74
75 ;--------------------------------------------------------------------
76 ; Prefer the current user's installation of GTK, fall back to the local machine
77
78 Function DetectGlade
79 ${If} $PYOK == "OK"
80 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\runtime\bin\libglade-2.0-0.dll"
81 Push "$PYPATH\Lib\site\packages\gtk-2.0\runtime\bin"
82 Push "OK"
83 ${Else}
84 Push "libglade-2.0-0.dll not found in $PYPATH\Lib\site\packages\gtk-2.0\runtime\bin"
85 Push "NOK"
86 ${EndIf}
87 ${Else}
88 Push "Python not detected (we are looking for PyGTK All-in-one package)"
89 Push "NOK"
90 ${EndIf}
91 FunctionEnd
92
93 ;--------------------------------------------------------------------
94
95 ;Function DetectTcl
96 ;!if INST64
97 ; SetRegView 64
98 ;!endif
99 ; ReadRegStr $R6 HKCU "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
100 ; ${If} $R6 == ''
101 ; ReadRegStr $R6 HKLM "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
102 ; ${If} $R6 == ''
103 ; Push "No 'CurrentVersion' registry key"
104 ; Push "NOK"
105 ; Return
106 ; ${Else}
107 ; StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
108 ; ReadRegStr $R8 HKLM $R7 ""
109 ; ${EndIf}
110 ; ${Else}
111 ; StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
112 ; ReadRegStr $R8 HKCU $R7 ""
113 ; ${EndIf}
114 ;
115 ; ${If} $R8 == ''
116 ; Push "No value for $R7"
117 ; Push "NOK"
118 ; ${Else}
119 ; Push "$R8\bin"
120 ; Push "OK"
121 ; ${EndIf}
122 ;FunctionEnd

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22