/[ascend]/branches/georgy/nsis/installer.nsi
ViewVC logotype

Contents of /branches/georgy/nsis/installer.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1567 - (show annotations) (download)
Thu Aug 2 15:10:54 2007 UTC (11 years, 11 months ago) by jpye
Original Path: trunk/installer.nsi
File size: 19500 byte(s)
Added support for downloading and installing missing stuff on Windows.
1 ; NSIS script to create an ASCEND binary installer for Windows
2 ; by John Pye, 2006-2007.
3 ;
4 ;--------------------------------
5
6 ; The name of the installer
7
8 !ifndef VERSION
9 !define VERSION 0.svn
10 !endif
11
12 Name "ASCEND ${VERSION}"
13
14 !include LogicLib.nsh
15
16 !ifndef PYVERSION
17 !define PYVERSION "2.5"
18 !endif
19
20 !ifndef PYPATCH
21 !define PYPATCH ".1"
22 !endif
23
24 ; The file to write
25 !ifdef OUTFILE
26 OutFile ${OUTFILE}
27 !else
28 OutFile "ascend-${VERSION}-py${PYVERSION}.exe"
29 !endif
30
31 ;SetCompressor /FINAL zlib
32 SetCompressor /SOLID lzma
33
34 ; The default installation directory
35 InstallDir $PROGRAMFILES\ASCEND
36
37 ; Registry key to check for directory (so if you install again, it will
38 ; overwrite the old one automatically)
39 InstallDirRegKey HKLM "Software\ASCEND" "Install_Dir"
40
41 ;--------------------------------
42
43 ; Pages
44
45 Page components
46 Page directory
47 Page instfiles
48
49 UninstPage uninstConfirm
50 UninstPage instfiles
51
52 ;--------------------------------
53
54 Var /GLOBAL DEFAULTPATH
55 Var /GLOBAL PYOK
56 Var /GLOBAL PYPATH
57 Var /GLOBAL GTKOK
58 Var /GLOBAL GTKPATH
59 Var /GLOBAL GLADEOK
60 Var /GLOBAL PYGTKOK
61 Var /GLOBAL PYGOBJECTOK
62 Var /GLOBAL PYCAIROOK
63 Var /GLOBAL GLADEPATH
64 Var /GLOBAL PYINSTALLED
65 Var /GLOBAL TCLOK
66 Var /GLOBAL TCLPATH
67 Var /GLOBAL TCLINSTALLED
68 Var /GLOBAL PATH
69
70 Function .onInit
71 StrCpy $PYINSTALLED ""
72 StrCpy $TCLINSTALLED ""
73
74 ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32"
75
76 Call DetectPython
77 Pop $PYOK
78 Pop $PYPATH
79
80 Call DetectGTK
81 Pop $GTKOK
82 Pop $GTKPATH
83
84 Call DetectGlade
85 Pop $GLADEOK
86 Pop $GLADEPATH
87
88 Call DetectTcl
89 Pop $TCLOK
90 Pop $TCLPATH
91
92 Call DetectPyGTK
93 Pop $PYGTKOK
94
95 Call DetectPyGObject
96 Pop $PYGOBJECTOK
97
98 Call DetectPyCairo
99 Pop $PYCAIROOK
100
101 StrCpy $PATH "$DEFAULTPATH;$PYPATH;$GTKPATH"
102
103 FunctionEnd
104
105 ; The stuff to install
106 Section "ASCEND (required)"
107 SectionIn RO
108
109 DetailPrint "--- COMMON FILES ---"
110
111 ; Set output path to the installation directory.
112 SetOutPath $INSTDIR
113 File "ascend.dll"
114 File "ascend-config"
115 File "pygtk\glade\ascend.ico"
116 File "LICENSE.txt"
117 File "CHANGELOG.txt"
118 File "README-windows.txt"
119
120 ; Model Library
121 SetOutPath $INSTDIR\models
122 File /r /x .svn "models\*.a4*"
123 File /r /x .svn "models\*.tcl"
124 File /r /x .svn "models\*.dll" ; extension modules
125 File /r /x .svn "models\*.py"; python modules
126
127 SetOutPath $INSTDIR\solvers
128 File "solvers\qrslv\qrslv.dll"
129 File "solvers\conopt\conopt.dll"
130 File "solvers\lrslv\lrslv.dll"
131 File "solvers\cmslv\cmslv.dll"
132 File "solvers\lsode\lsode.dll"
133 File "solvers\ida\ida.dll"
134
135 SetOutPath $INSTDIR
136 ;File "Makefile.bt"
137 File "tools\textpad\ascend.syn"
138
139 ${If} ${FileExists} "$APPDATA\.ascend.ini"
140 MessageBox MB_OK "The '$APPDATA\.ascend.ini' is NOT being updated. Manually delete this file if ASCEND doesn't behave as expected."
141 ${Else}
142 ; Set 'librarypath' in .ascend.ini
143 WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models"
144 ${EndIf}
145
146 ; Write the installation path into the registry
147 WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR"
148
149 ; Write the uninstall keys for Windows
150 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment"
151 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"'
152 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1
153 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1
154 WriteUninstaller "uninstall.exe"
155
156 ; Write file locations to the registry for access from ascend-config
157 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_LIB" "$INSTDIR"
158 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_BIN" "$INSTDIR"
159 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_INCLUDE" "$INSTDIR\include"
160 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_ASCDATA" "$INSTDIR"
161 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_MODELS" "$INSTDIR\models"
162 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_SOLVERS" "$INSTDIR\solvers"
163 WriteRegStr HKLM SOFTWARE\ASCEND "GTKLIBS" "$GTKPATH"
164
165 ; Create 'ascend-config.bat' batch file for launching the python script 'ascend-config'.
166 ClearErrors
167 FileOpen $0 $INSTDIR\ascend-config.bat w
168 IfErrors ascendconfigerror
169 FileWrite $0 "@echo off"
170 FileWriteByte $0 "13"
171 FileWriteByte $0 "10"
172 FileWrite $0 "set PATH=$PATH"
173 FileWriteByte $0 "13"
174 FileWriteByte $0 "10"
175 FileWrite $0 "cd "
176 FileWrite $0 $INSTDIR
177 FileWriteByte $0 "13"
178 FileWriteByte $0 "10"
179 FileWrite $0 "$PYPATH\python "
180 FileWriteByte $0 "34"
181 FileWrite $0 "$INSTDIR\ascend-config"
182 FileWriteByte $0 "34"
183 FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
184 FileWriteByte $0 "13"
185 FileWriteByte $0 "10"
186
187 FileClose $0
188
189 Return
190 ascendconfigerror:
191 MessageBox MB_OK "The 'ascend-config.bat' file was not installed properly; problems writing to that file."
192
193 SectionEnd
194
195 !define PYTHON_VERSION "${PYVERSION}${PYPATCH}"
196 !define PYTHON_FILENAME "python-${PYTHON_VERSION}.msi"
197 !define PYTHON_URL "http://www.python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_FILENAME}"
198
199 !define GTK_FILENAME "gtk-2.10.11-win32-1.exe"
200 !define GTK_URL "http://downloads.sourceforge.net/gladewin32/${GTK_FILENAME}"
201
202 !define PYGOBJECT_FILENAME "pygobject-2.12.3-1.win32-py${PYVERSION}.exe"
203 !define PYGOBJECT_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.12/${PYGOBJECT_FILENAME}"
204
205 !define PYCAIRO_FILENAME "pycairo-1.2.6-1.win32-py${PYVERSION}.exe"
206 !define PYCAIRO_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.2/${PYCAIRO_FILENAME}"
207
208 !define PYGTK_FILENAME "pygtk-2.10.4-1.win32-py${PYVERSION}.exe"
209 !define PYGTK_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.10/${PYGTK_FILENAME}"
210
211
212 Section "Download prerequisites if necessary"
213 ${If} $PYOK == 'NOK'
214 MessageBox MB_OK "Downloading python..."
215
216 StrCpy $2 "$TEMP\${PYTHON_FILENAME}"
217 nsisdl::download /TIMEOUT=30000 ${PYTHON_URL} $2
218 Pop $R0 ;Get the return value
219 ${If} $R0 == "success"
220 MessageBox MB_OK "Installing python..."
221 ExecWait $2
222 Delete $2
223 Call DetectPython
224 Pop $PYOK
225 Pop $PYPATH
226 ${ElseIf} $R0 == "cancel"
227 MessageBox MB_OK "Python download cancelled"
228 Quit
229 ${Else}
230 MessageBox MB_OK "Download failed: $R0"
231 Quit
232 ${EndIf}
233 ${EndIf}
234
235 ${If} $GTKOK == 'NOK'
236 MessageBox MB_OK "Downloading GTK..."
237 StrCpy $2 "$TEMP\${GTK_FILENAME}"
238 nsisdl::download /TIMEOUT=30000 ${GTK_URL} $2
239 Pop $R0 ;Get the return value
240 ${If} $R0 == "success"
241 MessageBox MB_OK "Installing GTK..."
242 ExecWait $2
243 Delete $2
244 Call DetectGTK
245 Pop $GTKOK
246 Pop $GTKPATH
247 Call DetectGlade
248 Pop $GLADEOK
249 Pop $GLADEPATH
250 ${ElseIf} $R0 == "cancel"
251 MessageBox MB_OK "GTK download cancelled"
252 Quit
253 ${Else}
254 MessageBox MB_OK "Download failed: $R0"
255 Quit
256 ${EndIf}
257 ${EndIf}
258
259 ${If} $PYGOBJECTOK == 'NOK'
260 MessageBox MB_OK "Downloading PyGObject..."
261 StrCpy $2 "$TEMP\${PYGOBJECT_FILENAME}"
262 nsisdl::download /TIMEOUT=30000 ${PYGOBJECT_URL} $2
263 Pop $R0 ;Get the return value
264 ${If} $R0 == "success"
265 MessageBox MB_OK "Installing PyGObject..."
266 ExecWait $2
267 Delete $2
268 Call DetectPyGObject
269 Pop $PYGOBJECTOK
270 ${ElseIf} $R0 == "cancel"
271 MessageBox MB_OK "PyGObject download cancelled"
272 Quit
273 ${Else}
274 MessageBox MB_OK "Download failed: $R0"
275 Quit
276 ${EndIf}
277 ${EndIf}
278
279 ${If} $PYCAIROOK == 'NOK'
280 MessageBox MB_OK "Downloading PyCairo..."
281 StrCpy $2 "$TEMP\${PYCAIRO_FILENAME}"
282 nsisdl::download /TIMEOUT=30000 ${PYCAIRO_URL} $2
283 Pop $R0 ;Get the return value
284 ${If} $R0 == "success"
285 MessageBox MB_OK "Installing PyCairo..."
286 ExecWait $2
287 Delete $2
288 Call DetectPyCairo
289 Pop $PYCAIROOK
290 ${ElseIf} $R0 == "cancel"
291 MessageBox MB_OK "PyCairo download cancelled"
292 Quit
293 ${Else}
294 MessageBox MB_OK "Download failed: $R0"
295 Quit
296 ${EndIf}
297 ${EndIf}
298
299
300 ${If} $PYGTKOK == 'NOK'
301 MessageBox MB_OK "Downloading PyGTK..."
302 StrCpy $2 "$TEMP\${PYGTK_FILENAME}"
303 nsisdl::download /TIMEOUT=30000 ${PYGTK_URL} $2
304 Pop $R0 ;Get the return value
305 ${If} $R0 == "success"
306 MessageBox MB_OK "Installing PyGTK..."
307 ExecWait $2
308 Delete $2
309 Call DetectPyGTK
310 Pop $PYGTKOK
311 ${ElseIf} $R0 == "cancel"
312 MessageBox MB_OK "PyGTK download cancelled"
313 Quit
314 ${Else}
315 MessageBox MB_OK "Download failed: $R0"
316 Quit
317 ${EndIf}
318 ${EndIf}
319
320 SectionEnd
321
322 ;--------------------------------
323
324 Section "PyGTK GUI"
325 ; Check the dependencies of the PyGTK GUI before proceding...
326 ${If} $PYOK == 'NOK'
327 MessageBox MB_OK "PyGTK GUI can not be installed, because Python was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(PYPATH=$PYPATH)"
328 ${ElseIf} $GTKOK == 'NOK'
329 MessageBox MB_OK "PyGTK GUI cannot be installed, because GTK+ 2.x was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(GTKPATH=$GTKPATH)"
330 ${ElseIf} $GLADEOK == 'NOK'
331 MessageBox MB_OK "PyGTK GUI cannot be installed, because Glade 2.x was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(GTKPATH=$GTKPATH).\n\nIf you do have GTK+ runtime installed, make sure\nyou have a version that includes support for Glade."
332 ${ElseIf} $PYGTKOK == "NOK"
333 MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGTK was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)"
334 ${ElseIf} $PYCAIROOK == "NOK"
335 MessageBox MB_OK "PyGTK GUI cannot be installed, because PyCairo was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)"
336 ${ElseIf} $PYGOBJECTOK == "NOK"
337 MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGObject was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)"
338 ${Else}
339 ;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH"
340
341 DetailPrint "--- PYTHON INTERFACE ---"
342
343 ; Set output path to the installation directory.
344 SetOutPath $INSTDIR
345
346 ; Python interface
347 File /nonfatal "pygtk\_ascpy.pyd"
348 File "pygtk\*.py"
349 File "pygtk\ascend"
350 File "pygtk\glade\ascend-doc.ico"
351
352 SetOutPath $INSTDIR\glade
353 File "pygtk\glade\*.glade"
354 File "pygtk\glade\*.png"
355 File "pygtk\glade\*.svg"
356
357 StrCpy $PYINSTALLED "1"
358 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1
359
360 ;---- file association ----
361
362 ; back up old value of .a4c file association
363 ReadRegStr $1 HKCR ".a4c" ""
364 StrCmp $1 "" a4cnobkp
365 StrCmp $1 "ASCEND.model" a4cnobkp
366
367 ; Remember the old file association if necessary
368 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4C" $1
369
370 a4cnobkp:
371 WriteRegStr HKCR ".a4c" "" "ASCEND.model"
372
373 ; back up old value of .a4c file association
374 ReadRegStr $1 HKCR ".a4l" ""
375 StrCmp $1 "" a4lnobkp
376 StrCmp $1 "ASCEND.model" a4lnobkp
377
378 ; Remember the old file association if necessary
379 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4L" $1
380
381 a4lnobkp:
382 WriteRegStr HKCR ".a4l" "" "ASCEND.model"
383
384 ; So, what does an A4L or A4C file actually do?
385
386 ReadRegStr $0 HKCR "ASCEND.model" ""
387 StrCmp $0 "" 0 a4cskip
388
389 WriteRegStr HKCR "ASCEND.model" "" "ASCEND model file"
390 WriteRegStr HKCR "ASCEND.model\shell" "" "open"
391 WriteRegStr HKCR "ASCEND.model\DefaultIcon" "" "$INSTDIR\ascend-doc.ico"
392
393 a4cskip:
394 WriteRegStr HKCR "ASCEND.model\shell\open\command" "" '$PYPATH\pythonw "$INSTDIR\ascend" "%1"'
395
396 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
397
398 ${EndIf}
399 Return
400
401 SectionEnd
402
403 ;---------------------------------
404
405 Section "Tcl/Tk GUI"
406
407 ${If} $TCLOK != 'OK'
408 MessageBox MB_OK "Tck/Tk GUI can not be installed, because ActiveTcl was not found on this system. If do you want to use the Tcl/Tk GUI, please check the installation instructions ($TCLPATH)"
409 ${Else}
410 DetailPrint "--- TCL/TK INTERFACE ---"
411 SetOutPath $INSTDIR\tcltk
412 File /r /x .svn "tcltk\TK\*"
413 SetOutPath $INSTDIR
414 File "tcltk\generic\interface\ascendtcl.dll"
415 File "tcltk\generic\interface\ascend4.exe"
416
417 StrCpy $TCLINSTALLED "1"
418 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "TclTk" 1
419
420 ${EndIf}
421
422 SectionEnd
423
424 ;---------------------------------
425
426 ; Optional section (can be disabled by the user)
427 Section "Start Menu Shortcuts"
428
429 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "StartMenu" 1
430
431 CreateDirectory "$SMPROGRAMS\ASCEND"
432
433 ; Link to PyGTK GUI
434 StrCmp $PYINSTALLED "" smdone 0
435 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$PYPATH\pythonw.exe" '"$INSTDIR\ascend"' "$INSTDIR\ascend.ico" 0
436 smdone:
437
438 ; Model library shortcut
439 CreateShortCut "$SMPROGRAMS\ASCEND\Model Library.lnk" "$INSTDIR\models" "" "$INSTDIR\models" 0
440
441
442 ; Link to Tcl/Tk GUI
443 StrCmp $TCLINSTALLED "" smnotcl 0
444 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND Tcl/Tk.lnk" "$INSTDIR\ascend4.exe" "" "$INSTDIR\ascend4.exe" 0
445 smnotcl:
446
447 ; Information files
448 CreateShortCut "$SMPROGRAMS\ASCEND\LICENSE.lnk" "$INSTDIR\LICENSE.txt" '' "$INSTDIR\LICENSE.txt" 0
449 CreateShortCut "$SMPROGRAMS\ASCEND\CHANGELOG.lnk" "$INSTDIR\CHANGELOG.txt" '' "$INSTDIR\CHANGELOG.txt" 0
450 CreateShortCut "$SMPROGRAMS\ASCEND\README.lnk" "$INSTDIR\README-windows.txt" '' "$INSTDIR\README-windows.txt" 0
451
452 CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
453
454 SectionEnd
455
456 ;------------------------------------------------------------------
457 ; UNINSTALLER
458
459 Section "Uninstall"
460
461 ;--- python components ---
462
463 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"
464 IntCmp $0 0 unnopython unpython
465
466 unpython:
467 DetailPrint "--- REMOVING PYTHON COMPONENTS ---"
468 Delete $INSTDIR\_ascpy.pyd
469 Delete $INSTDIR\ascend
470 Delete $INSTDIR\*.py
471 Delete $INSTDIR\*.pyc
472 Delete $INSTDIR\glade\*.glade
473 Delete $INSTDIR\glade\*.png
474 Delete $INSTDIR\glade\*.svg
475 RmDir $INSTDIR\glade
476 Delete $INSTDIR\ascend-doc.ico
477
478 ;--- file association (for Python GUI) ---
479
480 DetailPrint "--- REMOVING FILE ASSOCIATION ---"
481 ;start of restore script
482 ReadRegStr $1 HKCR ".a4c" ""
483 ${If} $1 == "ASCEND.model"
484 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
485 ${If} $1 == ""
486 ; nothing to restore: delete it
487 DeleteRegKey HKCR ".a4c"
488 ${Else}
489 WriteRegStr HKCR ".a4c" "" $1
490 ${EndIf}
491 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
492 ${EndIf}
493
494 ReadRegStr $1 HKCR ".a4l" ""
495 ${If} $1 == "ASCEND.model"
496 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
497 ${If} $1 == ""
498 ; nothing to restore: delete it
499 DeleteRegKey HKCR ".a4l"
500 ${Else}
501 WriteRegStr HKCR ".a4l" "" $1
502 ${EndIf}
503 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
504 ${EndIf}
505
506 DeleteRegKey HKCR "ASCEND.model" ;Delete key with association settings
507
508 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
509 ;rest of script
510
511 unnopython:
512
513 ;--- tcl/tk components ---
514
515 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"
516 ${If} $0 != 0
517 DetailPrint "--- REMOVING TCL/TK COMPONENTS ---"
518 Delete $INSTDIR\ascendtcl.dll
519 Delete $INSTDIR\ascend4.exe
520 RMDir /r $INSTDIR\tcltk
521 ${EndIf}
522
523 ;--- start menu ---
524
525 ReadRegDWORD $1 HKLM "SOFTWARE\ASCEND" "StartMenu"
526 IntCmp $1 0 unnostart unstart
527 unstart:
528 ; Remove shortcuts, if any
529 DetailPrint "--- REMOVING START MENU SHORTCUTS ---"
530 RmDir /r "$SMPROGRAMS\ASCEND"
531
532 unnostart:
533
534 ;--- common components ---
535
536 DetailPrint "--- REMOVING COMMON COMPONENTS ---"
537 ; Remove registry keys
538
539 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND"
540 DeleteRegKey HKLM "SOFTWARE\ASCEND"
541
542 ; Remove files and uninstaller
543
544 Delete $INSTDIR\ascend-config
545 Delete $INSTDIR\ascend-config.bat
546 Delete $INSTDIR\ascend.dll
547 Delete $INSTDIR\LICENSE.txt
548 Delete $INSTDIR\README-windows.txt
549 Delete $INSTDIR\CHANGELOG.txt
550 Delete $INSTDIR\ascend.ico
551 Delete $INSTDIR\Makefile.bt
552 Delete $INSTDIR\ascend.syn
553 RMDir /r $INSTDIR\models
554 Delete $INSTDIR\solvers\qrslv.dll
555 Delete $INSTDIR\solvers\conopt.dll
556 Delete $INSTDIR\solvers\lrslv.dll
557 Delete $INSTDIR\solvers\cmslv.dll
558 Delete $INSTDIR\solvers\lsode.dll
559 Delete $INSTDIR\solvers\ida.dll
560
561 ; Remove directories used
562
563 Delete $INSTDIR\uninstall.exe
564 RMDir $INSTDIR
565
566 SectionEnd
567
568 ;---------------------------------------------------------------------
569 ; UTILITY ROUTINES
570
571 Function DetectPython
572 ReadRegStr $R6 HKCU "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
573 ${If} $R6 == ''
574 ReadRegStr $R6 HKLM "SOFTWARE\Python\PythonCore\${PYVERSION}\InstallPath" ""
575 ${If} $R6 == ''
576 Push "No registry key found"
577 Push "NOK"
578 Return
579 ${EndIf}
580 ${EndIf}
581
582 ${If} ${FileExists} "$R6\python.exe"
583 Push "$R6"
584 Push "OK"
585 ${Else}
586 Push "No python.exe found"
587 Push "NOK"
588 ${EndIf}
589 FunctionEnd
590
591 ;--------------------------------------------------------------------
592 ; Prefer the current user's installation of GTK, fall back to the local machine
593
594 Function DetectGTK
595 ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath"
596 ${If} $R6 == ''
597 ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath"
598 ${If} $R6 == ''
599 Push "No GTK registry key found"
600 Push "NOK"
601 Return
602 ${EndIf}
603 ${EndIf}
604
605 ${If} ${FileExists} "$R6\libgtk-win32-2.0-0.dll"
606 Push "$R6"
607 Push "OK"
608 ${Else}
609 Push "No libgtk-win32-2.0-0.dll found in'$R6'"
610 Push "NOK"
611 ${EndIf}
612 FunctionEnd
613
614 ;--------------------------------------------------------------------
615 ; Are necessary PyGTK bits and pieces available?
616
617 Function DetectPyGTK
618 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gtk\__init__.py"
619 Push "OK"
620 ${Else}
621 Push "NOK"
622 ${EndIf}
623 FunctionEnd
624
625 Function DetectPyCairo
626 ${If} ${FileExists} "$PYPATH\Lib\site-packages\cairo\__init__.py"
627 Push "OK"
628 ${Else}
629 Push "NOK"
630 ${EndIf}
631 FunctionEnd
632
633 Function DetectPyGObject
634 ${If} ${FileExists} "$PYPATH\Lib\site-packages\gtk-2.0\gobject\__init__.py"
635 Push "OK"
636 ${Else}
637 Push "NOK"
638 ${EndIf}
639 FunctionEnd
640
641 ;--------------------------------------------------------------------
642 ; Prefer the current user's installation of GTK, fall back to the local machine
643
644 Function DetectGlade
645 ReadRegStr $R6 HKCU "SOFTWARE\GTK\2.0" "DllPath"
646 ${If} $R6 == ''
647 ReadRegStr $R6 HKLM "SOFTWARE\GTK\2.0" "DllPath"
648 ${If} $R6 == ''
649 Push "No GTK registry key found"
650 Push "NOK"
651 Return
652 ${EndIf}
653 ${EndIf}
654
655 ${If} ${FileExists} "$R6\libglade-2.0-0.dll"
656 Push "$R6"
657 Push "OK"
658 ${Else}
659 Push "No libglade-2.0-0.dll found in'$R6'"
660 Push "NOK"
661 ${EndIf}
662 FunctionEnd
663
664 ;--------------------------------------------------------------------
665
666 Function DetectTcl
667 ReadRegStr $R6 HKCU "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
668 ${If} $R6 == ''
669 ReadRegStr $R6 HKLM "SOFTWARE\ActiveState\ActiveTcl" "CurrentVersion"
670 ${If} $R6 == ''
671 Push "No 'CurrentVersion' registry key"
672 Push "NOK"
673 Return
674 ${Else}
675 StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
676 ReadRegStr $R8 HKLM $R7 ""
677 ${EndIf}
678 ${Else}
679 StrCpy $R7 "SOFTWARE\ActiveState\ActiveTcl\$R6"
680 ReadRegStr $R8 HKCU $R7 ""
681 ${EndIf}
682
683 ${If} $R8 == ''
684 Push "No value for $R7"
685 Push "NOK"
686 ${Else}
687 Push "$R8\bin"
688 Push "OK"
689 ${EndIf}
690 FunctionEnd

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