commit 8757550015e43c557e0667de3d030e56a42039d4
Author: Uwe Stöhr <uwesto...@lyx.org>
Date:   Tue Oct 31 22:15:54 2017 +0100

    Win installer: fix a MiKTeX package issue
    
    since a few months MiKTeX's package manager required the option "--admin" 
when calling it with admin privileges
    
    - also register the .lyx21 file extension for LyX 2.3
    - also update the LyXRC version number
---
 .../Win32/packaging/installer/include/LaTeX.nsh    |   18 ++++++++++++------
 .../Win32/packaging/installer/setup/configure.nsh  |    7 +++++--
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh 
b/development/Win32/packaging/installer/include/LaTeX.nsh
index dcf7cd0..ecb82b4 100644
--- a/development/Win32/packaging/installer/include/LaTeX.nsh
+++ b/development/Win32/packaging/installer/include/LaTeX.nsh
@@ -277,11 +277,6 @@ Function ConfigureMiKTeX
    SetOutPath "$PathLaTeXLocal\tex\latex\lyx"
    CopyFiles /SILENT "$INSTDIR\Resources\tex\*.*" 
"$PathLaTeXLocal\tex\latex\lyx"
   ${endif}
-  # Hungarian support
-  # The following seems to be unnecesary since 2015, therefore it is commented
-  # this is a replacement therefore do this in every case
-  #SetOutPath "$PathLaTeXLocal\tex\generic\babel"
-  #File "${FILES_DVIPOST_PKG}\magyar.ldf"
   
   # install a Perl interpreter for splitindex and pdfcrop
   SetOutPath "$INSTDIR"
@@ -342,7 +337,18 @@ Function ConfigureMiKTeX
   NoAutoInstall:
   
   # update MiKTeX's package file list
-  ExecWait '$PathLaTeX\mpm.exe --update-fndb'
+  ${if} $MultiUser.Privileges != "Admin"
+  ${andif} $MultiUser.Privileges != "Power"
+   # call the non-admin version
+   nsExec::ExecToLog "$PathLaTeX\mpm.exe --update-fndb"
+  ${else}
+   ${if} $MiKTeXUser != "HKCU" # call the admin version
+    nsExec::ExecToLog "$PathLaTeX\mpm.exe --admin --update-fndb"
+   ${else}
+    nsExec::ExecToLog "$PathLaTeX\mpm.exe --update-fndb"
+   ${endif}
+  ${endif}
+  Pop $UpdateFNDBReturn # Return value
   
   # we must return to 32bit because LyX is a 32bit application
   SetRegView 32
diff --git a/development/Win32/packaging/installer/setup/configure.nsh 
b/development/Win32/packaging/installer/setup/configure.nsh
index a8db7f1..b4537fb 100644
--- a/development/Win32/packaging/installer/setup/configure.nsh
+++ b/development/Win32/packaging/installer/setup/configure.nsh
@@ -107,7 +107,10 @@ Section -Configure
    # .lyx20
    WriteRegStr SHCTX "Software\Classes\${APP_EXT}20" "" "${APP_REGNAME_DOC}"
    WriteRegStr SHCTX "Software\Classes\${APP_EXT}20" "Content Type" 
"${APP_MIME_TYPE}"
-   # .lyx21 don't set this, because this is designed to be opened with LyX 
2.1.x
+   # .lyx21
+   WriteRegStr SHCTX "Software\Classes\${APP_EXT}21" "" "${APP_REGNAME_DOC}"
+   WriteRegStr SHCTX "Software\Classes\${APP_EXT}21" "Content Type" 
"${APP_MIME_TYPE}"
+   # .lyx22 don't set this, because this is designed to be opened with LyX 
2.2.x
   
    # Refresh shell
    ${RefreshShellIcons}
@@ -157,7 +160,7 @@ Section -Configure
   Delete "$INSTDIR\Resources\lyxrc.dist"
   FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
   # set the format to the latest LyXRC format
-  FileWrite $R1 'Format 22$\r$\n'
+  FileWrite $R1 'Format 23$\r$\n'
   # set some general things
   FileWrite $R1 '\screen_zoom 120$\r$\n'
   ${if} "$PathPrefix" != ""

Reply via email to