mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
updated MiKTeX detection
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37664 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
05ec5c321a
commit
cc7c0b83f8
@ -9,12 +9,6 @@ Detection of external component locations
|
||||
Function SearchExternal
|
||||
Call SearchLaTeX
|
||||
Call SearchBibTeXEditor
|
||||
!ifndef BUNDLE_IMAGEMAGICK
|
||||
Call SearchImageMagick
|
||||
!endif
|
||||
!ifndef BUNDLE_GHOSTSCRIPT
|
||||
Call SearchGhostscript
|
||||
!endif
|
||||
FunctionEnd
|
||||
|
||||
#--------------------------------
|
||||
@ -22,8 +16,6 @@ FunctionEnd
|
||||
|
||||
Var ReportReturn
|
||||
Var CommandLineOutput
|
||||
Var LastChar
|
||||
Var PathLength
|
||||
|
||||
!macro SEARCH_MIKTEX25
|
||||
|
||||
@ -34,32 +26,60 @@ Var PathLength
|
||||
Pop $ReportReturn
|
||||
Pop $CommandLineOutput
|
||||
|
||||
${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "+1" $PathLaTeX
|
||||
${WordFind2X} $CommandLineOutput "CommonData: " "$\r" "+1" $PathLaTeXLocal # Local root
|
||||
|
||||
!macroend
|
||||
|
||||
!macro SEARCH_MIKTEX24 ROOTKEY
|
||||
|
||||
ReadRegStr $PathLaTeX ${ROOTKEY} "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
|
||||
|
||||
${If} $PathLaTeX != ""
|
||||
StrCpy $LastChar $PathLaTeX 1 -1
|
||||
|
||||
${If} $LastChar == "\"
|
||||
# Trim backslash
|
||||
StrLen $PathLength $PathLaTeX
|
||||
IntOp $PathLength $PathLength - 1
|
||||
StrCpy $PathLaTeX $PathLaTeX $PathLength
|
||||
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"
|
||||
${EndIf}
|
||||
|
||||
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
||||
|
||||
#Local root
|
||||
ReadRegStr $PathLaTeXLocal ${ROOTKEY} "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Local Root"
|
||||
|
||||
${EndIf}
|
||||
|
||||
|
||||
ClearErrors
|
||||
${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "E+1" $PathLaTeX
|
||||
${If} ${Errors}
|
||||
StrCpy $PathLaTeX ""
|
||||
${EndIf}
|
||||
|
||||
${If} $PathLatex == ""
|
||||
ClearErrors
|
||||
${WordFind2X} $CommandLineOutput "CommonInstall: " "$\r" "E+1" $PathLaTeX
|
||||
${If} ${Errors}
|
||||
StrCpy $PathLaTeX ""
|
||||
${Else}
|
||||
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
${If} $PathLatex == ""
|
||||
ClearErrors
|
||||
${WordFind2X} $CommandLineOutput "UserInstall: " "$\r" "E+1" $PathLaTeX
|
||||
${If} ${Errors}
|
||||
StrCpy $PathLaTeX ""
|
||||
${Else}
|
||||
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
# Local root
|
||||
|
||||
ClearErrors
|
||||
${WordFind2X} $CommandLineOutput "CommonData: " "$\r" "E+1" $PathLaTeXLocal
|
||||
${If} ${Errors}
|
||||
StrCpy $PathLaTeXLocal ""
|
||||
${EndIf}
|
||||
|
||||
${If} $PathLatex == ""
|
||||
ClearErrors
|
||||
${WordFind2X} $CommandLineOutput "UserData: " "$\r" "E+1" $PathLaTeXLocal
|
||||
${If} ${Errors}
|
||||
StrCpy $PathLaTeXLocal ""
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
!macroend
|
||||
|
||||
Function SearchLaTeX
|
||||
@ -67,14 +87,6 @@ Function SearchLaTeX
|
||||
# Search where MikTeX is installed
|
||||
|
||||
!insertmacro SEARCH_MIKTEX25
|
||||
|
||||
${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
|
||||
!insertmacro SEARCH_MIKTEX24 HKCU
|
||||
${EndIf}
|
||||
|
||||
${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
|
||||
!insertmacro SEARCH_MIKTEX24 HKLM
|
||||
${EndIf}
|
||||
|
||||
${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
|
||||
StrCpy $PathLateX ""
|
||||
@ -82,100 +94,6 @@ Function SearchLaTeX
|
||||
|
||||
FunctionEnd
|
||||
|
||||
#--------------------------------
|
||||
# Ghostscript
|
||||
|
||||
!ifndef BUNDLE_GHOSTSCRIPT
|
||||
|
||||
!insertmacro GetParent
|
||||
!insertmacro VersionCompare
|
||||
|
||||
Var Counter
|
||||
Var EnumReturn
|
||||
Var CompareReturn
|
||||
Var AFPLVersion
|
||||
Var GPLVersion
|
||||
|
||||
Function SearchGhostscript
|
||||
|
||||
# Search where Ghostscript is installed
|
||||
|
||||
# Find the latest version of AFPL Ghostscript installed
|
||||
|
||||
StrCpy $Counter 0
|
||||
|
||||
${do}
|
||||
|
||||
EnumRegKey $EnumReturn HKLM "Software\AFPL Ghostscript" $Counter
|
||||
|
||||
${If} $EnumReturn != ""
|
||||
${VersionCompare} $EnumReturn $AFPLVersion $CompareReturn
|
||||
${If} $CompareReturn == "1"
|
||||
StrCpy $AFPLVersion $EnumReturn
|
||||
${EndIf}
|
||||
IntOp $Counter $Counter + 1
|
||||
${EndIf}
|
||||
|
||||
${loopuntil} $EnumReturn == ""
|
||||
|
||||
# The same for GPL Ghostscript
|
||||
|
||||
StrCpy $Counter 0
|
||||
|
||||
${do}
|
||||
|
||||
EnumRegKey $EnumReturn HKLM "Software\GPL Ghostscript" $Counter
|
||||
|
||||
${If} $EnumReturn != ""
|
||||
${VersionCompare} $EnumReturn $GPLVersion $CompareReturn
|
||||
${If} $CompareReturn == "1"
|
||||
StrCpy $GPLVersion $EnumReturn
|
||||
${EndIf}
|
||||
IntOp $Counter $Counter + 1
|
||||
${EndIf}
|
||||
|
||||
${loopuntil} $EnumReturn == ""
|
||||
|
||||
# Take the latest one
|
||||
${VersionCompare} $AFPLVersion $GPLVersion $CompareReturn
|
||||
|
||||
${If} $CompareReturn = 1
|
||||
# AFPL is newer
|
||||
ReadRegStr $PathGhostscript HKLM "Software\AFPL Ghostscript\$R3" "GS_DLL"
|
||||
${Else}
|
||||
# GPL is newer or equal
|
||||
ReadRegStr $PathGhostscript HKLM "Software\GPL Ghostscript\$R4" "GS_DLL"
|
||||
${EndIf}
|
||||
|
||||
# Trim the DLL filename to get the path
|
||||
${GetParent} $PathGhostscript $PathGhostscript
|
||||
|
||||
${IfNot} ${FileExists} "$PathGhostscript\${BIN_GHOSTSCRIPT}"
|
||||
StrCpy $PathGhostscript ""
|
||||
${EndIf}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
#--------------------------------
|
||||
# ImageMagick
|
||||
|
||||
!ifndef BUNDLE_IMAGEMAGICK
|
||||
|
||||
Function SearchImageMagick
|
||||
|
||||
# Search where ImageMagick is installed
|
||||
ReadRegStr $PathImageMagick HKLM "Software\ImageMagick\Current" "BinPath"
|
||||
|
||||
${IfNot} ${FileExists} "$PathImageMagick\${BIN_IMAGEMAGICK}"
|
||||
StrCpy $PathImageMagick ""
|
||||
${EndIf}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
#--------------------------------
|
||||
# JabRef
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user