5 Write registry information and configure LyX
12 #!define SHORTCUT '${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"'
14 #--------------------------------
15 # Registry information
19 # Registry information
20 WriteRegStr SHCTX ${APP_REGKEY} "" $INSTDIR
21 WriteRegStr SHCTX ${APP_REGKEY} "Version" "${APP_VERSION_NUMBER}"
22 WriteRegStr SHCTX ${APP_REGKEY_SETUP} "LaTeX Path" $PathLaTeX
25 # There is only one shortcut to the application, so it should be in the main group
26 CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
27 CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${APP_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
29 ${if} $CreateDesktopIcon == "true"
30 SetOutPath "$INSTDIR\bin"
31 CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"
34 # Uninstaller information
35 ${If} $MultiUser.InstallMode == "CurrentUser"
36 WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayName" "${APP_NAME} ${APP_VERSION} $(TEXT_INSTALL_CURRENTUSER)"
38 WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayName" "${APP_NAME} ${APP_VERSION}"
41 WriteRegStr SHCTX ${APP_UNINST_KEY} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
42 WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
43 WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx,0"
44 WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "http://www.lyx.org/"
45 WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "http://www.lyx.org/about/"
46 WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "LyX Team"
47 WriteRegStr SHCTX ${APP_UNINST_KEY} "HelpLink" "http://www.lyx.org/internet/mailing.php"
48 WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoModify" 0x00000001
49 WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
50 WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
54 #--------------------------------
55 # Write LyX configuration file
59 # Associate .lyx files with LyX for current user of all users
61 ${if} $CreateFileAssociations == "true"
62 WriteRegStr HKLM "${APP_DIR_REGKEY}" "" "$INSTDIR\${APP_RUN}"
65 # Write information about file type
66 #!define REG_FILETYPE 'WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}"'
68 ${if} $CreateFileAssociations == "true"
69 WriteRegStr SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}" # special entry to test if they were registered by this LyX version
70 WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}" "" "${APP_NAME} Document"
71 WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\DefaultIcon" "" "$INSTDIR\${APP_RUN},0"
72 WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\Shell\open\command" "" '"$INSTDIR\${APP_RUN}" "%1"'
73 WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "" "${APP_REGNAME_DOC}"
74 WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "Content Type" "${APP_MIME_TYPE}"
76 WriteRegStr SHCTX "Software\Classes\${APP_EXT}13" "" "${APP_REGNAME_DOC}"
77 WriteRegStr SHCTX "Software\Classes\${APP_EXT}13" "Content Type" "${APP_MIME_TYPE}"
79 WriteRegStr SHCTX "Software\Classes\${APP_EXT}14" "" "${APP_REGNAME_DOC}"
80 WriteRegStr SHCTX "Software\Classes\${APP_EXT}14" "Content Type" "${APP_MIME_TYPE}"
82 WriteRegStr SHCTX "Software\Classes\${APP_EXT}15" "" "${APP_REGNAME_DOC}"
83 WriteRegStr SHCTX "Software\Classes\${APP_EXT}15" "Content Type" "${APP_MIME_TYPE}"
84 # .lyx16 don't set this, because this is designed to be opened with LyX 1.6.x
90 # Set path prefix in lyxrc.dist
92 # Install standard lyxrc.dist file
93 #SetOutPath "$INSTDIR\Resources"
94 #File "${FILES_DEPS}\Resources\lyxrc.dist"
96 # create the path prefix
97 # $$ represents a literal $ in an NSIS string
98 StrCpy $PathPrefix "$$LyXDir\bin;$$LyXDir\Python;$$LyXDir\Python\Lib;$$LyXDir\imagemagick"
100 ${if} $PathLaTeX != ""
101 StrCpy $PathPrefix "$PathPrefix;$PathLaTeX"
104 StrCpy $PathPrefix "$PathPrefix;$PSVPath"
106 ${if} $EditorPath != ""
107 StrCpy $PathPrefix "$PathPrefix;$EditorPath"
109 ${if} $ImageEditorPath != ""
110 StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
112 ${if} $GhostscriptPath != ""
113 StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
116 StrCpy $PathPrefix "$PathPrefix;$SVGPath"
119 StrCpy $PathPrefix "$PathPrefix;$WMFPath"
121 ${if} $GnumericPath != ""
122 StrCpy $PathPrefix "$PathPrefix;$GnumericPath"
124 ${if} $PathBibTeXEditor != ""
125 StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
127 ${if} $LilyPondPath != ""
128 StrCpy $PathPrefix "$PathPrefix;$LilyPondPath"
131 # Set the path prefix in lyxrc.dist
133 Delete "$INSTDIR\Resources\lyxrc.dist"
134 FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
136 FileWrite $R1 'Format 1$\r$\n'
137 # set some general things
138 FileWrite $R1 '\screen_zoom 120$\r$\n'
139 ${if} "$PathPrefix" != ""
140 FileWrite $R1 '\path_prefix "$PathPrefix"$\r$\n'
142 ${if} $Acrobat == "Yes" # use pdfview for Acrobat / Adobe Reader
143 FileWrite $R1 '\format "pdf5" "pdf" "PDF (LuaTeX)" "u" "pdfview" "" "document,vector,menu=export"$\r$\n\
144 \format "pdf4" "pdf" "PDF (XeTeX)" "X" "pdfview" "" "document,vector,menu=export"$\r$\n\
145 \format "pdf3" "pdf" "PDF (dvipdfm)" "m" "pdfview" "" "document,vector,menu=export"$\r$\n\
146 \format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector,menu=export"$\r$\n\
147 \format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector,menu=export"$\r$\n'
149 # if LilyPondPath was found
150 # we need to add these entris because python scripts can only be executed
151 # if the full path is given
152 ${if} $LilyPondPath != ""
153 FileWrite $R1 '\format "lilypond-book" "lytex" "LilyPond book (LaTeX)" "" "" "auto" "document,menu=export"$\r$\n\
154 \converter "lilypond-book" "pdflatex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=pdflatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
155 \converter "lilypond-book" "xetex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=xelatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
156 \converter "lilypond-book" "luatex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --pdf --latex-program=lualatex --lily-output-dir=ly-pdf $$$$i" ""$\r$\n\
157 \converter "lilypond-book" "latex" "python \"$LilyPondPath\\lilypond-book.py\" --safe --lily-output-dir=ly-eps $$$$i" ""$\r$\n'
161 MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
166 #--------------------------------
167 # Postscript printer for metafile to EPS converter
171 ${If} $MultiUser.Privileges == "Admin"
172 ${OrIf} $MultiUser.Privileges == "Power"
175 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
176 # Install printer and driver
177 ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
183 #--------------------------------
184 # Run the LyX configure.py script, so MiKTeX can download its packages
188 Section -ConfigureScript
190 SetOutPath "$INSTDIR\Resources"
191 DetailPrint $(TEXT_CONFIGURE_LYX)
192 nsExec::ExecToLog '"$INSTDIR\Python\python.exe" "$INSTDIR\Resources\configure.py"'
193 Pop $ConfigureReturn # Return value
195 # ask to update MiKTeX
196 ${if} $LaTeXInstalled == "MiKTeX"
197 Call UpdateMiKTeX # function from latex.nsh
198 # for new installations a second run is necessary to give the users feedback about
199 # the ongoing installation of LaTeX packages
200 # a new installed MiKTeX needs some time until it is ready to install packages
201 !if ${SETUPTYPE} == BUNDLE
202 nsExec::ExecToLog '"$INSTDIR\Python\python.exe" "$INSTDIR\Resources\configure.py"'
203 !endif # end if == BUNDLE
208 #--------------------------------
213 # run LyX in a command line window to give the users feedback about
214 # the time consuming LaTeX package installation
216 #Exec 'cmd /K " "$INSTDIR\bin\lyx.exe""'
217 Exec "$INSTDIR\${APP_RUN}"
221 /*Function CheckDesktopShortcut
223 # Enable desktop icon creation when there is an icon already
224 # Old shortcuts need to be updated
226 ${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
227 ${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
232 Function CreateDesktopShortcut
234 # Desktop icon creation is an option on the finish page
235 SetOutPath "$INSTDIR\bin"
236 CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"