2008-03-30 21:37:53 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
configure.nsh
|
|
|
|
|
|
|
|
Write registry information and configure LyX
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
Var PathPrefix
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
#!define SHORTCUT '${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"'
|
2008-03-30 21:37:53 +00:00
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Registry information
|
|
|
|
|
|
|
|
Section -InstallData
|
|
|
|
|
|
|
|
# Registry information
|
2011-05-23 04:12:10 +00:00
|
|
|
WriteRegStr SHCTX ${APP_REGKEY} "" $INSTDIR
|
|
|
|
WriteRegStr SHCTX ${APP_REGKEY} "Version" "${APP_VERSION_NUMBER}"
|
|
|
|
WriteRegStr SHCTX ${APP_REGKEY_SETUP} "LaTeX Path" $PathLaTeX
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Start Menu shortcut
|
2012-07-02 23:42:30 +00:00
|
|
|
SetOutPath "$INSTDIR\bin" # this is the folder in which the shortcut is executed
|
2011-05-23 04:12:10 +00:00
|
|
|
CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${APP_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
|
2012-07-08 13:48:26 +00:00
|
|
|
# Link to www.lyx.org and to the Wiki
|
|
|
|
WriteINIStr "$SMPROGRAMS\$StartmenuFolder\${APP_WEBPAGE_INFO}.url" "InternetShortcut" "URL" "${APP_WEBPAGE}"
|
|
|
|
WriteINIStr "$SMPROGRAMS\$StartmenuFolder\${APP_WIKI_INFO}.url" "InternetShortcut" "URL" "${APP_WIKI}"
|
2011-05-23 04:12:10 +00:00
|
|
|
# create desktop icon
|
|
|
|
${if} $CreateDesktopIcon == "true"
|
|
|
|
SetOutPath "$INSTDIR\bin"
|
|
|
|
CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
|
|
|
|
${endif}
|
2008-03-30 21:37:53 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# Uninstaller information
|
2008-03-30 21:37:53 +00:00
|
|
|
${If} $MultiUser.InstallMode == "CurrentUser"
|
2011-05-23 04:12:10 +00:00
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayName" "${APP_NAME} ${APP_VERSION} $(TEXT_INSTALL_CURRENTUSER)"
|
2008-03-30 21:37:53 +00:00
|
|
|
${Else}
|
2011-05-23 04:12:10 +00:00
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayName" "${APP_NAME} ${APP_VERSION}"
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
|
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
|
2011-08-19 14:21:43 +00:00
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx,0"
|
2011-05-23 04:12:10 +00:00
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "http://www.lyx.org/"
|
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "http://www.lyx.org/about/"
|
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "LyX Team"
|
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "http://www.lyx.org/internet/mailing.php"
|
|
|
|
WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoModify" 0x00000001
|
|
|
|
WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
|
|
|
|
WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
|
2008-03-30 21:37:53 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
# Write LyX configuration file
|
|
|
|
|
|
|
|
Section -Configure
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# Associate .lyx files with LyX for current user of all users
|
|
|
|
|
|
|
|
${if} $CreateFileAssociations == "true"
|
2012-07-02 23:42:30 +00:00
|
|
|
WriteRegStr SHCTX "${APP_DIR_REGKEY}" "" "$INSTDIR\${APP_RUN}"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
|
|
|
|
# Write information about file type
|
|
|
|
#!define REG_FILETYPE 'WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}"'
|
|
|
|
|
|
|
|
${if} $CreateFileAssociations == "true"
|
|
|
|
WriteRegStr SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}" # special entry to test if they were registered by this LyX version
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}" "" "${APP_NAME} Document"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\DefaultIcon" "" "$INSTDIR\${APP_RUN},0"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\Shell\open\command" "" '"$INSTDIR\${APP_RUN}" "%1"'
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "" "${APP_REGNAME_DOC}"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "Content Type" "${APP_MIME_TYPE}"
|
|
|
|
# .lyx13
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}13" "" "${APP_REGNAME_DOC}"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}13" "Content Type" "${APP_MIME_TYPE}"
|
|
|
|
# .lyx14
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}14" "" "${APP_REGNAME_DOC}"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}14" "Content Type" "${APP_MIME_TYPE}"
|
2011-06-08 16:41:48 +00:00
|
|
|
# .lyx15
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}15" "" "${APP_REGNAME_DOC}"
|
|
|
|
WriteRegStr SHCTX "Software\Classes\${APP_EXT}15" "Content Type" "${APP_MIME_TYPE}"
|
2011-05-23 04:12:10 +00:00
|
|
|
# .lyx16 don't set this, because this is designed to be opened with LyX 1.6.x
|
|
|
|
|
|
|
|
# Refresh shell
|
|
|
|
${RefreshShellIcons}
|
|
|
|
${endif}
|
|
|
|
|
2011-02-17 19:26:53 +00:00
|
|
|
# Set path prefix in lyxrc.dist
|
2008-03-30 21:37:53 +00:00
|
|
|
|
2011-02-17 19:26:53 +00:00
|
|
|
# Install standard lyxrc.dist file
|
2011-05-23 04:12:10 +00:00
|
|
|
#SetOutPath "$INSTDIR\Resources"
|
|
|
|
#File "${FILES_DEPS}\Resources\lyxrc.dist"
|
2008-03-30 21:37:53 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# create the path prefix
|
2011-02-17 19:27:56 +00:00
|
|
|
# $$ represents a literal $ in an NSIS string
|
2012-03-10 10:46:14 +00:00
|
|
|
StrCpy $PathPrefix "$$LyXDir\bin;$$LyXDir\Python;$$LyXDir\Python\Lib;$$LyXDir\imagemagick"
|
2008-05-01 18:33:36 +00:00
|
|
|
|
2011-08-12 15:19:36 +00:00
|
|
|
${if} $PathLaTeX != ""
|
2008-03-30 21:37:53 +00:00
|
|
|
StrCpy $PathPrefix "$PathPrefix;$PathLaTeX"
|
|
|
|
${EndIf}
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PSVPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$PSVPath"
|
|
|
|
${endif}
|
|
|
|
${if} $EditorPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$EditorPath"
|
|
|
|
${endif}
|
|
|
|
${if} $ImageEditorPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
|
2011-09-05 06:09:13 +00:00
|
|
|
${endif}
|
|
|
|
${if} $GhostscriptPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
${if} $SVGPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$SVGPath"
|
|
|
|
${endif}
|
|
|
|
${if} $WMFPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$WMFPath"
|
|
|
|
${endif}
|
2011-12-14 00:14:30 +00:00
|
|
|
${if} $GnumericPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$GnumericPath"
|
|
|
|
${endif}
|
2011-08-12 15:19:36 +00:00
|
|
|
${if} $PathBibTeXEditor != ""
|
2008-05-02 15:53:14 +00:00
|
|
|
StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
|
2011-08-12 15:19:36 +00:00
|
|
|
${EndIf}
|
|
|
|
${if} $LilyPondPath != ""
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$LilyPondPath"
|
|
|
|
${endif}
|
2008-03-30 21:37:53 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# Set the path prefix in lyxrc.dist
|
|
|
|
ClearErrors
|
|
|
|
Delete "$INSTDIR\Resources\lyxrc.dist"
|
|
|
|
FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
|
2011-07-29 03:14:33 +00:00
|
|
|
# set the format
|
|
|
|
FileWrite $R1 'Format 1$\r$\n'
|
2011-05-23 04:12:10 +00:00
|
|
|
# set some general things
|
2011-07-29 03:14:33 +00:00
|
|
|
FileWrite $R1 '\screen_zoom 120$\r$\n'
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} "$PathPrefix" != ""
|
|
|
|
FileWrite $R1 '\path_prefix "$PathPrefix"$\r$\n'
|
|
|
|
${endif}
|
2011-07-25 03:09:02 +00:00
|
|
|
${if} $Acrobat == "Yes" # use pdfview for Acrobat / Adobe Reader
|
|
|
|
FileWrite $R1 '\format "pdf5" "pdf" "PDF (LuaTeX)" "u" "pdfview" "" "document,vector,menu=export"$\r$\n\
|
|
|
|
\format "pdf4" "pdf" "PDF (XeTeX)" "X" "pdfview" "" "document,vector,menu=export"$\r$\n\
|
|
|
|
\format "pdf3" "pdf" "PDF (dvipdfm)" "m" "pdfview" "" "document,vector,menu=export"$\r$\n\
|
|
|
|
\format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector,menu=export"$\r$\n\
|
|
|
|
\format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector,menu=export"$\r$\n'
|
|
|
|
${endif}
|
2011-08-12 15:19:36 +00:00
|
|
|
# if LilyPondPath was found
|
|
|
|
# we need to add these entris because python scripts can only be executed
|
2011-08-12 23:00:43 +00:00
|
|
|
# if the full path is given
|
2011-08-12 15:19:36 +00:00
|
|
|
${if} $LilyPondPath != ""
|
|
|
|
FileWrite $R1 '\format "lilypond-book" "lytex" "LilyPond book (LaTeX)" "" "" "auto" "document,menu=export"$\r$\n\
|
2011-08-12 23:00:43 +00:00
|
|
|
\converter "lilypond-book" "pdflatex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=pdflatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
|
|
|
|
\converter "lilypond-book" "xetex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=xelatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
|
|
|
|
\converter "lilypond-book" "luatex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=lualatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
|
|
|
|
\converter "lilypond-book" "latex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --lily-output-dir=ly-eps $$$$i" ""$\r$\n'
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
FileClose $R1
|
|
|
|
IfErrors 0 +2
|
|
|
|
MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
|
|
|
|
ClearErrors
|
2008-03-30 21:37:53 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
2008-04-05 19:12:37 +00:00
|
|
|
#--------------------------------
|
|
|
|
# Postscript printer for metafile to EPS converter
|
|
|
|
|
|
|
|
Section -PSPrinter
|
|
|
|
|
2012-06-26 23:07:46 +00:00
|
|
|
${if} $MultiUser.Privileges == "Admin"
|
|
|
|
${orif} $MultiUser.Privileges == "Power"
|
|
|
|
# Delete printer
|
|
|
|
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
|
|
|
|
# Install printer and driver
|
|
|
|
ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
|
|
|
|
${else}
|
|
|
|
MessageBox MB_OK|MB_ICONINFORMATION "$(MetafileNotAvailable)"
|
|
|
|
${endif}
|
2008-04-05 19:12:37 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
2008-04-07 17:26:02 +00:00
|
|
|
#--------------------------------
|
|
|
|
# Run the LyX configure.py script, so MiKTeX can download its packages
|
|
|
|
|
2008-05-01 18:33:36 +00:00
|
|
|
Var ConfigureReturn
|
2008-04-07 17:26:02 +00:00
|
|
|
|
|
|
|
Section -ConfigureScript
|
|
|
|
|
2008-10-09 22:00:09 +00:00
|
|
|
SetOutPath "$INSTDIR\Resources"
|
2008-04-07 17:26:02 +00:00
|
|
|
DetailPrint $(TEXT_CONFIGURE_LYX)
|
2011-12-21 01:12:43 +00:00
|
|
|
nsExec::ExecToLog '"$INSTDIR\Python\python.exe" "$INSTDIR\Resources\configure.py"'
|
2008-05-01 18:33:36 +00:00
|
|
|
Pop $ConfigureReturn # Return value
|
2008-04-07 17:26:02 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# ask to update MiKTeX
|
|
|
|
${if} $LaTeXInstalled == "MiKTeX"
|
|
|
|
Call UpdateMiKTeX # function from latex.nsh
|
2011-12-21 01:12:43 +00:00
|
|
|
# for new installations a second run is necessary to give the users feedback about
|
|
|
|
# the ongoing installation of LaTeX packages
|
|
|
|
# a new installed MiKTeX needs some time until it is ready to install packages
|
|
|
|
!if ${SETUPTYPE} == BUNDLE
|
|
|
|
nsExec::ExecToLog '"$INSTDIR\Python\python.exe" "$INSTDIR\Resources\configure.py"'
|
|
|
|
!endif # end if == BUNDLE
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
|
2008-04-07 17:26:02 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
#--------------------------------
|
|
|
|
# Desktop shortcut
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
Function StartLyX
|
|
|
|
|
2011-12-21 01:12:43 +00:00
|
|
|
# run LyX in a command line window to give the users feedback about
|
|
|
|
# the time consuming LaTeX package installation
|
2011-05-23 04:12:10 +00:00
|
|
|
|
2011-12-21 01:12:43 +00:00
|
|
|
#Exec 'cmd /K " "$INSTDIR\bin\lyx.exe""'
|
2011-12-21 22:09:24 +00:00
|
|
|
Exec "$INSTDIR\${APP_RUN}"
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
/*Function CheckDesktopShortcut
|
2008-03-30 21:37:53 +00:00
|
|
|
|
|
|
|
# Enable desktop icon creation when there is an icon already
|
|
|
|
# Old shortcuts need to be updated
|
|
|
|
|
|
|
|
${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
|
|
|
|
${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function CreateDesktopShortcut
|
|
|
|
|
|
|
|
# Desktop icon creation is an option on the finish page
|
2008-11-05 23:44:44 +00:00
|
|
|
SetOutPath "$INSTDIR\bin"
|
2011-05-23 04:12:10 +00:00
|
|
|
CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
|
|
|
|
|
|
|
|
FunctionEnd*/
|
2008-03-30 21:37:53 +00:00
|
|
|
|