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\LyXLauncher,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\imagemagick;$$LyXDir\ghostscript"
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"
113 StrCpy $PathPrefix "$PathPrefix;$SVGPath"
116 StrCpy $PathPrefix "$PathPrefix;$WMFPath"
118 ${If} $PathBibTeXEditor != ""
119 StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
122 # Set the path prefix in lyxrc.dist
124 Delete "$INSTDIR\Resources\lyxrc.dist"
125 FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
126 # set some general things
127 FileWrite $R1 '\screen_zoom "120"$\r$\n\
128 \accept_compound true$\r$\n'
129 ${if} "$PathPrefix" != ""
130 FileWrite $R1 '\path_prefix "$PathPrefix"$\r$\n'
132 # if a SVG to PDF converter ws found (e.g. Inkscape)
134 FileWrite $R1 '\format "svg" "svg" "SVG" "" "inkscape --file=$$$$i" "inkscape --file=$$$$i" "vector"$\r$\n\
135 \converter "svg" "png" "inkscape --without-gui --file=$$$$i --export-png=$$$$o" ""$\r$\n\
136 \converter "svg" "pdf" "inkscape --file=$$$$p/$$$$i --export-area-drawing --without-gui --export-pdf=$$$$p/$$$$o" ""$\r$\n\
137 \converter "svg" "eps" "inkscape --file=$$$$p/$$$$i --export-area-drawing --without-gui --export-eps=$$$$p/$$$$o" ""'
141 MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
146 #--------------------------------
149 /*Var UpdateFNDBReturn
153 # Install files in local root
155 ${If} $PathLaTeXLocal != ""
157 SetOutPath "$PathLaTeXLocal\tex\latex\dvipost"
158 File "${FILES_DVIPOST_PKG}\dvipost.sty"
159 # LyX files in Resources\tex
160 SetOutPath "$PathLaTeXLocal\tex\latex\lyx"
161 CopyFiles /SILENT "$INSTDIR\Resources\tex\*.*" "$PathLaTeXLocal\tex\latex\lyx"
164 # Update file name database
166 ${If} $PathLaTeX != ""
167 DetailPrint $(TEXT_CONFIGURE_MIKTEXFNDB)
168 nsExec::ExecToLog '"$PathLaTeX\initexmf.exe" --update-fndb'
169 Pop $UpdateFNDBReturn # Return value
174 #--------------------------------
175 # Postscript printer for metafile to EPS converter
179 ${If} $MultiUser.Privileges == "Admin"
180 ${OrIf} $MultiUser.Privileges == "Power"
183 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
184 # Install printer and driver
185 ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
186 # Restore DEVMODE with proper settings
187 ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\bin\metafile2eps.dat" g'
193 #--------------------------------
194 # Run the LyX configure.py script, so MiKTeX can download its packages
198 Section -ConfigureScript
200 SetOutPath "$INSTDIR\Resources"
201 DetailPrint $(TEXT_CONFIGURE_LYX)
202 nsExec::ExecToLog '"$INSTDIR\python\python.exe" "$INSTDIR\Resources\configure.py"'
203 Pop $ConfigureReturn # Return value
205 # ask to update MiKTeX
206 ${if} $LaTeXInstalled == "MiKTeX"
207 Call UpdateMiKTeX # function from latex.nsh
212 #--------------------------------
217 # Enable desktop icon creation when there is an icon already
218 # Old shortcuts need to be updated
220 Exec "$INSTDIR\${APP_RUN}"
224 /*Function CheckDesktopShortcut
226 # Enable desktop icon creation when there is an icon already
227 # Old shortcuts need to be updated
229 ${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
230 ${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
235 Function CreateDesktopShortcut
237 # Desktop icon creation is an option on the finish page
238 SetOutPath "$INSTDIR\bin"
239 CreateShortCut "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"