5 Detection of external component locations
9 # This script contains the following functions:
11 # - SearchExternal, calls the functions:
16 # - MissingPrograms, (check if third-party programs are installed), uses:
20 # - FindDictionaries (finds installed spellcheck and thesaurus dictionaries)
23 # (test if an editor with syntax-highlighting for LaTeX-files is installed)
25 #--------------------------
27 Function SearchExternal
28 Call LaTeXActions # function from LaTeX.nsh
30 Call FindDictionaries # function from dictionaries.nsh
33 # ---------------------------------------
35 Function MissingPrograms
36 # check if third-party programs are installed
38 # test if Ghostscript is installed, check all cases:
40 # 2. 64bit Windows but 32bit Ghostscript
41 # 3. 64bit Windows and 64bit Ghostscript
48 EnumRegKey $1 HKLM "Software\GPL Ghostscript" $3
50 ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
51 StrCpy $0 "Software\GPL Ghostscript\$1"
52 ${if} $2 == "" # if nothing was found in the uninstall section
53 ReadRegStr $2 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
55 ${if} $2 == "" # if nothing was found in the uninstall section
56 DeleteRegKey HKLM "$0"
59 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
60 ${if} $GhostscriptPath != ""
61 StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
63 # there might be several versions installed and we want to use the newest one
71 ${andif} $GhostscriptPath == ""
73 # we have to assure that we only repeat once and not forever
80 # test if Python is installed
81 # only use an existing python when it is version 2.5 or newer because some
82 # older Compaq and Dell PCs were delivered with outdated Python interpreters
83 # Python 3.x was reported not to work with LyX properly, see
84 # http://www.lyx.org/trac/ticket/7143
85 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
86 ${if} $PythonPath == ""
87 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
89 ${if} $PythonPath == ""
90 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.7\InstallPath" ""
92 ${if} $PythonPath != ""
93 StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
94 StrCpy $DelPythonFiles "True"
97 # No test necessary for Acrobat or Adobe Reader because pdfview does this job
98 # each time it is called.
100 # test if a PostScript-viewer is installed, only check for GSview
103 # 2. 64bit Windows but 32bit GSview
104 # 3. 64bit Windows and 64bit GSview
108 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview64.exe" "Path"
111 # repeat for case 1. and 2.
113 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
116 # test if an editor with syntax-highlighting for LaTeX-files is installed
119 # test if an image editor is installed
120 StrCpy $ImageEditorPath ""
121 # first check for Gimp which is a 64bit application on x64 Windows
125 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-2_is1" "InstallLocation"
126 ${if} $ImageEditorPath != ""
127 StrCpy $ImageEditorPath "$ImageEditorPathbin" # add the bin folder
132 # check for Photoshop
133 ReadRegStr $0 HKLM "Software\Classes\Applications\Photoshop.exe\shell\open\command" ""
135 StrCpy $0 "$0" -20 # delete '\photoshop.exe" "%1"'
136 StrCpy $0 $0 "" 1 # remove the leading quote
137 ${if} $ImageEditorPath != ""
138 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
140 StrCpy $ImageEditorPath $0
144 # test if and where the BibTeX-editor JabRef is installed
145 ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
146 ${if} $PathBibTeXEditor == ""
147 ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
150 ${ifnot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
151 StrCpy $PathBibTeXEditor ""
152 StrCpy $JabRefInstalled == "No"
154 StrCpy $JabRefInstalled == "Yes"
157 # test if and where LilyPond is installed
158 ReadRegStr $LilyPondPath HKLM "Software\LilyPond" "Install_Dir"
159 ${if} $LilyPondPath != ""
160 StrCpy $LilyPondPath "$LilyPondPath\usr\bin" # add "\usr\bin"
163 # test if Inkscape is installed
164 ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
166 # test if Gnumeric is installed
167 ReadRegStr $0 HKLM "Software\Classes\Applications\gnumeric.exe\shell\Open\command" ""
169 StrCpy $0 $0 -18 # remove "gnumeric.exe" "%1""
170 StrCpy $0 $0 "" 1 # remove the leading quote
171 StrCpy $GnumericPath $0
176 # ---------------------------------------
179 # test if an editor with syntax-highlighting for LaTeX-files is installed
181 # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
182 StrCpy $EditorPath ""
184 # check for jEdit which is a 64bit application on x64 Windows
188 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
189 ${if} $EditorPath != ""
190 StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
196 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
198 StrCpy $0 $0 -1 # remove the "\"
199 StrCpy $EditorPath "$EditorPath;$0"
204 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
206 StrCpy $0 $0 -1 # remove the "\"
207 StrCpy $EditorPath "$EditorPath;$0"
210 # check for Vim which is a 64bit application on x64 Windows
215 ReadRegStr $0 HKLM "Software\Vim\Gvim" "path"
217 StrCpy $0 $0 -9 # remove "\gvim.exe"
218 StrCpy $EditorPath "$EditorPath;$0"
222 # check for TeXnicCenter which can be a 64bit application on x64 Windows
227 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
229 StrCpy $0 $0 -1 # remove the "\"
230 StrCpy $EditorPath "$EditorPath;$0"
233 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
235 StrCpy $0 $0 -1 # remove the "\"
236 StrCpy $EditorPath "$EditorPath;$0"
243 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt 7" "InstallLocation"
245 StrCpy $EditorPath "$EditorPath;$0"