5 Detection of external component locations
9 # This script contains the following functions:
11 # - SearchExternal, calls the functions:
15 # - MissingPrograms, (check if third-party programs are installed), uses:
20 # (test if an editor with syntax-highlighting for LaTeX-files is installed)
22 #--------------------------
25 #Var CommandLineOutput
27 Function SearchExternal
28 Call LaTeXActions # function from LaTeX.nsh
32 # ---------------------------------------
34 Function MissingPrograms
35 # check if third-party programs are installed
37 # initialize variable, is later set to True when a program was not found
38 ${if} $MissedProg != "True" # is already True when LaTeX is missing
39 StrCpy $MissedProg "False"
42 # test if Ghostscript is installed
44 EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
46 EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
53 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
54 StrCpy $0 "Software\GPL Ghostscript\$1"
56 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName"
57 StrCpy $0 "Software\AFPL Ghostscript\$1"
59 ${if} $3 == "" # if nothing was found in the uninstall section
60 ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
62 ${if} $3 == "" # if nothing was found in the uninstall section
63 DeleteRegKey HKLM "$0"
66 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
67 ${if} $GhostscriptPath != ""
68 StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
70 StrCpy $MissedProg "True"
74 StrCpy $GhostscriptPath ""
75 StrCpy $MissedProg "True"
78 # test if Imagemagick is installed
79 #ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
80 #${if} $ImageMagickPath == ""
81 # StrCpy $MissedProg "True"
84 # test if Python is installed
85 # only use an existing python when it is version 2.5 or newer because some
86 # older Compaq and Dell PCs were delivered with outdated Python interpreters
87 # Python 3.x was reported not to work with LyX properly, see
88 # http://www.lyx.org/trac/ticket/7143
89 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
90 ${if} $PythonPath == ""
91 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
93 ${if} $PythonPath == ""
94 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.7\InstallPath" ""
96 ${if} $PythonPath != ""
97 StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
98 StrCpy $DelPythonFiles "True"
101 # test if a PostScript-viewer is installed, only check for GSview32
103 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
105 # test if an editor with syntax-highlighting for LaTeX-files is installed
108 # test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
109 StrCpy $ImageEditorPath ""
110 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
111 ${if} $ImageEditorPath != ""
112 StrCpy $ImageEditorPath "$ImageEditorPath" -13 # delete "\gimp-2.x.exe"
114 # check for Photoshop
115 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
117 StrCpy $0 "$0" -1 # delete the last "\"
118 ${if} $ImageEditorPath != ""
119 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
121 StrCpy $ImageEditorPath $0
125 # test if and where the BibTeX-editor JabRef is installed
126 ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
127 ${if} $PathBibTeXEditor == ""
128 ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
131 ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
132 StrCpy $PathBibTeXEditor ""
133 StrCpy $JabRefInstalled == "No"
135 StrCpy $JabRefInstalled == "Yes"
138 # test if Inkscape is installed
139 ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
141 # test if metafile2eps is installed
142 ReadRegStr $WMFPath HKLM "Software\Microsoft\Windows NT\CurrentVersion\Print\Printers\Metafile to EPS Converter" "Name"
146 # ---------------------------------------
149 # test if an editor with syntax-highlighting for LaTeX-files is installed
151 # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
152 StrCpy $EditorPath ""
155 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
156 ${if} $EditorPath != ""
157 StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
161 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
164 StrCpy $EditorPath "$EditorPath;$0"
168 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
171 StrCpy $EditorPath "$EditorPath;$0"
175 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
178 StrCpy $EditorPath "$EditorPath;$0"
180 # check for Crimson Editor
182 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Crimson Editor" "UninstallString"
184 StrCpy $0 $0 -14 # remove "\uninstall.exe"
185 StrCpy $EditorPath "$EditorPath;$0"
189 ReadRegStr $0 HKLM "Software\Classes\Applications\gvim.exe\shell\edit\command" ""
191 StrCpy $0 $0 -13 # remove "gvim.exe "%1""
192 StrCpy $EditorPath "$EditorPath;$0"
196 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0" "UninstallString"
198 StrCpy $0 $0 -18 # remove "\uninstall-gui.exe"
199 StrCpy $EditorPath "$EditorPath;$0"
201 # check for TeXnicCenter
203 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "Inno Setup: App Path"
205 StrCpy $EditorPath "$EditorPath;$0"
207 # check for LaTeXEditor
209 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
211 StrCpy $EditorPath "$EditorPath;$0"
215 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
218 StrCpy $EditorPath "$EditorPath;$0"
222 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LEd_is1" "InstallLocation"
225 StrCpy $EditorPath "$EditorPath;$0"
229 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
231 StrCpy $0 $0 -11 # remove "\wintex.exe"
232 StrCpy $EditorPath "$EditorPath;$0"