From 77bb8b91a389b7df864743934b2a608921142ef4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Tue, 9 Feb 2016 00:31:57 +0100 Subject: [PATCH] Win installer: prepare for beta 1 - also add support to detect JabRef 3.x - also add support to detect Pandoc - some minor improvements --- .../Win32/packaging/installer/ChangeLog.txt | 2 + .../Win32/packaging/installer/Packages.txt | 73 ++++++++++--------- .../packaging/installer/include/LaTeX.nsh | 9 ++- .../packaging/installer/include/LyXUtils.nsh | 47 +++++++++++- .../packaging/installer/include/detection.nsh | 34 ++++++++- .../packaging/installer/include/init.nsh | 22 ++++-- .../packaging/installer/include/variables.nsh | 3 + .../Win32/packaging/installer/settings.nsh | 26 +++---- .../packaging/installer/setup/configure.nsh | 11 ++- .../packaging/installer/setup/install.nsh | 7 +- 10 files changed, 171 insertions(+), 63 deletions(-) diff --git a/development/Win32/packaging/installer/ChangeLog.txt b/development/Win32/packaging/installer/ChangeLog.txt index 2f74e218f4..2630bf41c5 100644 --- a/development/Win32/packaging/installer/ChangeLog.txt +++ b/development/Win32/packaging/installer/ChangeLog.txt @@ -1,5 +1,7 @@ Changelog for LyX.220-beta-1-1: - installs lyX 2.2.0 beta1 +- support for the document converter program Pandoc, see http://wiki.lyx.org/LyX/NewInLyX22#converters +- support for JabRef 3.x - updated thesaurus for Slovenian - updated spell-checker dictionaries for Portuguese (PT) and English (GB and US) - new Brazilian translation of the installer messages diff --git a/development/Win32/packaging/installer/Packages.txt b/development/Win32/packaging/installer/Packages.txt index 80c12b4a28..fe46a056f3 100644 --- a/development/Win32/packaging/installer/Packages.txt +++ b/development/Win32/packaging/installer/Packages.txt @@ -1,3 +1,4 @@ +unicode-data l3experimental l3kernel l3packages @@ -56,17 +57,18 @@ babel-turkish babel-ukrainian babel-vietnamese babel-welsh +beamerposter bibtopic booktabs braille breakurl cancel +caption chemgreek +chicago cjk covington csquotes -cyrillic -datetime endnotes enumitem environ @@ -75,8 +77,10 @@ eso-pic fancybox fancyhdr filehook -fmtcount +footmisc +forest framed +frankenstein greek-inputenc harvard hyphenat @@ -86,16 +90,18 @@ lettrine listings lithuanian genmisc +mathtools mhchem -chemgreek mongolian-babel miktex-hyph-mongolian +mslapa natbib units nomencl -polyglossia +paralist pdfcomment pdfpages +pgf prettyref preview refstyle @@ -105,9 +111,9 @@ sectionbox serbianc miktex-hyph-serbian setspace -shapepar soul splitindex +stmaryrd subfig tcolorbox thailatex @@ -116,34 +122,30 @@ turkmen ulem undertilde unicode-math -units url vntex +wallpaper wrapfig xargs xcolor xetex-def arydshln -binhex braket cancel -caption colortbl diagbox etoolbox fp -koma-script makecmds marginnote picinpar pict2e sidecap was -charter -garamondx -mathpazo bera +binhex ccfonts +charter classico cmbright concmath @@ -154,74 +156,85 @@ eulervm feyn fontaxes fourier +garamondx iwona kurier lh libertine lm-math luxi +mathdesign +mathpazo minion2newtx -mslapa newtx -stmaryrd symbol tex-gyre -tfrupee tipa txfonts -wasy zhmetrics ascii bbding ifsym marvosym textgreek +tfrupee txfonts +wasy wasysym a0poster aastex achemso aguplus +answers apa6 apacite apa arabtex beamer -beamerposter bigfoot +changebar changepage cite cleveref +comment ctex +datetime dinbrief dtk +ebgaramond elsarticle elsevier endfloat epsf +europasscv europecv extsizes fancyvrb filecontents -footmisc +fixme +fmtcount +fontawesome frletter g-brief harvard ieeetran ifmtarg +jsclasses kluwer +koma-script +lambda-lists lastpage +latex2html lettre lineno mciteplus +mdwtools memoir microtype moderncv ms mwcls paper -paralist -pgf placeins powerdot pst-grad @@ -232,28 +245,20 @@ sauerj savesym sciposter seminar +shapepar simplecv skak spie sttools +tabu textcase titlesec +todonotes +totpages tufte-latex tugboat type1cm ucs upquote -wallpaper xecjk -xifthen -acrotex -answers -chicago -ctablestack -frankenstein -jsclasses -lambda-lists -mathdesign -mathtools -pdfcrop -sansmathaccent \ No newline at end of file +xifthen \ No newline at end of file diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh b/development/Win32/packaging/installer/include/LaTeX.nsh index 7a0cef8187..cb3d80a80f 100644 --- a/development/Win32/packaging/installer/include/LaTeX.nsh +++ b/development/Win32/packaging/installer/include/LaTeX.nsh @@ -208,7 +208,14 @@ FunctionEnd ${if} $PathLaTeX == "" # launch MiKTeX's installer MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)" /SD IDOK - ExecWait ${MiKTeXInstall} + MessageBox MB_OK|MB_ICONINFORMATION "${MiKTeXInstall} --shared" + ${if} $MultiUser.Privileges != "Admin" + ${andif} $MultiUser.Privileges != "Power" + # call the non-admin version + ExecWait ${MiKTeXInstall} + ${else} + ExecWait "${MiKTeXInstall} --shared" + ${endif} # test if MiKTeX is installed Call LaTeXActions ${if} ${RunningX64} diff --git a/development/Win32/packaging/installer/include/LyXUtils.nsh b/development/Win32/packaging/installer/include/LyXUtils.nsh index 6fbbbc8e6b..f76c9c4572 100644 --- a/development/Win32/packaging/installer/include/LyXUtils.nsh +++ b/development/Win32/packaging/installer/include/LyXUtils.nsh @@ -7,6 +7,12 @@ # RevStrPointer # RevStrPoint # +# - PATHCheck (checks for a path in a semicolon separated path list like the PATH variable), uses: +# StrPointer +# StrPoint +# RevStrPointer +# RevStrPoint +# # - un.DelAppPathSub and UnAppPreSuff, # (delete the folder ~\Documents and Settings\username\Application Data\LyX for all users), uses: # un.GetParentA @@ -273,7 +279,7 @@ FunctionEnd Push $1 StrCpy $0 "" StrCpy $1 "" - FileOpen $0 "${Filepath}\${FileName}" r + FileOpen $0 "${FilePath}\${FileName}" r ${if} $0 = "" StrCpy $1 "False" ${Else} @@ -290,7 +296,7 @@ FunctionEnd Function LaTeXCheck # searches the string "$Search" in the string "$String" and extracts the path around it - # the extracted path is checked if the file "latex.exe" is in it + # it is checked if the file "latex.exe" exists in the extracted path StartCheck: StrLen $3 $String @@ -330,3 +336,40 @@ Function LaTeXCheck FunctionEnd +#------------------------------------------ + +!macro PATHCheck PathResult FileName + # searches the string "$Search" in the string "$String" and extracts the path around it + # it is checked if the given filename exists + + !define ID ${__LINE__} + StrLen $3 $String + Call StrPoint + ${if} $Pointer == "-1" # if nothing was found + StrCpy ${PathResult} "False" + Goto EndPATHCheck_${ID} + ${endif} + IntOp $3 $3 - $Pointer + StrCpy $4 $String $3 "-$3" # $4 is now the part behind the $Search string + StrCpy $String $String $Pointer # $String is now the part before the $Search string + StrCpy $Search ":" # search for the ":" after the first previous drive letter + Call RevStrPoint + IntOp $Pointer $Pointer - 1 # jump before the ":" to the drive letter + StrCpy $Pointer $Pointer "" 1 # cut of the "-" sign + StrCpy ${PathResult} $String $Pointer "-$Pointer" + StrCpy $String $4 + StrCpy $Search ";" # search for the following ";" that separates the different paths + Call StrPoint + ${if} $Pointer != "-1" # if something was found + StrCpy $String $String $Pointer + ${endif} + StrCpy ${PathResult} "${PathResult}$String" + # check if the FileName exists in the ${Result} folder + !insertmacro FileCheck $R5 ${FileName} ${PathResult} + ${if} $R5 == "False" + StrCpy ${PathResult} "False" + ${endif} + EndPATHCheck_${ID}: + !undef ID + +!macroend diff --git a/development/Win32/packaging/installer/include/detection.nsh b/development/Win32/packaging/installer/include/detection.nsh index b0d4be742f..5599dc4807 100644 --- a/development/Win32/packaging/installer/include/detection.nsh +++ b/development/Win32/packaging/installer/include/detection.nsh @@ -141,12 +141,20 @@ Function MissingPrograms StrCpy $ImageEditorPath $0 ${endif} ${endif} - + # test if and where the BibTeX-editor JabRef is installed ReadRegStr $PathBibTeXEditor HKCU "Software\JabRef" "Path" ${if} $PathBibTeXEditor == "" ReadRegStr $PathBibTeXEditor HKLM "Software\JabRef" "Path" ${endif} + # since JabRef 3.x the pathes are different + # there is currently a bug in the Jabref installer that prevents to install it without admin permissions + # therefore only check the admin installation + ${if} $PathBibTeXEditor == "" + ReadRegStr $PathBibTeXEditor HKCR "JabRef\shell\open\command" "" + StrCpy $PathBibTeXEditor $PathBibTeXEditor -17 # remove '\JabRef.exe" "%1"' + StrCpy $PathBibTeXEditor $PathBibTeXEditor "" 1 # remove the leading quote + ${endif} ${ifnot} ${FileExists} "$PathBibTeXEditor\${BIN_BIBTEXEDITOR}" StrCpy $PathBibTeXEditor "" @@ -154,13 +162,13 @@ Function MissingPrograms ${else} StrCpy $JabRefInstalled == "Yes" ${endif} - + # test if and where LilyPond is installed ReadRegStr $LilyPondPath HKLM "Software\LilyPond" "Install_Dir" ${if} $LilyPondPath != "" StrCpy $LilyPondPath "$LilyPondPath\usr\bin" # add "\usr\bin" ${endif} - + # test if Inkscape is installed ReadRegStr $SVGPath HKLM "SOFTWARE\Classes\inkscape.svg\DefaultIcon" "" ${if} $SVGPath != "" @@ -180,6 +188,26 @@ Function MissingPrograms StrCpy $GnumericPath $0 ${endif} + # test if Pandoc is installed + # HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\John MacFarlane\Pandoc + ${if} ${RunningX64} + SetRegView 64 # the PATH is in the 64bit registry section + ${endif} + # check for the path to the pandoc.exe in Window's PATH variable + StrCpy $5 "" + StrCpy $Search "pandoc" + ReadRegStr $String HKCU "Environment" "PATH" + !insertmacro PATHCheck $5 "pandoc.exe" # macro from LyXUtils.nsh + # if it is not in the user-specific PATH it might be in the global PATH + ${if} $5 == "False" + ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" + !insertmacro PATHCheck $5 "pandoc.exe" # macro from LyXUtils.nsh + ${endif} + SetRegView 32 + ${if} $5 != "False" + StrCpy $PandocPath $5 + ${endif} + FunctionEnd # --------------------------------------- diff --git a/development/Win32/packaging/installer/include/init.nsh b/development/Win32/packaging/installer/include/init.nsh index d01ec8d66a..f4ceacbfa2 100644 --- a/development/Win32/packaging/installer/include/init.nsh +++ b/development/Win32/packaging/installer/include/init.nsh @@ -48,12 +48,15 @@ Section "!${APP_NAME}" SecCore SectionIn RO SectionEnd +# FIXME: set this to true when LyX 2.2.0 final is released Section "$(SecFileAssocTitle)" SecFileAssoc - StrCpy $CreateFileAssociations "true" + SectionIn RO + StrCpy $CreateFileAssociations "false" SectionEnd Section "$(SecDesktopTitle)" SecDesktop - StrCpy $CreateDesktopIcon "true" + SectionIn RO + StrCpy $CreateDesktopIcon "false" SectionEnd !if ${SETUPTYPE} == BUNDLE @@ -597,11 +600,13 @@ SectionGroupEnd # the selection states of the dictionary sections Function .onInit - ${IfNot} ${IsNT} - ${OrIfNot} ${AtLeastWinXP} - MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later." /SD IDOK + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + ${if} $R0 == "5.0" # 2000 + ${orif} $R0 == "5.1" # XP + ${orif} $R0 == "5.2" # 2003 + MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows Vista or newer." /SD IDOK Quit - ${EndIf} + ${endif} # check that the installer is not currently running System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e' @@ -626,6 +631,11 @@ Function .onInit # Abort #${endif} + # read the use and computer name + ReadRegStr $ComputerName HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName" + System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2" + StrCpy $UserName $0 + !insertmacro MULTIUSER_INIT # check if this LyX version is already installed diff --git a/development/Win32/packaging/installer/include/variables.nsh b/development/Win32/packaging/installer/include/variables.nsh index 38e030bd8f..8fe77d2dd9 100644 --- a/development/Win32/packaging/installer/include/variables.nsh +++ b/development/Win32/packaging/installer/include/variables.nsh @@ -14,6 +14,7 @@ Var APPDATemp Var AppPre var AppSubfolder Var AppSuff +Var ComputerName Var CreateDesktopIcon Var CreateFileAssociations Var DictCode @@ -36,6 +37,7 @@ Var LilyPondPath Var MiKTeXUser Var MiKTeXVersion Var OldVersionNumber +Var PandocPath Var Pointer Var PSVPath Var PythonPath @@ -50,6 +52,7 @@ Var ThesCode Var ThesCodes Var UpdateFNDBReturn Var UserList +Var UserName Var LangName diff --git a/development/Win32/packaging/installer/settings.nsh b/development/Win32/packaging/installer/settings.nsh index 8fbd9522e3..e3a73f0fac 100644 --- a/development/Win32/packaging/installer/settings.nsh +++ b/development/Win32/packaging/installer/settings.nsh @@ -10,11 +10,11 @@ These typically need to be modified for each LyX release # Version number !define APP_VERSION_MAJOR 2 -!define APP_VERSION_MINOR 1 -!define APP_VERSION_REVISION 4 -!define APP_VERSION_EMERGENCY "" # use "1" for an emergency release of LyX otherwise "" -!define APP_EMERGENCY_DOT "" # use "." for an emergency release of LyX otherwise "" -!define APP_VERSION_BUILD 4 # Start with 1 for the installer releases of each version +!define APP_VERSION_MINOR 2 +!define APP_VERSION_REVISION 0 +!define APP_VERSION_EMERGENCY "beta-1" # use "1" for an emergency release of LyX otherwise "" +!define APP_EMERGENCY_DOT "." # use "." for an emergency release of LyX otherwise "" +!define APP_VERSION_BUILD 1 # Start with 1 for the installer releases of each version !define APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}" # Version to display @@ -37,28 +37,28 @@ These typically need to be modified for each LyX release # File locations # !!! you need to adjust them to the folders in your Windows system !!! -!define FILES_LYX "D:\LyXPackage2.1\LyX" +!define FILES_LYX "D:\LyXPackage2.2\LyX" !define FILES_DEPS "D:\LyXGit\Master\lyx-windows-deps-msvc2010" -!define FILES_QT "C:\Qt\4.8.7" +!define FILES_QT "C:\Qt\Qt5-5-1-2010\5.5\msvc2010" !define ClassFileDir "${FILES_LYX}\Resources\tex" !define DVIPostFileDir "${FILES_DEPS}\tex" #-------------------------------- -# MiKTeX +# MiKTeX and JabRef # Sizes in KB # it seems that some companies block ftp access by default, therefore http access is preferred here !define MiKTeXRepo "http://ftp.fernuni-hagen.de/ftp-dir/pub/mirrors/www.ctan.org/systems/win32/miktex/tm/packages/" #!define MiKTeXRepo "ftp://ftp.tu-chemnitz.de/pub/tex/systems/win32/miktex/tm/packages/" -!define JabRefVersion "2.10" +!define JabRefVersion "2.11.1" !define MiKTeXDeliveredVersion "2.9" -!define ImageMagickVersion "6.9.2" +!define ImageMagickVersion "6.9.3" # definitions for the Complete installer !if ${SETUPTYPE} == BUNDLE - !define JabRefInstall "external\JabRef-2.10-setup.exe" - !define SIZE_JABREF 14100 - !define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.9.5721.exe" + !define JabRefInstall "external\JabRef-2.11.1-setup.exe" + !define SIZE_JABREF 18514 + !define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.9.5872.exe" !endif diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh index 3b5a152368..3974364fe0 100644 --- a/development/Win32/packaging/installer/setup/configure.nsh +++ b/development/Win32/packaging/installer/setup/configure.nsh @@ -145,6 +145,9 @@ Section -Configure ${if} $PathBibTeXEditor != "" StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor" ${EndIf} + ${if} $PandocPath != "" + StrCpy $PathPrefix "$PathPrefix;$PandocPath" + ${endif} ${if} $LilyPondPath != "" StrCpy $PathPrefix "$PathPrefix;$LilyPondPath" ${endif} @@ -167,7 +170,13 @@ Section -Configure \format "pdf3" "pdf" "PDF (dvipdfm)" "m" "pdfview" "" "document,vector,menu=export" "application/pdf"$\r$\n\ \format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector,menu=export" "application/pdf"$\r$\n\ \format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector,menu=export" "application/pdf"$\r$\n' - + + # use Inkscape to edit PDF and EPS images + ${if} $SVGPath != "" + FileWrite $R1 '\format "pdf6" "pdf" "PDF (graphics)" "" "auto" "inkscape" "vector" "application/pdf"$\r$\n\ + \format "eps" "eps" "EPS" "" "auto" "inkscape" "vector" "image/x-eps"$\r$\n' + ${endif} + # if Inkscape is not available Imagemagick will be used to convert WMF/EMF files # We need to specify a resolution for the converter otherwise 1024 dpi are used and # eps2pdf takes ages. 300 dpi are a good compromise for speed and size. diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index c8f58b0551..939b990df6 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -132,8 +132,9 @@ Section -ProgramFiles SecProgramFiles !if ${SETUPTYPE} == BUNDLE - # install JabRef if not already installed and the user selected it - # if no BibTeX editor is installed + # install JabRef if not already installed, the user selected it + # and if no BibTeX editor is installed + # due to an installer bug in the installer of JabRef version 3.x, we still install JabRef 2.11.1 ${if} $PathBibTeXEditor == "" ${andif} $InstallJabRef == "true" # launch installer @@ -162,7 +163,7 @@ Section -ProgramFiles SecProgramFiles ${else} WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}" ${endif} - ${endif} + ${endif} ${endif} # end if PathBibTeXEditor !endif # end if BUNDLE -- 2.39.2