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 #--------------------------
28 #Var CommandLineOutput
30 Function SearchExternal
31 Call LaTeXActions # function from LaTeX.nsh
33 Call FindDictionaries # function from dictionaries.nsh
36 # ---------------------------------------
38 Function MissingPrograms
39 # check if third-party programs are installed
41 # test if Ghostscript is installed, check all cases:
43 # 2. 64bit Windows but 32bit Ghostscript
44 # 3. 64bit Windows and 64bit Ghostscript
51 EnumRegKey $1 HKLM "Software\GPL Ghostscript" $3
53 ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
54 StrCpy $0 "Software\GPL Ghostscript\$1"
55 ${if} $2 == "" # if nothing was found in the uninstall section
56 ReadRegStr $2 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
58 ${if} $2 == "" # if nothing was found in the uninstall section
59 DeleteRegKey HKLM "$0"
62 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
63 ${if} $GhostscriptPath != ""
64 StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
66 # there might be several versions installed and we want to use the newest one
74 ${andif} $GhostscriptPath == ""
76 # we have to assure that we only repeat once and not forever
83 # test if Python is installed
84 # only use an existing python when it is version 2.5 or newer because some
85 # older Compaq and Dell PCs were delivered with outdated Python interpreters
86 # Python 3.x was reported not to work with LyX properly, see
87 # http://www.lyx.org/trac/ticket/7143
88 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
89 ${if} $PythonPath == ""
90 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
92 ${if} $PythonPath == ""
93 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.7\InstallPath" ""
95 ${if} $PythonPath != ""
96 StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
97 StrCpy $DelPythonFiles "True"
100 # No test necessary for Acrobat or Adobe Reader because pdfview does this job
101 # each time it is called.
103 # test if a PostScript-viewer is installed, only check for GSview
106 # 2. 64bit Windows but 32bit GSview
107 # 3. 64bit Windows and 64bit GSview
111 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview64.exe" "Path"
114 # repeat for case 1. and 2.
116 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
119 # test if an editor with syntax-highlighting for LaTeX-files is installed
122 # test if an image editor is installed
123 StrCpy $ImageEditorPath ""
124 # first check for Gimp which is a 64bit application on x64 Windows
128 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-2_is1" "InstallLocation"
129 ${if} $ImageEditorPath != ""
130 StrCpy $ImageEditorPath "$ImageEditorPathbin" # add the bin folder
135 # check for Photoshop
136 ReadRegStr $0 HKLM "Software\Classes\Applications\Photoshop.exe\shell\open\command" ""
138 StrCpy $0 "$0" -20 # delete '\photoshop.exe" "%1"'
139 StrCpy $0 $0 "" 1 # remove the leading quote
140 ${if} $ImageEditorPath != ""
141 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
143 StrCpy $ImageEditorPath $0
147 # test if and where the BibTeX-editor JabRef is installed
148 ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
149 ${if} $PathBibTeXEditor == ""
150 ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
153 ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
154 StrCpy $PathBibTeXEditor ""
155 StrCpy $JabRefInstalled == "No"
157 StrCpy $JabRefInstalled == "Yes"
160 # test if and where LilyPond is installed
161 ReadRegStr $LilyPondPath HKLM "Software\LilyPond" "Install_Dir"
162 ${if} $LilyPondPath != ""
163 StrCpy $LilyPondPath "$LilyPondPath\usr\bin" # add "\usr\bin"
166 # test if Inkscape is installed
167 ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
169 # test if Gnumeric is installed
170 ReadRegStr $0 HKLM "Software\Classes\Applications\gnumeric.exe\shell\Open\command" ""
172 StrCpy $0 $0 -18 # remove "gnumeric.exe" "%1""
173 StrCpy $0 $0 "" 1 # remove the leading quote
174 StrCpy $GnumericPath $0
179 # ---------------------------------------
182 # test if an editor with syntax-highlighting for LaTeX-files is installed
184 # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
185 StrCpy $EditorPath ""
187 # check for jEdit which is a 64bit application on x64 Windows
191 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
192 ${if} $EditorPath != ""
193 StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
199 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
201 StrCpy $0 $0 -1 # remove the "\"
202 StrCpy $EditorPath "$EditorPath;$0"
207 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
209 StrCpy $0 $0 -1 # remove the "\"
210 StrCpy $EditorPath "$EditorPath;$0"
213 # check for Vim which is a 64bit application on x64 Windows
218 ReadRegStr $0 HKLM "Software\Vim\Gvim" "path"
220 StrCpy $0 $0 -9 # remove "\gvim.exe"
221 StrCpy $EditorPath "$EditorPath;$0"
225 # check for TeXnicCenter which can be a 64bit application on x64 Windows
230 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
232 StrCpy $0 $0 -1 # remove the "\"
233 StrCpy $EditorPath "$EditorPath;$0"
236 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
238 StrCpy $0 $0 -1 # remove the "\"
239 StrCpy $EditorPath "$EditorPath;$0"
246 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt 7" "InstallLocation"
248 StrCpy $EditorPath "$EditorPath;$0"