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

Contents of /trunk/nsis/installer.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1757 - (show annotations) (download)
Wed Feb 27 05:40:40 2008 UTC (16 years, 3 months ago) by jpye
File size: 18876 byte(s)
Add DOPRI5 to installer package (EXPERIMENTAL).
On Windows, use the registry to locate the book.pdf documentation file.
Fix path to test models for DOPRI5 in test.py.
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 ;SetCompressor /FINAL zlib
15 SetCompressor /SOLID lzma
16
17 !include LogicLib.nsh
18 !include nsDialogs.nsh
19
20 !ifndef PYVERSION
21 !define PYVERSION "2.5"
22 !endif
23
24 !ifndef PYPATCH
25 !define PYPATCH ".1"
26 !endif
27
28 ; The file to write
29 !ifdef OUTFILE
30 OutFile ${OUTFILE}
31 !else
32 OutFile "ascend-${VERSION}-py${PYVERSION}.exe"
33 !endif
34
35
36 ; The default installation directory
37 InstallDir $PROGRAMFILES\ASCEND
38
39 ; Registry key to check for directory (so if you install again, it will
40 ; overwrite the old one automatically)
41 InstallDirRegKey HKLM "Software\ASCEND" "Install_Dir"
42
43 ;--------------------------------
44
45 ; Pages
46
47 Page license
48 LicenseData "..\LICENSE.txt"
49
50 Page components
51 Page directory
52 Page custom dependenciesCreate dependenciesLeave
53 Page instfiles
54 Page custom ascendIniCreate ascendIniLeave
55
56 UninstPage uninstConfirm
57 UninstPage instfiles
58
59 ;--------------------------------
60
61 Var /GLOBAL DEFAULTPATH
62 Var /GLOBAL PYOK
63 Var /GLOBAL PYPATH
64 Var /GLOBAL GTKOK
65 Var /GLOBAL GTKPATH
66 Var /GLOBAL GLADEOK
67 Var /GLOBAL PYGTKOK
68 Var /GLOBAL PYGOBJECTOK
69 Var /GLOBAL PYCAIROOK
70 Var /GLOBAL GLADEPATH
71 Var /GLOBAL PYINSTALLED
72 Var /GLOBAL TCLOK
73 Var /GLOBAL TCLPATH
74 Var /GLOBAL TCLINSTALLED
75
76 Var /GLOBAL PDFINSTALLED
77
78 Var /GLOBAL PATH
79
80 Var /GLOBAL PYDOWNLOAD
81 Var /GLOBAL PYGTKDOWNLOAD
82 Var /GLOBAL PYGOBJECTDOWNLOAD
83 Var /GLOBAL PYCAIRODOWNLOAD
84 Var /GLOBAL GTKDOWNLOAD
85 Var /GLOBAL TCLDOWNLOAD
86
87 Var /GLOBAL ASCENDINIFOUND
88
89 Function .onInit
90 StrCpy $PYINSTALLED ""
91 StrCpy $TCLINSTALLED ""
92 StrCpy $ASCENDINIFOUND ""
93 StrCpy $PDFINSTALLED ""
94
95 ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32"
96
97 Call DetectPython
98 Pop $PYOK
99 Pop $PYPATH
100
101 Call DetectGTK
102 Pop $GTKOK
103 Pop $GTKPATH
104
105 Call DetectGlade
106 Pop $GLADEOK
107 Pop $GLADEPATH
108
109 Call DetectTcl
110 Pop $TCLOK
111 Pop $TCLPATH
112
113 Call DetectPyGTK
114 Pop $PYGTKOK
115
116 Call DetectPyGObject
117 Pop $PYGOBJECTOK
118
119 Call DetectPyCairo
120 Pop $PYCAIROOK
121
122 StrCpy $PATH "$DEFAULTPATH;$PYPATH;$GTKPATH"
123
124 FunctionEnd
125
126 ;------------------------------------------------------------
127 ; DOWNLOAD AND INSTALL DEPENDENCIES FIRST
128
129 !define PYTHON_VERSION "${PYVERSION}${PYPATCH}"
130 !define PYTHON_FN "python-${PYTHON_VERSION}.msi"
131 !define PYTHON_URL "http://www.python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_FN}"
132 !define PYTHON_CMD "msiexec /i $DAI_TMPFILE /passive"
133
134 !define GTK_FN "gtk-2.10.11-win32-1.exe"
135 !define GTK_URL "http://downloads.sourceforge.net/gladewin32/${GTK_FN}"
136 !define GTK_CMD "$DAI_TMPFILE"
137
138 !define PYGOBJECT_FN "pygobject-2.12.3-1.win32-py${PYVERSION}.exe"
139 !define PYGOBJECT_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.12/${PYGOBJECT_FN}"
140 !define PYGOBJECT_CMD "$DAI_TMPFILE"
141
142 !define PYCAIRO_FN "pycairo-1.2.6-1.win32-py${PYVERSION}.exe"
143 !define PYCAIRO_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.2/${PYCAIRO_FN}"
144 !define PYCAIRO_CMD "$DAI_TMPFILE"
145
146 !define PYGTK_FN "pygtk-2.10.4-1.win32-py${PYVERSION}.exe"
147 !define PYGTK_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.10/${PYGTK_FN}"
148 !define PYGTK_CMD "$DAI_TMPFILE"
149
150 !define TCL_VERSION "8.4.15"
151 !define TCL_PATCH ".0.280619"
152 !define TCL_FN "ActiveTcl${TCL_VERSION}${TCL_PATCH}-win32-ix86-threaded.exe"
153 !define TCL_URL "http://downloads.activestate.com/ActiveTcl/Windows/${TCL_VERSION}/${TCL_FN}"
154 !define TCL_CMD "$DAI_TMPFILE"
155 !include "download.nsi"
156
157 Section "-python"
158 DetailPrint "--- DOWNLOAD PYTHON ---"
159 ${If} $PYDOWNLOAD == '1'
160 !insertmacro downloadAndInstall "Python" "${PYTHON_URL}" "${PYTHON_FN}" "${PYTHON_CMD}"
161 Call DetectPython
162 Pop $PYOK
163 Pop $PYPATH
164 ${If} $PYOK == 'NOK'
165 MessageBox MB_OK "Python installation appears to have failed"
166 ${EndIf}
167 ${EndIf}
168 SectionEnd
169 Section "-gtk"
170 DetailPrint "--- DOWNLOAD GTK+ ---"
171 ${If} $GTKDOWNLOAD == '1'
172 !insertmacro downloadAndInstall "GTK+" ${GTK_URL} ${GTK_FN} ${GTK_CMD}
173 Call DetectGTK
174 Pop $GTKOK
175 Pop $GTKPATH
176 Call DetectGlade
177 Pop $GLADEOK
178 Pop $GLADEPATH
179 ${EndIf}
180 SectionEnd
181 Section "-pygobject"
182 DetailPrint "--- DOWNLOAD PYGOBJECT ---"
183 ${If} $PYGOBJECTDOWNLOAD == '1'
184 ${AndIf} $PYOK == 'OK'
185 !insertmacro downloadAndInstall "PyGObject" ${PYGOBJECT_URL} ${PYGOBJECT_FN} ${PYGOBJECT_CMD}
186 Call DetectPyGObject
187 Pop $PYGOBJECTOK
188 ${EndIf}
189 SectionEnd
190 Section "-pycairo"
191 DetailPrint "--- DOWNLOAD PYCAIRO ---"
192 ${If} $PYCAIRODOWNLOAD == '1'
193 ${AndIf} $PYOK == 'OK'
194 !insertmacro downloadAndInstall "PyCairo" ${PYCAIRO_URL} ${PYCAIRO_FN} ${PYCAIRO_CMD}
195 Call DetectPyCairo
196 Pop $PYCAIROOK
197 ${EndIf}
198 SectionEnd
199 Section "-pygtk"
200 DetailPrint "--- DOWNLOAD PYGTK ---"
201 ${If} $PYGTKDOWNLOAD == '1'
202 ${AndIf} $PYOK == 'OK'
203 !insertmacro downloadAndInstall "PyGTK" ${PYGTK_URL} ${PYGTK_FN} ${PYGTK_CMD}
204 Call DetectPyGTK
205 Pop $PYGTKOK
206
207 ${EndIf}
208 SectionEnd
209 Section "-tcl"
210 DetailPrint "--- DOWNLOAD TCL/TK ---"
211 ${If} $TCLDOWNLOAD == '1'
212 !insertmacro downloadAndInstall "Tcl/Tk" ${TCL_URL} ${TCL_FN} ${TCL_CMD}
213 Call DetectTcl
214 Pop $TCLOK
215 Pop $TCLPATH
216 ${EndIf}
217 SectionEnd
218
219 ;------------------------------------------------------------------------
220 ; INSTALL CORE STUFF including model library
221
222 ; The stuff to install
223 Section "ASCEND (required)"
224 SectionIn RO
225
226 DetailPrint "--- COMMON FILES ---"
227
228 ; Set output path to the installation directory.
229 SetOutPath $INSTDIR
230 File "..\ascend.dll"
231 File "..\ascend-config"
232 File "..\pygtk\glade\ascend.ico"
233 File "..\LICENSE.txt"
234 File "..\CHANGELOG.txt"
235 File "..\README-windows.txt"
236
237 ; Model Library
238 SetOutPath $INSTDIR\models
239 File /r /x .svn "..\models\*.a4*"
240 File /r /x .svn "..\models\*.tcl"
241 File /r /x .svn "..\models\*_ascend.dll" ; extension modules
242 File /r /x .svn "..\models\*.py"; python modules
243
244 SetOutPath $INSTDIR\solvers
245 File "..\solvers\qrslv\qrslv_ascend.dll"
246 File "..\solvers\conopt\conopt_ascend.dll"
247 File "..\solvers\lrslv\lrslv_ascend.dll"
248 File "..\solvers\cmslv\cmslv_ascend.dll"
249 File "..\solvers\lsode\lsode_ascend.dll"
250 File "..\solvers\ida\ida_ascend.dll"
251 File "..\solvers\dopri5\dopri5_ascend.dll"
252
253 SetOutPath $INSTDIR
254 ;File "Makefile.bt"
255 File "..\tools\textpad\ascend.syn"
256
257 ${If} ${FileExists} "$APPDATA\.ascend.ini"
258 StrCpy $ASCENDINIFOUND "1"
259 ${Else}
260 ; Set 'librarypath' in .ascend.ini
261 WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models"
262 ${EndIf}
263
264 ; Write the installation path into the registry
265 WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR"
266
267 ; Write the uninstall keys for Windows
268 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment"
269 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"'
270 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1
271 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1
272 WriteUninstaller "uninstall.exe"
273
274 ; Write file locations to the registry for access from ascend-config
275 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_LIB" "$INSTDIR"
276 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_BIN" "$INSTDIR"
277 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_INCLUDE" "$INSTDIR\include"
278 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_ASCDATA" "$INSTDIR"
279 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_MODELS" "$INSTDIR\models"
280 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_SOLVERS" "$INSTDIR\solvers"
281 WriteRegStr HKLM SOFTWARE\ASCEND "GTKLIBS" "$GTKPATH"
282
283 ; Write default values of ASCENDLIBRARY and ASCENDSOLVERS (user can override with env vars)
284 WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDLIBRARY" "$INSTDIR\models"
285 WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDSOLVERS" "$INSTDIR\solvers"
286
287 ; Create 'ascend.bat' batch file for launching the PyGTK GUI.
288 ClearErrors
289 FileOpen $0 $INSTDIR\ascend.bat w
290 ${If} ${Errors}
291 MessageBox MB_OK "The 'ascend.bat' file was not installed properly; problems writing to that file."
292 ${Else}
293 FileWrite $0 "@echo off"
294 FileWriteByte $0 "13"
295 FileWriteByte $0 "10"
296 FileWrite $0 "set PATH=$PATH"
297 FileWriteByte $0 "13"
298 FileWriteByte $0 "10"
299 FileWrite $0 "cd "
300 FileWrite $0 $INSTDIR
301 FileWriteByte $0 "13"
302 FileWriteByte $0 "10"
303 FileWrite $0 "$PYPATH\python "
304 FileWriteByte $0 "34"
305 FileWrite $0 "$INSTDIR\ascend"
306 FileWriteByte $0 "34"
307 FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
308 FileWriteByte $0 "13"
309 FileWriteByte $0 "10"
310 FileClose $0
311 ${EndIf}
312
313 ; Create 'ascend-config.bat' batch file for launching the python script 'ascend-config'.
314 ClearErrors
315 FileOpen $0 $INSTDIR\ascend-config.bat w
316 ${If} ${Errors}
317 MessageBox MB_OK "The 'ascend-config.bat' file was not installed properly; problems writing to that file."
318 ${Else}
319 FileWrite $0 "@echo off"
320 FileWriteByte $0 "13"
321 FileWriteByte $0 "10"
322 FileWrite $0 "set PATH=$PATH"
323 FileWriteByte $0 "13"
324 FileWriteByte $0 "10"
325 FileWrite $0 "cd "
326 FileWrite $0 $INSTDIR
327 FileWriteByte $0 "13"
328 FileWriteByte $0 "10"
329 FileWrite $0 "$PYPATH\python "
330 FileWriteByte $0 "34"
331 FileWrite $0 "$INSTDIR\ascend-config"
332 FileWriteByte $0 "34"
333 FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
334 FileWriteByte $0 "13"
335 FileWriteByte $0 "10"
336 FileClose $0
337 ${EndIf}
338
339 Return
340 SectionEnd
341
342 ;--------------------------------
343
344 Section "PyGTK GUI"
345 ; Check the dependencies of the PyGTK GUI before proceding...
346 ${If} $PYOK == 'NOK'
347 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)"
348 ${ElseIf} $GTKOK == 'NOK'
349 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)"
350 ${ElseIf} $GLADEOK == 'NOK'
351 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."
352 ${ElseIf} $PYGTKOK == "NOK"
353 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)"
354 ${ElseIf} $PYCAIROOK == "NOK"
355 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)"
356 ${ElseIf} $PYGOBJECTOK == "NOK"
357 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)"
358 ${Else}
359 ;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH"
360
361 DetailPrint "--- PYTHON INTERFACE ---"
362
363 ; Set output path to the installation directory.
364 SetOutPath $INSTDIR
365
366 ; Python interface
367 File /nonfatal "..\pygtk\_ascpy.pyd"
368 File "..\pygtk\*.py"
369 File "..\pygtk\ascend"
370 File "..\pygtk\glade\ascend-doc.ico"
371
372 SetOutPath $INSTDIR\glade
373 File "..\pygtk\glade\*.glade"
374 File "..\pygtk\glade\*.png"
375 File "..\pygtk\glade\*.svg"
376
377 StrCpy $PYINSTALLED "1"
378 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1
379
380 ;---- file association ----
381
382 ; back up old value of .a4c file association
383 ReadRegStr $1 HKCR ".a4c" ""
384 StrCmp $1 "" a4cnobkp
385 StrCmp $1 "ASCEND.model" a4cnobkp
386
387 ; Remember the old file association if necessary
388 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4C" $1
389
390 a4cnobkp:
391 WriteRegStr HKCR ".a4c" "" "ASCEND.model"
392
393 ; back up old value of .a4c file association
394 ReadRegStr $1 HKCR ".a4l" ""
395 StrCmp $1 "" a4lnobkp
396 StrCmp $1 "ASCEND.model" a4lnobkp
397
398 ; Remember the old file association if necessary
399 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4L" $1
400
401 a4lnobkp:
402 WriteRegStr HKCR ".a4l" "" "ASCEND.model"
403
404 ; So, what does an A4L or A4C file actually do?
405
406 ReadRegStr $0 HKCR "ASCEND.model" ""
407 StrCmp $0 "" 0 a4cskip
408
409 WriteRegStr HKCR "ASCEND.model" "" "ASCEND model file"
410 WriteRegStr HKCR "ASCEND.model\shell" "" "open"
411 WriteRegStr HKCR "ASCEND.model\DefaultIcon" "" "$INSTDIR\ascend-doc.ico"
412
413 a4cskip:
414 WriteRegStr HKCR "ASCEND.model\shell\open\command" "" '$PYPATH\pythonw "$INSTDIR\ascend" "%1"'
415
416 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
417
418 ${EndIf}
419 Return
420
421 SectionEnd
422
423 ;---------------------------------
424
425 Section "Tcl/Tk GUI"
426
427 ${If} $TCLOK != 'OK'
428 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)"
429 ${Else}
430 DetailPrint "--- TCL/TK INTERFACE ---"
431 SetOutPath $INSTDIR\tcltk
432 File /r /x .svn "..\tcltk\TK\*"
433 SetOutPath $INSTDIR
434 File "..\tcltk\generic\interface\ascendtcl.dll"
435 File "..\tcltk\generic\interface\ascend4.exe"
436
437 StrCpy $TCLINSTALLED "1"
438 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "TclTk" 1
439
440 ${EndIf}
441
442 SectionEnd
443
444 ;---------------------------------
445
446 Section "Documentation"
447 SetOutPath $INSTDIR
448 File "..\doc\book.pdf"
449 StrCpy $PDFINSTALLED "1"
450 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "PDF" 1
451 SectionEnd
452
453 ; Optional section (can be disabled by the user)
454 Section "Start Menu Shortcuts"
455
456 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "StartMenu" 1
457
458 CreateDirectory "$SMPROGRAMS\ASCEND"
459
460 ; Link to PyGTK GUI
461 ${If} $PYINSTALLED == "1"
462 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$PYPATH\pythonw.exe" '"$INSTDIR\ascend"' "$INSTDIR\ascend.ico" 0
463 ${EndIf}
464
465 ; Model library shortcut
466 CreateShortCut "$SMPROGRAMS\ASCEND\Model Library.lnk" "$INSTDIR\models" "" "$INSTDIR\models" 0
467
468 ; Link to Tcl/Tk GUI
469 ${If} $TCLINSTALLED == "1"
470 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND Tcl/Tk.lnk" "$INSTDIR\ascend4.exe" "" "$INSTDIR\ascend4.exe" 0
471 ${EndIf}
472
473 ; Documentation
474 ${If} $PDFINSTALLED == "1"
475 CreateShortCut "$SMPROGRAMS\ASCEND\User's Manual.lnk" "$INSTDIR\book.pdf" "" "$INSTDIR\book.pdf" 0
476 ${EndIf}
477
478 ; Information files
479 CreateShortCut "$SMPROGRAMS\ASCEND\LICENSE.lnk" "$INSTDIR\LICENSE.txt" '' "$INSTDIR\LICENSE.txt" 0
480 CreateShortCut "$SMPROGRAMS\ASCEND\CHANGELOG.lnk" "$INSTDIR\CHANGELOG.txt" '' "$INSTDIR\CHANGELOG.txt" 0
481 CreateShortCut "$SMPROGRAMS\ASCEND\README.lnk" "$INSTDIR\README-windows.txt" '' "$INSTDIR\README-windows.txt" 0
482
483 CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
484
485 SectionEnd
486
487 ;------------------------------------------------------------------
488 ; HEADER FILES for DEVELOPERS
489
490 Section /o "Header files (for developers)"
491 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1
492
493 SetOutPath $INSTDIR\include
494 File /r /x .svn "..\base\generic\*.h"
495
496 SetOutPath $INSTDIR
497 SectionEnd
498
499 ;------------------------------------------------------------------
500 ; UNINSTALLER
501
502 Section "Uninstall"
503
504 ;--- python components ---
505
506 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"
507 IntCmp $0 0 unnopython unpython
508
509 unpython:
510 DetailPrint "--- REMOVING PYTHON COMPONENTS ---"
511 Delete $INSTDIR\_ascpy.pyd
512 Delete $INSTDIR\ascend
513 Delete $INSTDIR\*.py
514 Delete $INSTDIR\*.pyc
515 Delete $INSTDIR\glade\*.glade
516 Delete $INSTDIR\glade\*.png
517 Delete $INSTDIR\glade\*.svg
518 RmDir $INSTDIR\glade
519 Delete $INSTDIR\ascend-doc.ico
520
521 ;--- file association (for Python GUI) ---
522
523 DetailPrint "--- REMOVING FILE ASSOCIATION ---"
524 ;start of restore script
525 ReadRegStr $1 HKCR ".a4c" ""
526 ${If} $1 == "ASCEND.model"
527 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
528 ${If} $1 == ""
529 ; nothing to restore: delete it
530 DeleteRegKey HKCR ".a4c"
531 ${Else}
532 WriteRegStr HKCR ".a4c" "" $1
533 ${EndIf}
534 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
535 ${EndIf}
536
537 ReadRegStr $1 HKCR ".a4l" ""
538 ${If} $1 == "ASCEND.model"
539 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
540 ${If} $1 == ""
541 ; nothing to restore: delete it
542 DeleteRegKey HKCR ".a4l"
543 ${Else}
544 WriteRegStr HKCR ".a4l" "" $1
545 ${EndIf}
546 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
547 ${EndIf}
548
549 DeleteRegKey HKCR "ASCEND.model" ;Delete key with association settings
550
551 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
552 ;rest of script
553
554 unnopython:
555
556 ;--- tcl/tk components ---
557
558 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"
559 ${If} $0 != 0
560 DetailPrint "--- REMOVING TCL/TK COMPONENTS ---"
561 Delete $INSTDIR\ascendtcl.dll
562 Delete $INSTDIR\ascend4.exe
563 RMDir /r $INSTDIR\tcltk
564 ${EndIf}
565
566 ;--- documentation ---
567
568 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "PDF"
569 ${If} $0 != 0
570 DetailPrint "--- REMOVING DOCUMENTATION ---"
571 Delete $INSTDIR\book.pdf
572 ${EndIf}
573
574 ;--- header files ---
575
576 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "HeaderFiles"
577 ${If} $0 != 0
578 DetailPrint "--- REMOVING HEADER FILES ---"
579 RMDir /r $INSTDIR\include
580 ${EndIf}
581
582 ;--- start menu ---
583
584 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "StartMenu"
585 ${If} $0 != 0
586 ; Remove shortcuts, if any
587 DetailPrint "--- REMOVING START MENU SHORTCUTS ---"
588 RmDir /r "$SMPROGRAMS\ASCEND"
589 ${EndIf}
590
591 ;--- common components ---
592
593 DetailPrint "--- REMOVING COMMON COMPONENTS ---"
594 ; Remove registry keys
595
596 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND"
597 DeleteRegKey HKLM "SOFTWARE\ASCEND"
598
599 ; Remove files and uninstaller
600
601 Delete $INSTDIR\ascend-config
602 Delete $INSTDIR\ascend-config.bat
603 Delete $INSTDIR\ascend.bat
604 Delete $INSTDIR\ascend.dll
605 Delete $INSTDIR\LICENSE.txt
606 Delete $INSTDIR\README-windows.txt
607 Delete $INSTDIR\CHANGELOG.txt
608 Delete $INSTDIR\ascend.ico
609 Delete $INSTDIR\Makefile.bt
610 Delete $INSTDIR\ascend.syn
611 RMDir /r $INSTDIR\models
612 Delete $INSTDIR\solvers\qrslv_ascend.dll
613 Delete $INSTDIR\solvers\conopt_ascend.dll
614 Delete $INSTDIR\solvers\lrslv_ascend.dll
615 Delete $INSTDIR\solvers\cmslv_ascend.dll
616 Delete $INSTDIR\solvers\lsode_ascend.dll
617 Delete $INSTDIR\solvers\ida_ascend.dll
618 Delete $INSTDIR\solvers\dopri5_ascend.dll
619 RMDir $INSTDIR\solvers
620
621 ; Remove directories used
622
623 Delete $INSTDIR\uninstall.exe
624 RMDir $INSTDIR
625
626 SectionEnd
627
628 !include "dependencies.nsi"
629
630 !include "detect.nsi"
631
632 !include "ascendini.nsi"

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