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\${APP_RUN},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
50 # There is only one shortcut to the application, so it should be in the main group
51 SetOutPath "$INSTDIR\bin"
52 CreateShortCut "$SMPROGRAMS\${SHORTCUT}
54 # Uninstaller information
55 !define REG_UNINSTALL 'WriteRegStr SHELL_CONTEXT "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"'
57 ${If} $MultiUser.InstallMode == "CurrentUser"
58 ${REG_UNINSTALL} "DisplayName" "${APP_NAME} ${APP_VERSION} $(TEXT_INSTALL_CURRENTUSER)"
60 ${REG_UNINSTALL} "DisplayName" "${APP_NAME} ${APP_VERSION}"
63 ${REG_UNINSTALL} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
64 ${REG_UNINSTALL} "DisplayVersion" "${APP_VERSION}"
65 ${REG_UNINSTALL} "DisplayIcon" "$INSTDIR\bin\LyXLauncher,0"
66 ${REG_UNINSTALL} "URLUpdateInfo" "http://www.lyx.org/"
67 ${REG_UNINSTALL} "URLInfoAbout" "http://www.lyx.org/about/"
68 ${REG_UNINSTALL} "Publisher" "LyX Team"
69 ${REG_UNINSTALL} "HelpLink" "http://www.lyx.org/internet/mailing.php"
73 #--------------------------------
74 # Write LyX configuration file
78 # Set path prefix in lyxrc.dist
80 # Install standard lyxrc.dist file
81 SetOutPath "$INSTDIR\Resources"
82 File "${FILES_DEPS}\Resources\lyxrc.dist"
85 FileOpen $DistFile "$INSTDIR\Resources\lyxrc.dist" a
86 FileSeek $DistFile 0 END
88 # $$ represents a literal $ in an NSIS string
89 StrCpy $PathPrefix "$$LyXDir\bin;$$LyXDir\python;$$LyXDir\imagemagick;$$LyXDir\ghostscript"
91 ${If} $PathLaTeX != ""
92 StrCpy $PathPrefix "$PathPrefix;$PathLaTeX"
94 ${If} $PathBibTeXEditor != ""
95 StrCpy $PathPrefix "$PathPrefix;$PathBibTeXEditor"
98 FileWrite $DistFile '\path_prefix "$PathPrefix"$\r$\n'
104 #--------------------------------
111 # Install files in local root
113 ${If} $PathLaTeXLocal != ""
115 SetOutPath "$PathLaTeXLocal\tex\latex\dvipost"
116 File "${FILES_DVIPOST_PKG}\dvipost.sty"
117 # LyX files in Resources\tex
118 SetOutPath "$PathLaTeXLocal\tex\latex\lyx"
119 CopyFiles /SILENT "$INSTDIR\Resources\tex\*.*" "$PathLaTeXLocal\tex\latex\lyx"
122 # Update file name database
124 ${If} $PathLaTeX != ""
125 DetailPrint $(TEXT_CONFIGURE_MIKTEXFNDB)
126 nsExec::ExecToLog '"$PathLaTeX\initexmf.exe" --update-fndb'
127 Pop $UpdateFNDBReturn # Return value
132 #--------------------------------
133 # Postscript printer for metafile to EPS converter
137 ${If} $MultiUser.Privileges == "Admin"
138 ${OrIf} $MultiUser.Privileges == "Power"
141 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
142 # Install printer and driver
143 ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"'
144 # Restore DEVMODE with proper settings
145 ExecWait '$PrinterConf /q /Sr /n "Metafile to EPS Converter" /a "$INSTDIR\bin\metafile2eps.dat" g'
151 #--------------------------------
152 # Run the LyX configure.py script, so MiKTeX can download its packages
156 Section -ConfigureScript
158 SetOutPath "$INSTDIR\Resources"
159 DetailPrint $(TEXT_CONFIGURE_LYX)
160 nsExec::ExecToLog '"$INSTDIR\python\python.exe" "$INSTDIR\Resources\configure.py"'
161 Pop $ConfigureReturn # Return value
165 #--------------------------------
168 Function CheckDesktopShortcut
170 # Enable desktop icon creation when there is an icon already
171 # Old shortcuts need to be updated
173 ${If} ${FileExists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
174 ${NSD_SetState} $mui.FinishPage.ShowReadme ${BST_CHECKED}
179 Function CreateDesktopShortcut
181 # Desktop icon creation is an option on the finish page
182 SetOutPath "$INSTDIR\bin"
183 CreateShortCut "$DESKTOP\${SHORTCUT}