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

Contents of /trunk/nsis/installer.nsi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1616 - (show annotations) (download)
Mon Sep 3 14:05:44 2007 UTC (14 years, 11 months ago) by jpye
File size: 18787 byte(s)
Added default ASCENDLIBRARY and ASCENDSOLVERS fetched on Windows from the Registry.
Updated installer to set these registry values at install time.
In packages.c, output to say what the default values are found to be.
Remove some redundant output in 'ascend' script.
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
252 SetOutPath $INSTDIR
253 ;File "Makefile.bt"
254 File "..\tools\textpad\ascend.syn"
255
256 ${If} ${FileExists} "$APPDATA\.ascend.ini"
257 StrCpy $ASCENDINIFOUND "1"
258 ${Else}
259 ; Set 'librarypath' in .ascend.ini
260 WriteINIstr $APPDATA\.ascend.ini Directories librarypath "$DOCUMENTS\ascdata;$INSTDIR\models"
261 ${EndIf}
262
263 ; Write the installation path into the registry
264 WriteRegStr HKLM SOFTWARE\ASCEND "Install_Dir" "$INSTDIR"
265
266 ; Write the uninstall keys for Windows
267 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "DisplayName" "ASCEND Simulation Environment"
268 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "UninstallString" '"$INSTDIR\uninstall.exe"'
269 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoModify" 1
270 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND" "NoRepair" 1
271 WriteUninstaller "uninstall.exe"
272
273 ; Write file locations to the registry for access from ascend-config
274 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_LIB" "$INSTDIR"
275 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_BIN" "$INSTDIR"
276 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_INCLUDE" "$INSTDIR\include"
277 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_ASCDATA" "$INSTDIR"
278 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_MODELS" "$INSTDIR\models"
279 WriteRegStr HKLM SOFTWARE\ASCEND "INSTALL_SOLVERS" "$INSTDIR\solvers"
280 WriteRegStr HKLM SOFTWARE\ASCEND "GTKLIBS" "$GTKPATH"
281
282 ; Write default values of ASCENDLIBRARY and ASCENDSOLVERS (user can override with env vars)
283 WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDLIBRARY" "$INSTDIR\models"
284 WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDSOLVERS" "$INSTDIR\solvers"
285
286 ; Create 'ascend.bat' batch file for launching the PyGTK GUI.
287 ClearErrors
288 FileOpen $0 $INSTDIR\ascend.bat w
289 ${If} ${Errors}
290 MessageBox MB_OK "The 'ascend.bat' file was not installed properly; problems writing to that file."
291 ${Else}
292 FileWrite $0 "@echo off"
293 FileWriteByte $0 "13"
294 FileWriteByte $0 "10"
295 FileWrite $0 "set PATH=$PATH"
296 FileWriteByte $0 "13"
297 FileWriteByte $0 "10"
298 FileWrite $0 "cd "
299 FileWrite $0 $INSTDIR
300 FileWriteByte $0 "13"
301 FileWriteByte $0 "10"
302 FileWrite $0 "$PYPATH\python "
303 FileWriteByte $0 "34"
304 FileWrite $0 "$INSTDIR\ascend"
305 FileWriteByte $0 "34"
306 FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
307 FileWriteByte $0 "13"
308 FileWriteByte $0 "10"
309 FileClose $0
310 ${EndIf}
311
312 ; Create 'ascend-config.bat' batch file for launching the python script 'ascend-config'.
313 ClearErrors
314 FileOpen $0 $INSTDIR\ascend-config.bat w
315 ${If} ${Errors}
316 MessageBox MB_OK "The 'ascend-config.bat' file was not installed properly; problems writing to that file."
317 ${Else}
318 FileWrite $0 "@echo off"
319 FileWriteByte $0 "13"
320 FileWriteByte $0 "10"
321 FileWrite $0 "set PATH=$PATH"
322 FileWriteByte $0 "13"
323 FileWriteByte $0 "10"
324 FileWrite $0 "cd "
325 FileWrite $0 $INSTDIR
326 FileWriteByte $0 "13"
327 FileWriteByte $0 "10"
328 FileWrite $0 "$PYPATH\python "
329 FileWriteByte $0 "34"
330 FileWrite $0 "$INSTDIR\ascend-config"
331 FileWriteByte $0 "34"
332 FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
333 FileWriteByte $0 "13"
334 FileWriteByte $0 "10"
335 FileClose $0
336 ${EndIf}
337
338 Return
339 SectionEnd
340
341 ;--------------------------------
342
343 Section "PyGTK GUI"
344 ; Check the dependencies of the PyGTK GUI before proceding...
345 ${If} $PYOK == 'NOK'
346 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)"
347 ${ElseIf} $GTKOK == 'NOK'
348 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)"
349 ${ElseIf} $GLADEOK == 'NOK'
350 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."
351 ${ElseIf} $PYGTKOK == "NOK"
352 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)"
353 ${ElseIf} $PYCAIROOK == "NOK"
354 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)"
355 ${ElseIf} $PYGOBJECTOK == "NOK"
356 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)"
357 ${Else}
358 ;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH"
359
360 DetailPrint "--- PYTHON INTERFACE ---"
361
362 ; Set output path to the installation directory.
363 SetOutPath $INSTDIR
364
365 ; Python interface
366 File /nonfatal "..\pygtk\_ascpy.pyd"
367 File "..\pygtk\*.py"
368 File "..\pygtk\ascend"
369 File "..\pygtk\glade\ascend-doc.ico"
370
371 SetOutPath $INSTDIR\glade
372 File "..\pygtk\glade\*.glade"
373 File "..\pygtk\glade\*.png"
374 File "..\pygtk\glade\*.svg"
375
376 StrCpy $PYINSTALLED "1"
377 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1
378
379 ;---- file association ----
380
381 ; back up old value of .a4c file association
382 ReadRegStr $1 HKCR ".a4c" ""
383 StrCmp $1 "" a4cnobkp
384 StrCmp $1 "ASCEND.model" a4cnobkp
385
386 ; Remember the old file association if necessary
387 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4C" $1
388
389 a4cnobkp:
390 WriteRegStr HKCR ".a4c" "" "ASCEND.model"
391
392 ; back up old value of .a4c file association
393 ReadRegStr $1 HKCR ".a4l" ""
394 StrCmp $1 "" a4lnobkp
395 StrCmp $1 "ASCEND.model" a4lnobkp
396
397 ; Remember the old file association if necessary
398 WriteRegStr HKLM "SOFTWARE\ASCEND" "BackupAssocA4L" $1
399
400 a4lnobkp:
401 WriteRegStr HKCR ".a4l" "" "ASCEND.model"
402
403 ; So, what does an A4L or A4C file actually do?
404
405 ReadRegStr $0 HKCR "ASCEND.model" ""
406 StrCmp $0 "" 0 a4cskip
407
408 WriteRegStr HKCR "ASCEND.model" "" "ASCEND model file"
409 WriteRegStr HKCR "ASCEND.model\shell" "" "open"
410 WriteRegStr HKCR "ASCEND.model\DefaultIcon" "" "$INSTDIR\ascend-doc.ico"
411
412 a4cskip:
413 WriteRegStr HKCR "ASCEND.model\shell\open\command" "" '$PYPATH\pythonw "$INSTDIR\ascend" "%1"'
414
415 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
416
417 ${EndIf}
418 Return
419
420 SectionEnd
421
422 ;---------------------------------
423
424 Section "Tcl/Tk GUI"
425
426 ${If} $TCLOK != 'OK'
427 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)"
428 ${Else}
429 DetailPrint "--- TCL/TK INTERFACE ---"
430 SetOutPath $INSTDIR\tcltk
431 File /r /x .svn "..\tcltk\TK\*"
432 SetOutPath $INSTDIR
433 File "..\tcltk\generic\interface\ascendtcl.dll"
434 File "..\tcltk\generic\interface\ascend4.exe"
435
436 StrCpy $TCLINSTALLED "1"
437 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "TclTk" 1
438
439 ${EndIf}
440
441 SectionEnd
442
443 ;---------------------------------
444
445 Section "Documentation"
446 SetOutPath $INSTDIR
447 File "..\doc\book.pdf"
448 StrCpy $PDFINSTALLED "1"
449 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "PDF" 1
450 SectionEnd
451
452 ; Optional section (can be disabled by the user)
453 Section "Start Menu Shortcuts"
454
455 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "StartMenu" 1
456
457 CreateDirectory "$SMPROGRAMS\ASCEND"
458
459 ; Link to PyGTK GUI
460 ${If} $PYINSTALLED == "1"
461 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND.lnk" "$PYPATH\pythonw.exe" '"$INSTDIR\ascend"' "$INSTDIR\ascend.ico" 0
462 ${EndIf}
463
464 ; Model library shortcut
465 CreateShortCut "$SMPROGRAMS\ASCEND\Model Library.lnk" "$INSTDIR\models" "" "$INSTDIR\models" 0
466
467 ; Link to Tcl/Tk GUI
468 ${If} $TCLINSTALLED == "1"
469 CreateShortCut "$SMPROGRAMS\ASCEND\ASCEND Tcl/Tk.lnk" "$INSTDIR\ascend4.exe" "" "$INSTDIR\ascend4.exe" 0
470 ${EndIf}
471
472 ; Documentation
473 ${If} $PDFINSTALLED == "1"
474 CreateShortCut "$SMPROGRAMS\ASCEND\User's Manual.lnk" "$INSTDIR\book.pdf" "" "$INSTDIR\book.pdf" 0
475 ${EndIf}
476
477 ; Information files
478 CreateShortCut "$SMPROGRAMS\ASCEND\LICENSE.lnk" "$INSTDIR\LICENSE.txt" '' "$INSTDIR\LICENSE.txt" 0
479 CreateShortCut "$SMPROGRAMS\ASCEND\CHANGELOG.lnk" "$INSTDIR\CHANGELOG.txt" '' "$INSTDIR\CHANGELOG.txt" 0
480 CreateShortCut "$SMPROGRAMS\ASCEND\README.lnk" "$INSTDIR\README-windows.txt" '' "$INSTDIR\README-windows.txt" 0
481
482 CreateShortCut "$SMPROGRAMS\ASCEND\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
483
484 SectionEnd
485
486 ;------------------------------------------------------------------
487 ; HEADER FILES for DEVELOPERS
488
489 Section /o "Header files (for developers)"
490 WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1
491
492 SetOutPath $INSTDIR\include
493 File /r /x .svn "..\base\generic\*.h"
494
495 SetOutPath $INSTDIR
496 SectionEnd
497
498 ;------------------------------------------------------------------
499 ; UNINSTALLER
500
501 Section "Uninstall"
502
503 ;--- python components ---
504
505 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"
506 IntCmp $0 0 unnopython unpython
507
508 unpython:
509 DetailPrint "--- REMOVING PYTHON COMPONENTS ---"
510 Delete $INSTDIR\_ascpy.pyd
511 Delete $INSTDIR\ascend
512 Delete $INSTDIR\*.py
513 Delete $INSTDIR\*.pyc
514 Delete $INSTDIR\glade\*.glade
515 Delete $INSTDIR\glade\*.png
516 Delete $INSTDIR\glade\*.svg
517 RmDir $INSTDIR\glade
518 Delete $INSTDIR\ascend-doc.ico
519
520 ;--- file association (for Python GUI) ---
521
522 DetailPrint "--- REMOVING FILE ASSOCIATION ---"
523 ;start of restore script
524 ReadRegStr $1 HKCR ".a4c" ""
525 ${If} $1 == "ASCEND.model"
526 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
527 ${If} $1 == ""
528 ; nothing to restore: delete it
529 DeleteRegKey HKCR ".a4c"
530 ${Else}
531 WriteRegStr HKCR ".a4c" "" $1
532 ${EndIf}
533 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
534 ${EndIf}
535
536 ReadRegStr $1 HKCR ".a4l" ""
537 ${If} $1 == "ASCEND.model"
538 ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
539 ${If} $1 == ""
540 ; nothing to restore: delete it
541 DeleteRegKey HKCR ".a4l"
542 ${Else}
543 WriteRegStr HKCR ".a4l" "" $1
544 ${EndIf}
545 DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
546 ${EndIf}
547
548 DeleteRegKey HKCR "ASCEND.model" ;Delete key with association settings
549
550 System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
551 ;rest of script
552
553 unnopython:
554
555 ;--- tcl/tk components ---
556
557 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"
558 ${If} $0 != 0
559 DetailPrint "--- REMOVING TCL/TK COMPONENTS ---"
560 Delete $INSTDIR\ascendtcl.dll
561 Delete $INSTDIR\ascend4.exe
562 RMDir /r $INSTDIR\tcltk
563 ${EndIf}
564
565 ;--- documentation ---
566
567 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "PDF"
568 ${If} $0 != 0
569 DetailPrint "--- REMOVING DOCUMENTATION ---"
570 Delete $INSTDIR\book.pdf
571 ${EndIf}
572
573 ;--- header files ---
574
575 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "HeaderFiles"
576 ${If} $0 != 0
577 DetailPrint "--- REMOVING HEADER FILES ---"
578 RMDir /r $INSTDIR\include
579 ${EndIf}
580
581 ;--- start menu ---
582
583 ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "StartMenu"
584 ${If} $0 != 0
585 ; Remove shortcuts, if any
586 DetailPrint "--- REMOVING START MENU SHORTCUTS ---"
587 RmDir /r "$SMPROGRAMS\ASCEND"
588 ${EndIf}
589
590 ;--- common components ---
591
592 DetailPrint "--- REMOVING COMMON COMPONENTS ---"
593 ; Remove registry keys
594
595 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ASCEND"
596 DeleteRegKey HKLM "SOFTWARE\ASCEND"
597
598 ; Remove files and uninstaller
599
600 Delete $INSTDIR\ascend-config
601 Delete $INSTDIR\ascend-config.bat
602 Delete $INSTDIR\ascend.bat
603 Delete $INSTDIR\ascend.dll
604 Delete $INSTDIR\LICENSE.txt
605 Delete $INSTDIR\README-windows.txt
606 Delete $INSTDIR\CHANGELOG.txt
607 Delete $INSTDIR\ascend.ico
608 Delete $INSTDIR\Makefile.bt
609 Delete $INSTDIR\ascend.syn
610 RMDir /r $INSTDIR\models
611 Delete $INSTDIR\solvers\qrslv_ascend.dll
612 Delete $INSTDIR\solvers\conopt_ascend.dll
613 Delete $INSTDIR\solvers\lrslv_ascend.dll
614 Delete $INSTDIR\solvers\cmslv_ascend.dll
615 Delete $INSTDIR\solvers\lsode_ascend.dll
616 Delete $INSTDIR\solvers\ida_ascend.dll
617 RMDir $INSTDIR\solvers
618
619 ; Remove directories used
620
621 Delete $INSTDIR\uninstall.exe
622 RMDir $INSTDIR
623
624 SectionEnd
625
626 !include "dependencies.nsi"
627
628 !include "detect.nsi"
629
630 !include "ascendini.nsi"

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