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 #--------------------------------
17 Section -FileAssociations
19 # Associate .lyx files with LyX for current user of all users
21 # Write information about file type
22 !define REG_FILETYPE 'WriteRegStr SHELL_CONTEXT "Software\Classes\${APP_REGNAME_DOC}'
24 ${REG_FILETYPE}" "" "${APP_NAME} Document"
25 ${REG_FILETYPE}\DefaultIcon" "" "$INSTDIR\bin\LyXLauncher.exe,0"
26 ${REG_FILETYPE}\Shell\open\command" "" '"$INSTDIR\${APP_RUN}" "%1"'
28 !define REG_FILEEXT 'WriteRegStr SHELL_CONTEXT "Software\Classes\${APP_EXT}"'
30 ${REG_FILEEXT} "" "${APP_REGNAME_DOC}"
31 ${REG_FILEEXT} "Content Type" "${APP_MIME_TYPE}"
38 #--------------------------------
39 # Registry information
43 # Registry information
44 WriteRegStr SHELL_CONTEXT ${APP_REGKEY} "" $INSTDIR
45 WriteRegStr SHELL_CONTEXT ${APP_REGKEY} "Version" "${APP_VERSION_NUMBER}"
47 WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "LaTeX Path" $PathLaTeX
48 WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "ImageMagick Path" $PathImageMagick
49 WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "Ghostscript Path" $PathGhostscript
50 WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "LyX Language" $LangName
53 # There is only one shortcut to the application, so it should be in the main group
54 CreateShortCut "$SMPROGRAMS\${SHORTCUT}
56 # Uninstaller information
57 !define REG_UNINSTALL 'WriteRegStr SHELL_CONTEXT "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"'
59 ${If} $MultiUser.InstallMode == "CurrentUser"
60 ${REG_UNINSTALL} "DisplayName" "${APP_NAME} ${APP_VERSION} $(TEXT_INSTALL_CURRENTUSER)"
62 ${REG_UNINSTALL} "DisplayName" "${APP_NAME} ${APP_VERSION}"
65 ${REG_UNINSTALL} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
66 ${REG_UNINSTALL} "DisplayVersion" "${APP_VERSION}"
67 ${REG_UNINSTALL} "DisplayIcon" "$INSTDIR\bin\LyXLauncher,0"
68 ${REG_UNINSTALL} "URLUpdateInfo" "http://www.lyx.org/"
69 ${REG_UNINSTALL} "URLInfoAbout" "http://www.lyx.org/about/"
70 ${REG_UNINSTALL} "Publisher" "LyX Team"
71 ${REG_UNINSTALL} "HelpLink" "http://www.lyx.org/internet/mailing.php"
75 #--------------------------------
76 # Write LyX configuration file
80 # Windows specific configuration in lyxrc.dist
82 Delete "$INSTDIR\Resources\lyxrc.dist"
83 FileOpen $DistFile "$INSTDIR\Resources\lyxrc.dist" w
87 StrCpy $PathPrefix "$INSTDIR\bin;$INSTDIR\python"
89 !ifdef BUNDLE_IMAGEMAGICK
90 StrCpy $PathImageMagick "$INSTDIR\imagemagick"
92 !ifdef BUNDLE_GHOSTSCRIPT
93 StrCpy $PathGhostscript "$INSTDIR\ghostscript\bin"
96 ${If} $PathLaTeX != ""
97 StrCpy $PathPrefix "$PathPrefix;$PathLaTeX"
99 ${If} $PathGhostscript != ""
100 StrCpy $PathPrefix "$PathPrefix;$PathGhostscript"
102 ${If} $PathImageMagick != ""
103 StrCpy $PathPrefix "$PathPrefix;$PathImageMagick"
105 ${If} $PathBibTeXEditor != ""
106 StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
109 FileWrite $DistFile '\path_prefix "$PathPrefix"$\r$\n'
111 # Default screen fonts
112 FileWrite $DistFile '\screen_font_roman "Times New Roman"$\r$\n'
113 FileWrite $DistFile '\screen_font_sans "Arial"$\r$\n'
114 FileWrite $DistFile '\screen_font_typewriter "Courier New"$\r$\n'
115 FileWrite $DistFile '\preview_scale_factor 1.0$\r$\n' # Fit instant preview font size to screen fonts
117 FileWrite $DistFile '\format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector"$\r$\n'
118 FileWrite $DistFile '\format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector"$\r$\n'
119 FileWrite $DistFile '\format "pdf3" "pdf" "PDF (dvipdfm)" "m" "pdfview" "" "document,vector"$\r$\n'
124 WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETTINGS} "Language" $LangISOCode
128 #--------------------------------
135 # Install package in local root
137 ${if} $PathLaTeXLocal != ""
138 SetOutPath "$PathLaTeXLocal\tex\latex\dvipost"
139 File "${FILES_DVIPOST_PKG}\dvipost.sty"
142 # Update file name database
144 ${if} $PathLaTeX != ""
145 DetailPrint $(TEXT_CONFIGURE_MIKTEXFNDB)
146 nsExec::ExecToLog '"$PathLaTeX\initexmf.exe" --update-fndb'
147 Pop $UpdateFNDBReturn # Return value
152 #--------------------------------
153 # Postscript printer for metafile to EPS converter
157 ${If} $MultiUser.Privileges == "Admin"
158 ${OrIf} $MultiUser.Privileges == "Power"
161 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
163 # Delete printer driver
164 ExecWait '$PrinterConf /q /dd /m "Metafile to EPS Converter"'
166 # Install printer and driver
167 ExecWait '$PrinterConf /if /f "$INSTDIR\PSPrinter\metafile2eps.inf" /r "FILE:" /m "Metafile to EPS Converter"'
169 # Restore DEVMODE with proper settings
170 ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\PSPrinter\metafile2eps.dat" g'
176 #--------------------------------
177 # Run the LyX configure.py script, so MiKTeX can download its packages
181 Section -ConfigureScript
183 DetailPrint $(TEXT_CONFIGURE_LYX)
184 nsExec::ExecToLog '"$INSTDIR\python\python.exe" "$INSTDIR\Resources\configure.py"'
185 Pop $ConfigureReturn # Return value
189 #--------------------------------
192 Function CheckDesktopShortcut
194 # Enable desktop icon creation when there is an icon already
195 # Old shortcuts need to be updated
197 ${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
198 ${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
203 Function CreateDesktopShortcut
205 # Desktop icon creation is an option on the finish page
207 CreateShortCut "$DESKTOP\${SHORTCUT}