]> git.lyx.org Git - features.git/commitdiff
Win installer: fix a MiKTeX package issue
authorUwe Stöhr <uwestoehr@lyx.org>
Tue, 31 Oct 2017 21:18:06 +0000 (22:18 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Tue, 31 Oct 2017 21:18:06 +0000 (22:18 +0100)
since a few months MiKTeX's package manager required the option "--admin" when calling it with admin privileges

- also register the .lyx22 file extension to be opened with the future LyX 2.2.4

development/Win32/packaging/installer/include/LaTeX.nsh
development/Win32/packaging/installer/setup/configure.nsh

index dcf7cd01bd6f4185b68003640dbc3dc3b1a01eeb..ecb82b4c9a4d85031664815deefbadc8a0cb7693 100644 (file)
@@ -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
index cd5c4fa81d4689e84e2e69f767b48af544776612..97700dcffa0a59c8b6e8dc23ad20fe1d16976f8c 100644 (file)
@@ -107,7 +107,12 @@ 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
+   WriteRegStr SHCTX "Software\Classes\${APP_EXT}22" "" "${APP_REGNAME_DOC}"
+   WriteRegStr SHCTX "Software\Classes\${APP_EXT}22" "Content Type" "${APP_MIME_TYPE}"
   
    # Refresh shell
    ${RefreshShellIcons}