2012-11-11 17:07:55 +00:00
|
|
|
/*
|
|
|
|
LaTeX.nsh
|
|
|
|
|
|
|
|
Handling of LaTeX distributions
|
|
|
|
*/
|
|
|
|
|
|
|
|
# This script contains the following functions:
|
|
|
|
#
|
|
|
|
# - LaTeXActions (checks if MiKTeX or TeXLive is installed)
|
|
|
|
#
|
|
|
|
# - InstallMiKTeX (installs MiKTeX if not already installed),
|
|
|
|
# only for bunlde installer, uses:
|
|
|
|
# LaTeXCheck # function from LyXUtils.nsh
|
|
|
|
#
|
|
|
|
# - ConfigureMiKTeX
|
|
|
|
# (installs the LaTeX class files that are delivered with LyX,
|
2014-03-09 17:19:58 +00:00
|
|
|
# a Perl interpreter for splitindex and pdfcrop
|
2012-11-11 17:07:55 +00:00
|
|
|
# and enable MiKTeX's automatic package installation)
|
|
|
|
#
|
2012-11-22 22:35:59 +00:00
|
|
|
# - ConfigureTeXLive
|
|
|
|
# (installs the LaTeX class files that are delivered with LyX)
|
|
|
|
#
|
2012-11-11 17:07:55 +00:00
|
|
|
# - UpdateMiKTeX (asks to update MiKTeX)
|
|
|
|
|
|
|
|
# ---------------------------------------
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
Function LaTeXActions
|
2012-11-11 17:07:55 +00:00
|
|
|
# checks if MiKTeX or TeXLive is installed
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2013-02-26 01:25:04 +00:00
|
|
|
StrCpy $Is64bit "false"
|
|
|
|
|
2013-01-14 00:45:42 +00:00
|
|
|
${if} ${RunningX64}
|
2013-01-17 00:12:38 +00:00
|
|
|
SetRegView 64 # the PATH is in the 64bit registry section
|
2013-01-14 00:45:42 +00:00
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
# test if MiKTeX is installed
|
|
|
|
# reads the PATH variable via the registry because NSIS' "$%Path%" variable is not updated when the PATH changes
|
|
|
|
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
|
|
|
|
StrCpy $Search "miktex"
|
|
|
|
Call LaTeXCheck # sets the path to the latex.exe to $PathLaTeX # Function from LyXUtils.nsh
|
|
|
|
|
2013-02-26 01:25:04 +00:00
|
|
|
StrCpy $String $PathLaTeX
|
|
|
|
StrCpy $Search "x64" # search if it is 64bit MiKTeX
|
|
|
|
Call StrPoint # Function from LyXUtils.nsh
|
|
|
|
${if} $Pointer != "-1" # if something was found
|
|
|
|
StrCpy $Is64bit "true"
|
|
|
|
${endif}
|
|
|
|
|
2013-01-17 00:12:38 +00:00
|
|
|
# check for 32bit MiKTeX
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX != ""
|
2013-02-26 01:25:04 +00:00
|
|
|
${andif} $Is64bit != "true"
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 32
|
|
|
|
${endif}
|
2012-11-15 00:37:59 +00:00
|
|
|
# check if MiKTeX 2.8 or newer is installed
|
2011-05-23 04:12:10 +00:00
|
|
|
StrCpy $0 0
|
2013-01-17 00:12:38 +00:00
|
|
|
loop32:
|
2011-05-23 04:12:10 +00:00
|
|
|
EnumRegKey $1 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" $0 # check the last subkey
|
2013-01-17 00:12:38 +00:00
|
|
|
StrCmp $1 "" done32
|
2011-05-23 04:12:10 +00:00
|
|
|
StrCpy $String $1
|
|
|
|
IntOp $0 $0 + 1
|
2013-01-17 00:12:38 +00:00
|
|
|
Goto loop32
|
|
|
|
done32:
|
|
|
|
${if} $String == "2.8"
|
|
|
|
StrCpy $MiKTeXVersion "2.8"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.8"
|
|
|
|
${endif}
|
|
|
|
${if} $String == "2.9"
|
|
|
|
StrCpy $MiKTeXVersion "2.9"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.9"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
# check for 64bit MiKTeX
|
2013-02-26 01:25:04 +00:00
|
|
|
${if} $LaTeXName == ""
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 64
|
|
|
|
${endif}
|
|
|
|
# check if MiKTeX 2.8 or newer is installed
|
|
|
|
StrCpy $0 0
|
|
|
|
loop64:
|
|
|
|
EnumRegKey $1 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" $0 # check the last subkey
|
|
|
|
StrCmp $1 "" done64
|
|
|
|
StrCpy $String $1
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
Goto loop64
|
|
|
|
done64:
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $String == "2.8"
|
|
|
|
StrCpy $MiKTeXVersion "2.8"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.8"
|
|
|
|
${endif}
|
|
|
|
${if} $String == "2.9"
|
|
|
|
StrCpy $MiKTeXVersion "2.9"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.9"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
|
2012-06-26 01:05:59 +00:00
|
|
|
${if} $PathLaTeX != ""
|
|
|
|
StrCpy $MiKTeXUser "HKLM" # needed later to configure MiKTeX
|
|
|
|
${else} # check if MiKTeX is installed only for the current user
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 64 # the PATH is in the 64bit registry section
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
ReadRegStr $String HKCU "Environment" "Path"
|
|
|
|
StrCpy $Search "miktex"
|
|
|
|
Call LaTeXCheck # function from LyXUtils.nsh
|
|
|
|
${if} $PathLaTeX != ""
|
2012-06-26 01:05:59 +00:00
|
|
|
StrCpy $MiKTeXUser "HKCU"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
${if} $LaTeXName == "" # check for the MiKTeX version
|
|
|
|
StrCpy $0 0
|
|
|
|
loopB:
|
|
|
|
EnumRegKey $1 HKCU "SOFTWARE\MiKTeX.org\MiKTeX" $0 # check the last subkey
|
|
|
|
StrCmp $1 "" doneB
|
|
|
|
StrCpy $String $1
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
Goto loopB
|
|
|
|
doneB:
|
|
|
|
${if} $String == "2.8"
|
|
|
|
StrCpy $MiKTeXVersion "2.8"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.8"
|
|
|
|
${endif}
|
|
|
|
${if} $String == "2.9"
|
|
|
|
StrCpy $MiKTeXVersion "2.9"
|
|
|
|
StrCpy $LaTeXName "MiKTeX 2.9"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
2013-02-26 01:25:04 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX != ""
|
2013-02-26 01:25:04 +00:00
|
|
|
StrCpy $String $PathLaTeX
|
|
|
|
StrCpy $Search "x64" # search if it is 64bit MiKTeX
|
|
|
|
Call StrPoint # Function from LyXUtils.nsh
|
|
|
|
${if} $Pointer != "-1" # if something was found
|
|
|
|
StrCpy $Is64bit "true"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
StrCpy $LaTeXInstalled "MiKTeX"
|
2012-12-31 16:28:50 +00:00
|
|
|
# on some installations the path ends with a "\" on some not
|
|
|
|
# therefore assure that we remove it if it exists
|
|
|
|
StrCpy $0 $PathLaTeX "" -1
|
|
|
|
${if} $0 == "\"
|
|
|
|
StrCpy $PathLaTeX "$PathLaTeX" -1 # delete "\"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
|
|
|
|
# test if TeXLive is installed
|
2012-11-22 22:35:59 +00:00
|
|
|
# TeXLive can be installed so that it appears in the PATH variable and/or only as current user.
|
|
|
|
# The safest method is to first check for the PATH because this is independent of the TeXLive version.
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 64 # the PATH is in the 64bit registry section
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX == ""
|
|
|
|
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
|
|
|
|
StrCpy $Search "TeXLive"
|
|
|
|
Call LaTeXCheck # function from LyXUtils.nsh
|
|
|
|
${endif}
|
2012-11-22 22:35:59 +00:00
|
|
|
# check for the current user Path variable
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX == ""
|
|
|
|
ReadRegStr $String HKCU "Environment" "Path"
|
|
|
|
StrCpy $Search "texlive"
|
|
|
|
StrCpy $2 "TeXLive"
|
|
|
|
Call LaTeXCheck # function from LyXUtils.nsh
|
|
|
|
${endif}
|
2012-11-22 22:35:59 +00:00
|
|
|
# check if it was installed to the system
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 32 # TeXLive is a 32bit application
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX == ""
|
2016-02-11 00:33:34 +00:00
|
|
|
ReadRegStr $String HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2015" "UninstallString"
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $String == ""
|
2016-02-11 00:33:34 +00:00
|
|
|
ReadRegStr $String HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2015" "UninstallString"
|
2012-11-22 22:35:59 +00:00
|
|
|
${endif}
|
|
|
|
${if} $String != ""
|
2012-12-31 16:28:50 +00:00
|
|
|
StrCpy $String $String -28 # remove '\tlpkg\installer\uninst.bat"'
|
2012-11-22 22:35:59 +00:00
|
|
|
StrCpy $String $String "" 1 # remove the leading quote
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
StrCpy $PathLaTeX "$String\bin\win32"
|
|
|
|
# check if the latex.exe exists in the $PathLaTeX folder
|
|
|
|
!insertmacro FileCheck $5 "latex.exe" "$PathLaTeX" # macro from LyXUtils.nsh
|
|
|
|
${if} $5 == "False"
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
${endif}
|
|
|
|
${endif}
|
2012-11-22 22:35:59 +00:00
|
|
|
# finally set the name
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX != ""
|
|
|
|
${andif} $LaTeXName != "MiKTeX 2.8"
|
|
|
|
${andif} $LaTeXName != "MiKTeX 2.9"
|
2012-11-22 22:35:59 +00:00
|
|
|
StrCpy $LaTeXInstalled "TeXLive"
|
2016-02-11 00:33:34 +00:00
|
|
|
ReadRegStr $String HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2015" "DisplayVersion"
|
2012-11-22 22:35:59 +00:00
|
|
|
${if} $String == ""
|
2016-02-11 00:33:34 +00:00
|
|
|
ReadRegStr $String HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2015" "DisplayVersion"
|
|
|
|
${endif}
|
|
|
|
${if} $String == ""
|
|
|
|
ReadRegStr $String HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2014" "DisplayVersion"
|
|
|
|
${endif}
|
|
|
|
${if} $String == ""
|
|
|
|
ReadRegStr $String HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXLive2014" "DisplayVersion"
|
2012-11-22 22:35:59 +00:00
|
|
|
${endif}
|
|
|
|
${if} $String != ""
|
|
|
|
StrCpy $LaTeXName "TeXLive $String"
|
|
|
|
${else}
|
|
|
|
StrCpy $LaTeXName "TeXLive"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
# -------------------------------------------
|
|
|
|
|
|
|
|
!if ${SETUPTYPE} == BUNDLE
|
|
|
|
|
|
|
|
Function InstallMiKTeX
|
2012-11-11 17:07:55 +00:00
|
|
|
# installs MiKTeX if not already installed
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
${if} $PathLaTeX == ""
|
|
|
|
# launch MiKTeX's installer
|
2014-02-18 01:15:53 +00:00
|
|
|
MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)" /SD IDOK
|
2016-02-08 23:31:57 +00:00
|
|
|
${if} $MultiUser.Privileges != "Admin"
|
|
|
|
${andif} $MultiUser.Privileges != "Power"
|
|
|
|
# call the non-admin version
|
|
|
|
ExecWait ${MiKTeXInstall}
|
|
|
|
${else}
|
|
|
|
ExecWait "${MiKTeXInstall} --shared"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
# test if MiKTeX is installed
|
2012-12-31 16:28:50 +00:00
|
|
|
Call LaTeXActions
|
2013-01-17 00:12:38 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
SetRegView 32 # we install the 32bit version of MiKTeX
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX != ""
|
2012-12-31 16:28:50 +00:00
|
|
|
# special entry that it was installed together with LyX
|
|
|
|
# so that we can later uninstall it together with LyX
|
2012-06-26 23:58:04 +00:00
|
|
|
${if} $MiKTeXUser == "HKCU"
|
2012-11-11 17:07:55 +00:00
|
|
|
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
|
2012-06-26 23:58:04 +00:00
|
|
|
${else}
|
|
|
|
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
StrCpy $LaTeXInstalled "MiKTeX"
|
|
|
|
StrCpy $MiKTeXVersion ${MiKTeXDeliveredVersion}
|
|
|
|
${else}
|
2014-02-18 01:15:53 +00:00
|
|
|
MessageBox MB_OK|MB_ICONSTOP "$(LatexError1)" /SD IDOK
|
2011-05-23 04:12:10 +00:00
|
|
|
SetOutPath $TEMP # to be able to delete the $INSTDIR
|
|
|
|
RMDir /r $INSTDIR
|
|
|
|
Abort
|
|
|
|
${endif} # endif $PathLaTeX != ""
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
!endif # endif ${SETUPTYPE} == BUNDLE
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
Function ConfigureMiKTeX
|
2012-06-02 18:40:13 +00:00
|
|
|
# installs the LaTeX class files that are delivered with LyX,
|
2014-03-09 17:19:58 +00:00
|
|
|
# a Perl interpreter for splitindex and pdfcrop
|
2011-05-23 04:12:10 +00:00
|
|
|
# and enable MiKTeX's automatic package installation
|
|
|
|
|
2012-06-02 18:40:13 +00:00
|
|
|
# install LyX's LaTeX class and style files and a Perl interpreter
|
2011-09-05 07:20:53 +00:00
|
|
|
${if} $PathLaTeX != ""
|
2012-06-26 01:05:59 +00:00
|
|
|
${if} $MultiUser.Privileges == "Admin"
|
|
|
|
${orif} $MultiUser.Privileges == "Power"
|
2013-02-26 01:25:04 +00:00
|
|
|
${if} $Is64bit == "true"
|
|
|
|
StrCpy $PathLaTeXLocal "$PathLaTeX" -15 # delete "\miktex\bin\x64"
|
|
|
|
${else}
|
|
|
|
StrCpy $PathLaTeXLocal "$PathLaTeX" -11 # delete "\miktex\bin"
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${else}
|
|
|
|
StrCpy $PathLaTeXLocal "$APPDATA\MiKTeX\$MiKTeXVersion"
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
# only install the LyX packages if they are not already installed
|
|
|
|
${ifnot} ${FileExists} "$PathLaTeXLocal\tex\latex\lyx\broadway.cls"
|
|
|
|
# dvipost
|
|
|
|
SetOutPath "$PathLaTeXLocal\tex\latex\dvipost"
|
|
|
|
File "${FILES_DVIPOST_PKG}\dvipost.sty"
|
2012-11-22 22:35:59 +00:00
|
|
|
# files in Resources\tex
|
2011-05-23 04:12:10 +00:00
|
|
|
SetOutPath "$PathLaTeXLocal\tex\latex\lyx"
|
|
|
|
CopyFiles /SILENT "$INSTDIR\Resources\tex\*.*" "$PathLaTeXLocal\tex\latex\lyx"
|
2012-06-02 18:40:13 +00:00
|
|
|
${endif}
|
2013-03-17 15:24:24 +00:00
|
|
|
# Hungarian support
|
2016-10-16 12:34:27 +00:00
|
|
|
# The following seems to be unnecesary since 2015, therefore it is commented
|
2013-03-17 15:24:24 +00:00
|
|
|
# this is a replacement therefore do this in every case
|
2016-10-16 12:34:27 +00:00
|
|
|
#SetOutPath "$PathLaTeXLocal\tex\generic\babel"
|
|
|
|
#File "${FILES_DVIPOST_PKG}\magyar.ldf"
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2014-03-09 17:19:58 +00:00
|
|
|
# install a Perl interpreter for splitindex and pdfcrop
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
# recursively copy all files under Perl
|
|
|
|
File /r "${FILES_PERL}"
|
2012-06-02 18:40:13 +00:00
|
|
|
|
|
|
|
# refresh MiKTeX's file name database (do this always to assure everything is in place)
|
2012-06-26 01:05:59 +00:00
|
|
|
${if} $MultiUser.Privileges != "Admin"
|
|
|
|
${andif} $MultiUser.Privileges != "Power"
|
|
|
|
# call the non-admin version
|
|
|
|
nsExec::ExecToLog "$PathLaTeX\initexmf --update-fndb"
|
|
|
|
${else}
|
|
|
|
${if} $MiKTeXUser != "HKCU" # call the admin version
|
|
|
|
nsExec::ExecToLog "$PathLaTeX\initexmf --admin --update-fndb"
|
|
|
|
${else}
|
|
|
|
nsExec::ExecToLog "$PathLaTeX\initexmf --update-fndb"
|
|
|
|
${endif}
|
2012-06-02 18:40:13 +00:00
|
|
|
${endif}
|
|
|
|
Pop $UpdateFNDBReturn # Return value
|
|
|
|
|
2012-11-22 22:35:59 +00:00
|
|
|
${endif} # end if $PathLaTeX != ""
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2013-01-17 00:12:38 +00:00
|
|
|
# enable package installation without asking (1 = Yes, 0 = No, 2 = Ask me first) and
|
|
|
|
# if there is not package repository (MiKTeX's primary package repository) then set it
|
2013-02-26 01:25:04 +00:00
|
|
|
${if} ${RunningX64}
|
|
|
|
${andif} $Is64bit == "true"
|
|
|
|
SetRegView 64
|
|
|
|
${else}
|
|
|
|
SetRegView 32
|
|
|
|
${endif}
|
2012-12-31 20:17:01 +00:00
|
|
|
${if} $MiKTeXUser == "HKCU" # if only for current user
|
2014-04-19 16:58:22 +00:00
|
|
|
# if AutoInstall is set to "0" we can assume that this was set purposly since the default is "1"
|
|
|
|
ReadRegStr $2 HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall"
|
|
|
|
${if} $2 == "0"
|
|
|
|
Goto NoAutoInstall
|
|
|
|
${endif}
|
2012-12-31 20:17:01 +00:00
|
|
|
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall" "1"
|
2013-01-17 00:12:38 +00:00
|
|
|
ReadRegStr $1 HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository"
|
|
|
|
${if} $1 == ""
|
|
|
|
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository" "${MiKTeXRepo}"
|
|
|
|
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RepositoryType" "remote"
|
|
|
|
${endif}
|
2012-12-31 20:17:01 +00:00
|
|
|
${else}
|
2014-04-19 16:58:22 +00:00
|
|
|
# if AutoInstall is set to "0" we can assume that this was set purposly since the default is "1"
|
|
|
|
ReadRegStr $2 HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall"
|
|
|
|
${if} $2 == "0"
|
|
|
|
Goto NoAutoInstall
|
|
|
|
${endif}
|
2012-11-11 17:07:55 +00:00
|
|
|
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoInstall" "1"
|
2013-01-17 00:12:38 +00:00
|
|
|
ReadRegStr $1 HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository"
|
|
|
|
${if} $1 == ""
|
|
|
|
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RemoteRepository" "${MiKTeXRepo}"
|
|
|
|
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "RepositoryType" "remote"
|
|
|
|
${endif}
|
2012-12-31 20:17:01 +00:00
|
|
|
# we need to state that missing packages should be installed for all users too
|
|
|
|
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\$MiKTeXVersion\MPM" "AutoAdmin" "t"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
2014-04-19 16:58:22 +00:00
|
|
|
NoAutoInstall:
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2012-11-22 22:35:59 +00:00
|
|
|
# update MiKTeX's package file list
|
2011-05-23 04:12:10 +00:00
|
|
|
ExecWait '$PathLaTeX\mpm.exe --update-fndb'
|
|
|
|
|
2013-02-26 01:25:04 +00:00
|
|
|
# we must return to 32bit because LyX is a 32bit application
|
|
|
|
SetRegView 32
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2012-11-22 22:35:59 +00:00
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
Function ConfigureTeXLive
|
|
|
|
# installs the LaTeX class files that are delivered with LyX
|
|
|
|
# (TeXLive comes already with a Perl interpreter.)
|
|
|
|
|
|
|
|
${if} $PathLaTeX != ""
|
|
|
|
StrCpy $PathLaTeXLocal "$PathLaTeX" -10 # delete "\bin\win32"
|
|
|
|
|
|
|
|
# only install the LyX packages if they are not already installed
|
|
|
|
${ifnot} ${FileExists} "$PathLaTeXLocal\texmf-dist\tex\latex\lyx\broadway.cls"
|
|
|
|
# dvipost
|
|
|
|
SetOutPath "$PathLaTeXLocal\texmf-dist\tex\latex\dvipost"
|
|
|
|
File "${FILES_DVIPOST_PKG}\dvipost.sty"
|
|
|
|
# files in Resources\tex
|
|
|
|
SetOutPath "$PathLaTeXLocal\texmf-dist\tex\latex\lyx"
|
|
|
|
CopyFiles /SILENT "$INSTDIR\Resources\tex\*.*" "$PathLaTeXLocal\texmf-dist\tex\latex\lyx"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
# update TeXLive's package file list
|
|
|
|
ExecWait '$PathLaTeX\texhash'
|
|
|
|
|
|
|
|
# update TeXLive
|
|
|
|
ExecWait '$PathLaTeX\tlmgr update --all'
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
Function UpdateMiKTeX
|
2012-11-11 17:07:55 +00:00
|
|
|
# asks to update MiKTeX
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2014-02-18 01:15:53 +00:00
|
|
|
MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" /SD IDNO IDYES UpdateNow IDNO UpdateLater
|
2012-11-22 22:35:59 +00:00
|
|
|
UpdateNow:
|
|
|
|
# the update wizard is started by the miktex-update.exe
|
|
|
|
${if} $MultiUser.Privileges != "Admin"
|
|
|
|
${andif} $MultiUser.Privileges != "Power"
|
|
|
|
# call the non-admin version
|
|
|
|
ExecWait '"$PathLaTeX\internal\miktex-update.exe"'
|
|
|
|
${else}
|
|
|
|
${if} $MiKTeXUser != "HKCU" # call the admin version
|
|
|
|
ExecWait '"$PathLaTeX\internal\miktex-update_admin.exe"'
|
|
|
|
${else}
|
|
|
|
ExecWait '"$PathLaTeX\internal\miktex-update.exe"'
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
2012-11-22 22:35:59 +00:00
|
|
|
UpdateLater:
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|