locate local MiKTeX root and install dvipost

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24074 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Joost Verburg 2008-03-31 15:31:09 +00:00
parent 0e1ada7b72
commit 6fa7502129
7 changed files with 47 additions and 7 deletions

View File

@ -49,6 +49,7 @@ Standard header files, shared variables
# Variables
Var PathLaTeX
Var PathLaTeXLocal
Var PathImageMagick
Var PathGhostscript

View File

@ -15,7 +15,7 @@ FunctionEnd
#--------------------------------
# MiKTeX
Var ProcessReturn
Var ReportReturn
Var CommandLineOutput
Var LastChar
Var PathLength
@ -26,10 +26,11 @@ Var PathLength
# Works for version 2.5 and later
nsExec::ExecToStack "initexmf.exe --report"
Pop $ProcessReturn
Pop $ReportReturn
Pop $CommandLineOutput
${WordFind2X} $CommandLineOutput "BinDir: " "$\r" "+1" $PathLaTeX
${WordFind2X} $CommandLineOutput "CommonData: " "$\r" "+1" $PathLaTeXLocal # Local root
!macroend
@ -38,16 +39,22 @@ Var PathLength
ReadRegStr $PathLaTeX ${ROOTKEY} "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
${If} $PathLaTeX != ""
StrCpy $LastChar $PathLaTeX 1 -1
StrCpy $LastChar $PathLaTeX 1 -1
${If} $LastChar == "\"
# Trim backslash
StrLen $PathLength $PathLaTeX
IntOp $PathLength $PathLength - 1
StrCpy $PathLaTeX $PathLaTeX $PathLength
${EndIf}
StrCpy $PathLaTeX "$PathLaTeX\miktex\bin"
#Local root
ReadRegStr $PathLaTeXLocal ${ROOTKEY} "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Local Root"
${EndIf}
!macroend
Function SearchLaTeX
@ -65,7 +72,7 @@ Function SearchLaTeX
${EndIf}
${IfNot} ${FileExists} "$PathLaTeX\${BIN_LATEX}"
StrCpy $PathLatex ""
StrCpy $PathLateX ""
${EndIf}
FunctionEnd

View File

@ -71,6 +71,12 @@ Lists of files to include in the installer
!macroend
!macro FileListDvipostBin COMMAND DIRECTORY
${FILE}pplatex.exe"
!macroend
!macro FileListPDFToolsBin COMMAND DIRECTORY
${FILE}pdfopen.exe"

View File

@ -55,9 +55,9 @@ Licence details for all installer scripts can be found in the file COPYING
#--------------------------------
# Setup
!include setup\configure.nsh
!include setup\install.nsh
!include setup\uninstall.nsh
!include setup\configure.nsh
#--------------------------------
# User interface (wizard pages)

View File

@ -49,6 +49,8 @@ SetCompressor /SOLID lzma
!define FILES_NETPBM "${FILES_DEPS}\netpbm"
!define FILES_DTL "${FILES_DEPS}\dtl"
!define FILES_AIKSAURUS "${FILES_DEPS}\aiksaurus\"
!define FILES_DVIPOST "${FILES_DEPS}\dvipost"
!define FILES_DVIPOST_PKG "${FILES_DVIPOST}"
!define FILES_PDFTOOLS "${FILES_DEPS}\pdftools"
!define FILES_QT "${FILES_DEPS}\qt-4"

View File

@ -115,6 +115,29 @@ Section -Configure
SectionEnd
#--------------------------------
# dvipost package
Var UpdateFNDBReturn
Section -dvipost
# Install package in local root
${if} $PathLaTeXLocal != ""
SetOutPath "$PathLaTeXLocal\tex\latex\dvipost"
File "${FILES_DVIPOST_PKG}\dvipost.sty"
${endif}
# Update file name database
${if} $PathLaTeX != ""
nsExec::Exec '"$PathLaTeX\initexmf.exe" --update-fndb'
Pop $UpdateFNDBReturn # Return value
${endif}
SectionEnd
#--------------------------------
# Desktop shortcut

View File

@ -35,6 +35,7 @@ Section -ProgramFiles SecProgramFiles
!insertmacro FileListNetpbmBin File "${FILES_NETPBM}\"
!insertmacro FileListDTLBin File "${FILES_DTL}\"
!insertmacro FileListDvipostBin File "${FILES_DVIPOST}\"
!insertmacro FileListPDFViewBin File "${FILES_PDFVIEW}\"
!insertmacro FileListPDFToolsBin File "${FILES_PDFTOOLS}\"