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

Annotation of /trunk/nsis/detect.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2607 - (hide annotations) (download)
Tue Apr 24 23:16:19 2012 UTC (12 years, 7 months ago) by jpye
File size: 2974 byte(s)
Working installer for 0.9.8 32-bit.
1 jpye 1570 ;---------------------------------------------------------------------
2     ; ROUTINES TO DETECT PYTHON, PYGTK, PYGOBJECT, PYCAIRO and TCL/TK.
3    
4     ;---------------------------------------------------------------------
5 jpye 2581 ; Look for Python in HKLM and HKCU
6 jpye 1570
7     Function DetectPython
8 jpye 2605 !ifdef INST64
9 jpye 2566 SetRegView 64
10     !endif
11 jpye 2581 ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
12 jpye 1570 ${If} $R6 == ''
13 jpye 2581 ;MessageBox MB_OK "No Python in HKLM"
14     ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
15 jpye 1570 ${If} $R6 == ''
16 jpye 2581 ;MessageBox MB_OK "No Python in HKCU"
17 jpye 2605 StrCpy $HAVE_PYTHON "NOK"
18     StrCpy $PYPATH "No registry key found"
19 jpye 1570 Return
20     ${EndIf}
21     ${EndIf}
22    
23     ${If} ${FileExists} "$R6\python.exe"
24 jpye 2605 StrCpy $PYPATH "$R6"
25     StrCpy $HAVE_PYTHON "OK"
26 jpye 1570 ${Else}
27 jpye 2567 ;MessageBox MB_OK "No python.exe in $R6"
28 jpye 2605 StrCpy $PYPATH "No python.exe found"
29     StrCpy $HAVE_PYTHON "NOK"
30 jpye 1570 ${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 jpye 2605 !ifdef INST64
38 jpye 2607 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 jpye 2605 ${If} ${FileExists} "${GTKSEARCHPATH}\manifest\${GTK_MFT}"
46 jpye 2607 ;MessageBox MB_OK "GTK OK in ${GTKSEARCHPATH}\manifest"
47 jpye 2605 StrCpy $GTKPATH "${GTKSEARCHPATH}\bin"
48     StrCpy $HAVE_GTK "OK"
49 jpye 2581 Return
50     ${EndIf}
51 jpye 2607 ${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 jpye 2581 ${EndIf}
61 jpye 2607 ;MessageBox MB_OK "Failed to locate GTK (searched registry\nand also ${GTKSEARCHPATH})"
62     StrCpy $GTKPATH "GTK not found in registry or ${GTKSEARCHPATH}"
63 jpye 2605 StrCpy $HAVE_GTK "NOK"
64 jpye 1570 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 jpye 2605 StrCpy $HAVE_PYGTK "OK"
72 jpye 1570 ${Else}
73 jpye 2607 ;MessageBox MB_OK "No PyGTK in $PYPATH"
74 jpye 2605 StrCpy $HAVE_PYGTK "NOK"
75 jpye 1570 ${EndIf}
76     FunctionEnd
77    
78     Function DetectPyCairo
79     ${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py"
80 jpye 2605 StrCpy $HAVE_PYCAIRO "OK"
81 jpye 1570 ${Else}
82 jpye 2607 ;MessageBox MB_OK "No PyCairo in $PYPATH"
83 jpye 2605 StrCpy $HAVE_PYCAIRO "NOK"
84 jpye 1570 ${EndIf}
85     FunctionEnd
86    
87     Function DetectPyGObject
88     ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gobject\__init__.py"
89 jpye 2605 StrCpy $HAVE_PYGOBJECT "OK"
90 jpye 1570 ${Else}
91 jpye 2607 ;MessageBox MB_OK "No PyGObject in $PYPATH"
92 jpye 2605 StrCpy $HAVE_PYGOBJECT "NOK"
93 jpye 1570 ${EndIf}
94     FunctionEnd

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