diff --git a/development/Win32/packaging/installer/include/declarations.nsh b/development/Win32/packaging/installer/include/declarations.nsh index 594f8b1d6d..2ffe6c3a7a 100644 --- a/development/Win32/packaging/installer/include/declarations.nsh +++ b/development/Win32/packaging/installer/include/declarations.nsh @@ -49,6 +49,7 @@ Standard header files, shared variables # Variables Var PathLaTeX +Var PathLaTeXLocal Var PathImageMagick Var PathGhostscript diff --git a/development/Win32/packaging/installer/include/detection.nsh b/development/Win32/packaging/installer/include/detection.nsh index 740b7ae67b..dcecc23e48 100644 --- a/development/Win32/packaging/installer/include/detection.nsh +++ b/development/Win32/packaging/installer/include/detection.nsh @@ -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 diff --git a/development/Win32/packaging/installer/include/filelist.nsh b/development/Win32/packaging/installer/include/filelist.nsh index 0c84855593..2d3fcf5bcb 100644 --- a/development/Win32/packaging/installer/include/filelist.nsh +++ b/development/Win32/packaging/installer/include/filelist.nsh @@ -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" diff --git a/development/Win32/packaging/installer/lyx.nsi b/development/Win32/packaging/installer/lyx.nsi index 334c7b3116..d65487059d 100644 --- a/development/Win32/packaging/installer/lyx.nsi +++ b/development/Win32/packaging/installer/lyx.nsi @@ -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) diff --git a/development/Win32/packaging/installer/settings.nsh b/development/Win32/packaging/installer/settings.nsh index 2d7526a477..c5afcc37f6 100644 --- a/development/Win32/packaging/installer/settings.nsh +++ b/development/Win32/packaging/installer/settings.nsh @@ -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" diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh index 0d0ca74df8..559dac228e 100644 --- a/development/Win32/packaging/installer/setup/configure.nsh +++ b/development/Win32/packaging/installer/setup/configure.nsh @@ -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 diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index 57d83a1250..724bd78163 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -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}\"