2007-02-08 21:09:30 +00:00
|
|
|
/*
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
detection.nsh
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
Detection of external component locations
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
*/
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
Function SearchExternal
|
2007-02-08 21:09:30 +00:00
|
|
|
Call SearchLaTeX
|
2008-05-02 15:53:14 +00:00
|
|
|
Call SearchBibTeXEditor
|
2007-02-08 21:09:30 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
#--------------------------------
|
|
|
|
# MiKTeX
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-31 15:31:09 +00:00
|
|
|
Var ReportReturn
|
2008-03-30 21:37:53 +00:00
|
|
|
Var CommandLineOutput
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
!macro SEARCH_MIKTEX25
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Search location of MiKTeX installation using initexmf
|
|
|
|
# Works for version 2.5 and later
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
nsExec::ExecToStack "initexmf.exe --report"
|
2008-03-31 15:31:09 +00:00
|
|
|
Pop $ReportReturn
|
2008-03-30 21:37:53 +00:00
|
|
|
Pop $CommandLineOutput
|
2008-03-31 15:31:09 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "E+1" $PathLaTeX
|
|
|
|
${If} ${Errors}
|
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "CommonInstall: " "$\r" "E+1" $PathLaTeX
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
${Else}
|
|
|
|
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "E+1" $PathLaTeX
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeX ""
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
${If} $PathLatex == ""
|
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "CommonInstall: " "$\r" "E+1" $PathLaTeX
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
${Else}
|
|
|
|
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
|
|
|
${EndIf}
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
${If} $PathLatex == ""
|
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "UserInstall: " "$\r" "E+1" $PathLaTeX
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
${Else}
|
|
|
|
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
|
|
|
${EndIf}
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
# Local root
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "CommonData: " "$\r" "E+1" $PathLaTeXLocal
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeXLocal ""
|
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
${If} $PathLatex == ""
|
|
|
|
ClearErrors
|
|
|
|
${WordFind2X} $CommandLineOutput "UserData: " "$\r" "E+1" $PathLaTeXLocal
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $PathLaTeXLocal ""
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
!macroend
|
2008-05-02 15:53:14 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
Function SearchLaTeX
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
# Search where MikTeX is installed
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-02-14 19:57:24 +00:00
|
|
|
!insertmacro SEARCH_MIKTEX25
|
|
|
|
|
|
|
|
${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
|
|
|
|
StrCpy $PathLateX ""
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
FunctionEnd
|
2008-05-02 15:53:14 +00:00
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# JabRef
|
|
|
|
|
|
|
|
Function SearchBibTeXEditor
|
|
|
|
|
|
|
|
# Search where JabRef is installed
|
|
|
|
ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path"
|
|
|
|
|
|
|
|
${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
|
|
|
|
ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${IfNot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}"
|
|
|
|
StrCpy $PathBibTeXEditor ""
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
FunctionEnd
|