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
49 EnumRegKey $1 HKLM "Software\GPL Ghostscript" $3
51 ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
52 StrCpy $0 "Software\GPL Ghostscript\$1"
53 ${if} $2 == "" # if nothing was found in the uninstall section
54 ReadRegStr $2 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
56 ${if} $2 == "" # if nothing was found in the uninstall section
57 DeleteRegKey HKLM "$0"
60 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
61 ${if} $GhostscriptPath != ""
62 StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
64 # there might be several versions installed and we want to use the newest one
72 ${andif} $GhostscriptPath == ""
74 # we have to assure that we only repeat once and not forever
81 # test if Python is installed
82 # only use an existing python when it is version 2.5 or newer because some
83 # older Compaq and Dell PCs were delivered with outdated Python interpreters
84 # Python 3.x was reported not to work with LyX properly, see
85 # http://www.lyx.org/trac/ticket/7143
86 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
87 ${if} $PythonPath == ""
88 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
90 ${if} $PythonPath == ""
91 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.7\InstallPath" ""
93 ${if} $PythonPath != ""
94 StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
95 StrCpy $DelPythonFiles "True"
98 # No test necessary for Acrobat or Adobe Reader because pdfview does this job
99 # each time it is called.
101 # test if a PostScript-viewer is installed, only check for GSview
104 # 2. 64bit Windows but 32bit GSview
105 # 3. 64bit Windows and 64bit GSview
109 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview64.exe" "Path"
112 # repeat for case 1. and 2.
114 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
117 # test if an editor with syntax-highlighting for LaTeX-files is installed
120 # test if an image editor is installed
121 StrCpy $ImageEditorPath ""
122 # first check for Gimp which is a 64bit application on x64 Windows
126 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GIMP-2_is1" "InstallLocation"
127 ${if} $ImageEditorPath != ""
128 StrCpy $ImageEditorPath "$ImageEditorPathbin" # add the bin folder
133 # check for Photoshop
134 ReadRegStr $0 HKLM "Software\Classes\Applications\Photoshop.exe\shell\open\command" ""
136 StrCpy $0 "$0" -20 # delete '\photoshop.exe" "%1"'
137 StrCpy $0 $0 "" 1 # remove the leading quote
138 ${if} $ImageEditorPath != ""
139 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
141 StrCpy $ImageEditorPath $0
145 # test if and where the BibTeX-editor JabRef is installed
146 ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
147 ${if} $PathBibTeXEditor == ""
148 ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
151 ${ifnot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
152 StrCpy $PathBibTeXEditor ""
153 StrCpy $JabRefInstalled == "No"
155 StrCpy $JabRefInstalled == "Yes"
158 # test if and where LilyPond is installed
159 ReadRegStr $LilyPondPath HKLM "Software\LilyPond" "Install_Dir"
160 ${if} $LilyPondPath != ""
161 StrCpy $LilyPondPath "$LilyPondPath\usr\bin" # add "\usr\bin"
164 # test if Inkscape is installed
165 ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
167 # test if Gnumeric is installed
168 ReadRegStr $0 HKLM "Software\Classes\Applications\gnumeric.exe\shell\Open\command" ""
170 StrCpy $0 $0 -18 # remove "gnumeric.exe" "%1""
171 StrCpy $0 $0 "" 1 # remove the leading quote
172 StrCpy $GnumericPath $0
177 # ---------------------------------------
180 # test if an editor with syntax-highlighting for LaTeX-files is installed
182 # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
183 StrCpy $EditorPath ""
185 # check for jEdit which is a 64bit application on x64 Windows
189 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
190 ${if} $EditorPath != ""
191 StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
197 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
199 StrCpy $0 $0 -1 # remove the "\"
200 StrCpy $EditorPath "$EditorPath;$0"
205 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
207 StrCpy $0 $0 -1 # remove the "\"
208 StrCpy $EditorPath "$EditorPath;$0"
211 # check for Vim which is a 64bit application on x64 Windows
216 ReadRegStr $0 HKLM "Software\Vim\Gvim" "path"
218 StrCpy $0 $0 -9 # remove "\gvim.exe"
219 StrCpy $EditorPath "$EditorPath;$0"
223 # check for TeXnicCenter which can be a 64bit application on x64 Windows
228 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
230 StrCpy $0 $0 -1 # remove the "\"
231 StrCpy $EditorPath "$EditorPath;$0"
234 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
236 StrCpy $0 $0 -1 # remove the "\"
237 StrCpy $EditorPath "$EditorPath;$0"
244 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt 7" "InstallLocation"
246 StrCpy $EditorPath "$EditorPath;$0"