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

Contents of /trunk/nsis/detect.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2607 - (show annotations) (download)
Tue Apr 24 23:16:19 2012 UTC (5 years, 6 months ago) by jpye
File size: 2974 byte(s)
Working installer for 0.9.8 32-bit.
1 ;---------------------------------------------------------------------
2 ; ROUTINES TO DETECT PYTHON, PYGTK, PYGOBJECT, PYCAIRO and TCL/TK.
3
4 ;---------------------------------------------------------------------
5 ; Look for Python in HKLM and HKCU
6
7 Function DetectPython
8 !ifdef INST64
9 SetRegView 64
10 !endif
11 ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
12 ${If} $R6 == ''
13 ;MessageBox MB_OK "No Python in HKLM"
14 ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
15 ${If} $R6 == ''
16 ;MessageBox MB_OK "No Python in HKCU"
17 StrCpy $HAVE_PYTHON "NOK"
18 StrCpy $PYPATH "No registry key found"
19 Return
20 ${EndIf}
21 ${EndIf}
22
23 ${If} ${FileExists} "$R6\python.exe"
24 StrCpy $PYPATH "$R6"
25 StrCpy $HAVE_PYTHON "OK"
26 ${Else}
27 ;MessageBox MB_OK "No python.exe in $R6"
28 StrCpy $PYPATH "No python.exe found"
29 StrCpy $HAVE_PYTHON "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 !ifdef INST64
38 SetRegView 64
39 !endif
40 ; Search in the registry in the first instance
41 ReadRegStr $R6 HKLM "SOFTWARE\GTK+-${GTK_VER}" "InstallDir"
42 ${If} $R6 == ''
43 ; If not found in the registory, look in ${GTKSEARCHPATH}
44 ;MessageBox MB_OK "No GTK found in HKLM"
45 ${If} ${FileExists} "${GTKSEARCHPATH}\manifest\${GTK_MFT}"
46 ;MessageBox MB_OK "GTK OK in ${GTKSEARCHPATH}\manifest"
47 StrCpy $GTKPATH "${GTKSEARCHPATH}\bin"
48 StrCpy $HAVE_GTK "OK"
49 Return
50 ${EndIf}
51 ${Else}
52 ; Found in the registry. Check for the GTK DLL, but don't insist
53 ; on exactly matching manifest ID in this case.
54 ${If} ${FileExists} "$R6\bin\libgtk-win32-2.0-0.dll"
55 ;MessageBox MB_OK "GTK OK in $R6 (from registry)"
56 StrCpy $GTKPATH "$R6\bin"
57 StrCpy $HAVE_GTK "OK"
58 Return
59 ${EndIf}
60 ${EndIf}
61 ;MessageBox MB_OK "Failed to locate GTK (searched registry\nand also ${GTKSEARCHPATH})"
62 StrCpy $GTKPATH "GTK not found in registry or ${GTKSEARCHPATH}"
63 StrCpy $HAVE_GTK "NOK"
64 FunctionEnd
65
66 ;--------------------------------------------------------------------
67 ; Are necessary PyGTK bits and pieces available?
68
69 Function DetectPyGTK
70 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gtk\__init__.py"
71 StrCpy $HAVE_PYGTK "OK"
72 ${Else}
73 ;MessageBox MB_OK "No PyGTK in $PYPATH"
74 StrCpy $HAVE_PYGTK "NOK"
75 ${EndIf}
76 FunctionEnd
77
78 Function DetectPyCairo
79 ${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py"
80 StrCpy $HAVE_PYCAIRO "OK"
81 ${Else}
82 ;MessageBox MB_OK "No PyCairo in $PYPATH"
83 StrCpy $HAVE_PYCAIRO "NOK"
84 ${EndIf}
85 FunctionEnd
86
87 Function DetectPyGObject
88 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gobject\__init__.py"
89 StrCpy $HAVE_PYGOBJECT "OK"
90 ${Else}
91 ;MessageBox MB_OK "No PyGObject in $PYPATH"
92 StrCpy $HAVE_PYGOBJECT "NOK"
93 ${EndIf}
94 FunctionEnd

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