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

Annotation of /trunk/nsis/installer.nsi

Parent Directory Parent Directory | Revision Log Revision Log


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

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