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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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