5 Detection of external component locations
9 Function SearchExternal
11 Call SearchBibTeXEditor
14 #--------------------------------
20 !macro SEARCH_MIKTEX25
22 # Search location of MiKTeX installation using initexmf
23 # Works for version 2.5 and later
25 nsExec::ExecToStack "initexmf.exe --report"
27 Pop $CommandLineOutput
30 ${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "E+1" $PathLaTeX
33 ${WordFind2X} $CommandLineOutput "CommonInstall: " "$\r" "E+1" $PathLaTeX
37 StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
42 ${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "E+1" $PathLaTeX
47 ${If} $PathLatex == ""
49 ${WordFind2X} $CommandLineOutput "CommonInstall: " "$\r" "E+1" $PathLaTeX
53 StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
57 ${If} $PathLatex == ""
59 ${WordFind2X} $CommandLineOutput "UserInstall: " "$\r" "E+1" $PathLaTeX
63 StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
70 ${WordFind2X} $CommandLineOutput "CommonData: " "$\r" "E+1" $PathLaTeXLocal
72 StrCpy $PathLaTeXLocal ""
75 ${If} $PathLatex == ""
77 ${WordFind2X} $CommandLineOutput "UserData: " "$\r" "E+1" $PathLaTeXLocal
79 StrCpy $PathLaTeXLocal ""
87 # Search where MikTeX is installed
89 !insertmacro SEARCH_MIKTEX25
91 ${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
97 #--------------------------------
100 Function SearchBibTeXEditor
102 # Search where JabRef is installed
103 ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
105 ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
106 ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
109 ${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
110 StrCpy $PathBibTeXEditor ""