1 Function MissingPrograms
3 StrCpy $MissedProg "False"
5 ; test if MiKTeX is installed
6 ; read the PATH variable via the registry because NSIS' "$%Path%" variable is not updated when the PATH changes
7 ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
8 StrCpy $Search "miktex"
9 Call LaTeXCheck ; sets the path to the latex.exe to $LatexPath ; function from LyXUtils.nsh
10 ; check if MiKTeX 2.4 or 2.5 is installed
12 ReadRegStr $String HKLM "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
14 StrCpy $MiKTeXVersion "2.4" ; needed later for the configuration of MiKTeX
15 StrCpy $LaTeXName "MiKTeX 2.4"
18 ${if} $LatexPath == "" ; check if MiKTeX is installed only for the current user
19 ; check for MiKTeX 2.5
20 ReadRegStr $String HKCU "Environment" "Path"
21 StrCpy $Search "miktex"
22 Call LaTeXCheck ; function from LyXUtils.nsh
23 ${if} $LatexPath != ""
24 StrCpy $MiKTeXUser "HKCU" ; needed later to for a message about MiKTeX's install folder write permissions, see InstallActions-*.nsh
26 ; check for MiKTeX 2.4
28 ReadRegStr $String HKCU "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
30 StrCpy $MiKTeXVersion "2.4"
31 StrCpy $LaTeXName "MiKTeX 2.4"
35 ${if} $LatexPath != ""
36 StrCpy $MiKTeXInstalled "yes"
37 ${if} $LaTeXName != "MiKTeX 2.4"
38 StrCpy $LaTeXName "MiKTeX 2.5"
42 ; test if TeXLive is installed
43 ; as described at TeXLives' homepage there should be an entry in the PATH
44 ${if} $LatexPath == ""
45 ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
46 StrCpy $Search "TeXLive"
47 Call LaTeXCheck ; function from LyXUtils.nsh
49 ; check for the current user Path variable (the case when it is a live CD/DVD)
50 ${if} $LatexPath == ""
51 ReadRegStr $String HKCU "Environment" "Path"
52 StrCpy $Search "texlive"
54 Call LaTeXCheck ; function from LyXUtils.nsh
56 ; check if the variable TLroot exists (the case when it is installed using the program "tlpmgui")
57 ${if} $LatexPath == ""
58 ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "TLroot"
60 ReadRegStr $String HKCU "Environment" "TLroot" ; the case when installed without admin permissions
62 StrCpy $LatexPath "$String\bin\win32"
63 ; check if the latex.exe exists in the $LatexPath folder
64 !insertmacro FileCheck $5 "latex.exe" "$LatexPath" ; macro from LyXUtils.nsh
69 ${if} $LatexPath != ""
70 ${andif} $LaTeXName != "MiKTeX 2.4"
71 ${andif} $LaTeXName != "MiKTeX 2.5"
72 StrCpy $LaTeXName "TeXLive"
75 ; test if Ghostscript is installed
77 EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
79 EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
86 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
87 StrCpy $0 "Software\GPL Ghostscript\$1"
89 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName"
90 StrCpy $0 "Software\AFPL Ghostscript\$1"
92 ${if} $3 == "" ; if nothing was found in the uninstall section
93 ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; check if Ghostscript was installed together with LyX
95 ${if} $3 == "" ; if nothing was found in the uninstall section
96 DeleteRegKey HKLM "$0"
99 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
100 ${if} $GhostscriptPath != ""
101 StrCpy $GhostscriptPath "$GhostscriptPath" -12 ; remove ending "gsdll32.dll"
103 StrCpy $MissedProg "True"
107 StrCpy $GhostscriptPath ""
108 StrCpy $MissedProg "True"
111 ; test if Imagemagick is installed
112 ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
113 ${if} $ImageMagickPath == ""
114 StrCpy $MissedProg "True"
117 ; test if Aiksaurus is installed
118 !insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" ; macro from LyXUtils.nsh
120 StrCpy $AiksaurusPath "${AiksaurusDir}"
122 ; ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
124 ; test if Aspell is installed
126 ReadRegStr $5 HKCU "SOFTWARE\Aspell" "Base Path"
128 ReadRegStr $5 HKLM "SOFTWARE\Aspell" "Base Path"
129 StrCpy $AspellBaseReg "HKLM" ; used in the aspell installation section
131 StrCpy $AspellBaseReg "HKCU"
134 StrCpy $MissedProg "True"
136 StrCpy $AspellPath "$5"
139 ; test if Python is installed
140 ; only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
141 ; with outdated Python interpreters
142 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
143 ${if} $PythonPath != ""
144 StrCpy $0 $PythonPath "" -1 ; remove the "\" at the end
145 StrCpy $DelPythonFiles "True"
148 ; test if Acrobat or Adobe Reader is used as PDF-viewer
149 ReadRegStr $String HKCR ".pdf" ""
150 ${if} $String != "AcroExch.Document" ; this name is only used by Acrobat and Adobe Reader
151 StrCpy $Acrobat "None"
153 ${if} $Acrobat != "None"
154 ReadRegStr $String HKCR "AcroExch.Document\shell\open\command" ""
155 StrCpy $Search "8" ; search for Acrobat or Adobe Reader 8 because then PDFViewWin8.exe is needed to view PDF-files
156 !insertmacro StrPointer $String $Search $Pointer ; macro from LyXUtils
157 ${if} $Pointer == "-1" ; if nothing was found
164 ; test if a PostScript-viewer is installed, only check for GSview32
166 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
168 ; test if an editor with syntax-highlighting for LaTeX-files is installed (function in LyXUtils.nsh)
169 Call EditorCheck ; function from LyXUtils.nsh
171 ; test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
172 StrCpy $ImageEditorPath ""
173 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
174 ${if} $ImageEditorPath != ""
175 StrCpy $ImageEditorPath "$ImageEditorPath" -13 ; delete "\gimp-2.x.exe"
177 ; check for Photoshop
178 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
180 StrCpy $0 "$0" -1 ; delete the last "\"
181 ${if} $ImageEditorPath != ""
182 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
184 StrCpy $ImageEditorPath $0
188 ; test if the BibTeX-editor JabRef is installed
189 StrCpy $BibTeXEditorPath ""
190 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.1" "UninstallString"
191 ${if} $BibTeXEditorPath == ""
192 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.2" "UninstallString"
197 Function MissingProgramsPage
199 ; generate the installer page - re-read empty page first
201 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_missing_progs.ini"
202 !insertmacro MUI_HEADER_TEXT "$(MissProgHeader)" ""
204 ${if} $MissedProg == "False"
205 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 6" "Text" "$(MissProgMessage)"
207 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 1" "Text" "$(MissProgCap)"
208 ${if} ${INSTALLER_VERSION} == "Complete"
209 ${if} $LatexPath == ""
210 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgLatex)"
214 ${if} $GhostscriptPath == ""
215 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgGhostscript)"
218 ${if} $ImageMagickPath == ""
219 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgImageMagick)"
222 ${if} $AspellPath == ""
223 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgAspell)"
227 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_missing_progs.ini"
231 Function MissingProgramsPage_LeaveFunction