/[ascend]/trunk/pygtk/create.nsi
ViewVC logotype

Diff of /trunk/pygtk/create.nsi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 858 by johnpye, Tue Sep 19 13:56:35 2006 UTC revision 859 by johnpye, Tue Sep 26 00:55:37 2006 UTC
# Line 50  Var /GLOBAL PYOK Line 50  Var /GLOBAL PYOK
50  Var /GLOBAL PYPATH  Var /GLOBAL PYPATH
51  Var /GLOBAL GTKOK  Var /GLOBAL GTKOK
52  Var /GLOBAL GTKPATH  Var /GLOBAL GTKPATH
53    Var /GLOBAL GLADEOK
54    Var /GLOBAL GLADEPATH
55  Var /GLOBAL PYINSTALLED  Var /GLOBAL PYINSTALLED
56  Var /GLOBAL TCLOK  Var /GLOBAL TCLOK
57  Var /GLOBAL TCLPATH  Var /GLOBAL TCLPATH
# Line 66  Function .onInit Line 68  Function .onInit
68      Call DetectGTK      Call DetectGTK
69      Pop $GTKOK      Pop $GTKOK
70      Pop $GTKPATH      Pop $GTKPATH
71    
72        Call DetectGlade
73        Pop $GLADEOK
74        Pop $GLADEPATH  
75            
76      Call DetectTcl      Call DetectTcl
77      Pop $TCLOK      Pop $TCLOK
# Line 113  SectionEnd Line 119  SectionEnd
119  ;--------------------------------  ;--------------------------------
120    
121  Section "PyGTK GUI"  Section "PyGTK GUI"
122        ${If} $PYOK == 'OK'
123      StrCmp $PYOK "OK" pythonfound          ${If} $GTKOK == 'OK'
124                ${If} $GLADEOK == 'OK'
125      MessageBox MB_OK "PyGTK GUI can not be installed, because Python was not found on this system. If you do want to use the PyGTK GUI, please check the installation instructions ($PYPATH)"                  ;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH"
126      Goto pydone  
127                    DetailPrint "--- PYTHON INTERFACE ---"
128  pythonfound:  
129                    ; Set output path to the installation directory.
130      StrCmp $GTKOK "OK" gtkfound                  SetOutPath $INSTDIR
131      MessageBox MB_OK "PyGTK GUI can not be installed, because GTK+ 2.0 was not found on this system. If you do want to use the PyGTK GUI, please check the installation instructions ($GTKPATH)"  
132      Goto pydone                  ; Python interface
133                    File "_ascpy.dll"
134  gtkfound:                  File "*.py"
135                    SetOutPath $INSTDIR\glade
136  ;   MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH"                  File "glade\*.glade"
137                    File "glade\*.png"
138      DetailPrint "--- PYTHON INTERFACE ---"  
139                        ; Create 'ascend.bat' launcher for PyGTK interface
140      ; Set output path to the installation directory.                  ClearErrors
141      SetOutPath $INSTDIR                  FileOpen $0 $INSTDIR\ascend.bat w
142                    IfErrors pydone
143      ; Python interface                  FileWrite $0 "@echo off"
144      File "_ascpy.dll"                  FileWriteByte $0 "13"
145      File "*.py"                  FileWriteByte $0 "10"
146      SetOutPath $INSTDIR\glade                  FileWrite $0 "set PATH=$PYPATH;$GTKPATH"
147      File "glade\*.glade"                  FileWriteByte $0 "13"
148      File "glade\*.png"                  FileWriteByte $0 "10"
149                    FileWrite $0 "cd "
150      ; Create 'ascend.bat' launcher for PyGTK interface                  FileWrite $0 $INSTDIR
151      ClearErrors                  FileWriteByte $0 "13"
152      FileOpen $0 $INSTDIR\ascend.bat w                  FileWriteByte $0 "10"
153      IfErrors pydone                  FileWrite $0 "$PYPATH\python gtkbrowser.py %1 %2 %3 %4 %5 %6 %7 %8"
154      FileWrite $0 "@echo off"                  FileWriteByte $0 "13"
155      FileWriteByte $0 "13"                  FileWriteByte $0 "10"
156      FileWriteByte $0 "10"  
157      FileWrite $0 "set PATH=$PYPATH;$GTKPATH"                  FileClose $0
158      FileWriteByte $0 "13"  
159      FileWriteByte $0 "10"                  StrCpy $PYINSTALLED "1"
160      FileWrite $0 "cd "                  WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1
161      FileWrite $0 $INSTDIR              ${Else}
162      FileWriteByte $0 "13"                  MessageBox MB_OK "PyGTK GUI can not be installed, because Glade was not found on this system. If you do want to use the PyGTK GUI, please check the installation instructions ($GLADEPATH)"
163      FileWriteByte $0 "10"              ${EndIf}                
164      FileWrite $0 "$PYPATH\python gtkbrowser.py %1 %2 %3 %4 %5 %6 %7 %8"          ${Else}
165      FileWriteByte $0 "13"              MessageBox MB_OK "PyGTK GUI can not be installed, because GTK+ 2.0 was not found on this system. If you do want to use the PyGTK GUI, please check the installation instructions ($GTKPATH)"
166      FileWriteByte $0 "10"          ${EndIf}
167        ${Else}
168      FileClose $0          MessageBox MB_OK "PyGTK GUI can not be installed, because Python was not found on this system. If you do want to use the PyGTK GUI, please check the installation instructions ($PYPATH)"
169        ${EndIf}
170        Return
171            
     StrCpy $PYINSTALLED "1"  
     WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1  
172  pydone:  pydone:
173        MessageBox MB_OK "PyGTK GUI was not installed properly -- problems with creating ascend.bar"    
174  SectionEnd  SectionEnd
175    
176  ;---------------------------------  ;---------------------------------
# Line 272  SectionEnd Line 278  SectionEnd
278  ; UTILITY ROUTINES  ; UTILITY ROUTINES
279    
280  Function DetectPython  Function DetectPython
281    ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\2.4\InstallPath" ""      ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\2.4\InstallPath" ""
282    StrCmp $R6 "" NoFound1      ${If} $R6 == ''
283            ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\2.4\InstallPath" ""
284    IfFileExists "$R6\python.exe" 0 NoFound          ${If} $R6 == ''
285    Push "$R6"              Push "No registry key found"
286    Push "OK"              Push "NOK"
287    Return              Return
288            ${EndIf}
289  NoFound:      ${EndIf}
290    Push "No python.exe found"      
291    Push "NOK"      ${If} ${FileExists} "$R6\python.exe"
292    Return          Push "$R6"
293            Push "OK"
294  NoFound1:      ${Else}
295    Push "No registry key found"          Push "No python.exe found"
296    Push "NOK"          Push "NOK"
297    Return      ${EndIf}
     
298  FunctionEnd  FunctionEnd
299    
300  ;--------------------------------------------------------------------  ;--------------------------------------------------------------------
301    ; Prefer the current user's installation of GTK, fall back to the local machine
302    
303  Function DetectGTK  Function DetectGTK
304    ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath"      ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath"
305    StrCmp $R6 "" GtkNoFound      ${If} $R6 == ''
306    IfFileExists "$R6\pkg-config.exe" 0 GtkNoFound1          ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath"
307    Push "$R6"          ${If} $R6 == ''
308    Push "OK"              Push "No GTK registry key found"
309    Return              Push "NOK"
310                Return
311  GtkNoFound:          ${EndIf}
312    Push "No registry key"      ${EndIf}
313    Push "NOK"  
314    Return      ${If} ${FileExists} "$R6\libgtk-win32-2.0-0.dll"
315              Push "$R6"
316  GtkNoFound1:          Push "OK"
317    Push "No pkg-config.exe found"      ${Else}
318    Push "NOK"          Push "No libgtk-win32-2.0-0.dll found in'$R6'"
319    Return          Push "NOK"
320        ${EndIf}
321    FunctionEnd
322    
323    ;--------------------------------------------------------------------
324    ; Prefer the current user's installation of GTK, fall back to the local machine
325    
326    Function DetectGlade
327        ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath"
328        ${If} $R6 == ''
329            ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath"
330            ${If} $R6 == ''
331                Push "No GTK registry key found"
332                Push "NOK"
333                Return
334            ${EndIf}
335        ${EndIf}
336    
337        ${If} ${FileExists} "$R6\libglade-2.0-0.dll"
338            Push "$R6"
339            Push "OK"
340        ${Else}
341            Push "No libglade-2.0-0.dll found in'$R6'"
342            Push "NOK"
343        ${EndIf}
344  FunctionEnd  FunctionEnd
345    
346  ;--------------------------------------------------------------------  ;--------------------------------------------------------------------
347    
348  Function DetectTcl  Function DetectTcl
349    ReadRegStr $R6 HKLM "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"      ReadRegStr $R6 HKCU "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
350    ${If} $R6 == ''      ${If} $R6 == ''
351      Push "No 'CurrentVersion' registry key"          ReadRegStr $R6 HKLM "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
352      Push "NOK"          ${If} $R6 == ''
353    ${Else}              Push "No 'CurrentVersion' registry key"
354      StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"              Push "NOK"
355      ReadRegStr $R8 HKLM $R7 ""              Return
356      ${If} $R8 == ''          ${Else}
357          Push "No value for $R7"              StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
358          Push "NOK"              ReadRegStr $R8 HKLM $R7 ""      
359      ${Else}          ${EndIf}
360          Push "$R8\bin"      ${Else}
361          Push "OK"          StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
362      ${EndIf}          ReadRegStr $R8 HKCU $R7 ""      
363    ${EndIf}      ${EndIf}
364    
365        ${If} $R8 == ''
366            Push "No value for $R7"
367            Push "NOK"
368        ${Else}
369            Push "$R8\bin"
370            Push "OK"
371        ${EndIf}
372  FunctionEnd  FunctionEnd

Legend:
Removed from v.858  
changed lines
  Added in v.859

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