1 Function MissingPrograms
3 ; initialize variable, is later set to True when a program was not found
4 StrCpy $MissedProg "False"
6 ; test if Ghostscript is installed
8 EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
10 EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
17 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
18 StrCpy $0 "Software\GPL Ghostscript\$1"
20 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName"
21 StrCpy $0 "Software\AFPL Ghostscript\$1"
23 ${if} $3 == "" ; if nothing was found in the uninstall section
24 ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; check if Ghostscript was installed together with LyX
26 ${if} $3 == "" ; if nothing was found in the uninstall section
27 DeleteRegKey HKLM "$0"
30 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
31 ${if} $GhostscriptPath != ""
32 StrCpy $GhostscriptPath "$GhostscriptPath" -12 ; remove ending "gsdll32.dll"
34 StrCpy $MissedProg "True"
38 StrCpy $GhostscriptPath ""
39 StrCpy $MissedProg "True"
42 ; test if Imagemagick is installed
43 ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
44 ${if} $ImageMagickPath == ""
45 StrCpy $MissedProg "True"
48 ; test if Aiksaurus is installed
49 !insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" ; macro from LyXUtils.nsh
51 StrCpy $AiksaurusPath "${AiksaurusDir}"
53 ; ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
55 ; test if Aspell is installed
57 ReadRegStr $5 HKCU "SOFTWARE\Aspell" "Base Path"
59 ReadRegStr $5 HKLM "SOFTWARE\Aspell" "Base Path"
60 StrCpy $AspellBaseReg "HKLM" ; used in the aspell installation section
62 StrCpy $AspellBaseReg "HKCU"
65 StrCpy $MissedProg "True"
67 StrCpy $AspellPath "$5"
70 ; test if Python is installed
71 ; only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
72 ; with outdated Python interpreters
73 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
74 ${if} $PythonPath != ""
75 StrCpy $PythonPath $PythonPath -1 ; remove the "\" at the end
76 StrCpy $DelPythonFiles "True"
79 ; test if Acrobat or Adobe Reader is used as PDF-viewer
80 ReadRegStr $String HKCR ".pdf" ""
81 ${if} $String != "AcroExch.Document" ; this name is only used by Acrobat and Adobe Reader
82 StrCpy $Acrobat "None"
84 ${if} $Acrobat != "None"
85 ReadRegStr $String HKCR "AcroExch.Document\shell\open\command" ""
86 StrCpy $Search "8" ; search for Acrobat or Adobe Reader 8 because then PDFViewWin8.exe is needed to view PDF-files
87 !insertmacro StrPointer $String $Search $Pointer ; macro from LyXUtils
88 ${if} $Pointer == "-1" ; if nothing was found
95 ; test if a PostScript-viewer is installed, only check for GSview32
97 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
99 ; test if an editor with syntax-highlighting for LaTeX-files is installed
102 ; test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
103 StrCpy $ImageEditorPath ""
104 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
105 ${if} $ImageEditorPath != ""
106 StrCpy $ImageEditorPath "$ImageEditorPath" -13 ; delete "\gimp-2.x.exe"
108 ; check for Photoshop
109 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
111 StrCpy $0 "$0" -1 ; delete the last "\"
112 ${if} $ImageEditorPath != ""
113 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
115 StrCpy $ImageEditorPath $0
119 ; test if the BibTeX-editor JabRef is installed
120 StrCpy $BibTeXEditorPath ""
121 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.1" "UninstallString"
122 ${if} $BibTeXEditorPath == ""
123 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.2" "UninstallString"
128 ; ---------------------------------------
130 Function MissingProgramsPage
132 ; generate the installer page - re-read empty page first
134 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_missing_progs.ini"
135 !insertmacro MUI_HEADER_TEXT "$(MissProgHeader)" ""
137 ${if} $MissedProg == "False"
138 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 6" "Text" "$(MissProgMessage)"
140 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 1" "Text" "$(MissProgCap)"
141 ${if} ${INSTALLER_VERSION} == "Complete"
142 ${if} $LatexPath == ""
143 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgLatex)"
147 ${if} $GhostscriptPath == ""
148 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgGhostscript)"
151 ${if} $ImageMagickPath == ""
152 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgImageMagick)"
155 ${if} $AspellPath == ""
156 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgAspell)"
160 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_missing_progs.ini"
164 ; ---------------------------------------
166 Function MissingProgramsPage_LeaveFunction
168 ; this function is needed for the installer page
172 ; ---------------------------------------
176 ; test if an editor with syntax-highlighting for LaTeX-files is installed
177 ; (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
178 StrCpy $EditorPath ""
181 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
182 ${if} $EditorPath != ""
183 StrCpy $EditorPath $EditorPath -1 ; remove "\" from the end of the string
187 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
190 StrCpy $EditorPath "$EditorPath;$0"
194 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
197 StrCpy $EditorPath "$EditorPath;$0"
201 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
204 StrCpy $EditorPath "$EditorPath;$0"
206 ; check for Crimson Editor
208 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Crimson Editor" "UninstallString"
210 StrCpy $0 $0 -14 ; remove "\uninstall.exe"
211 StrCpy $EditorPath "$EditorPath;$0"
215 ReadRegStr $0 HKLM "Software\Classes\Applications\gvim.exe\shell\edit\command" ""
217 StrCpy $0 $0 -13 ; remove "gvim.exe "%1""
218 StrCpy $EditorPath "$EditorPath;$0"
222 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0" "UninstallString"
224 StrCpy $0 $0 -18 ; remove "\uninstall-gui.exe"
225 StrCpy $EditorPath "$EditorPath;$0"
227 ; check for TeXnicCenter
229 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "Inno Setup: App Path"
231 StrCpy $EditorPath "$EditorPath;$0"
233 ; check for LaTeXEditor
235 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
237 StrCpy $EditorPath "$EditorPath;$0"
241 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
244 StrCpy $EditorPath "$EditorPath;$0"
248 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LEd_is1" "InstallLocation"
251 StrCpy $EditorPath "$EditorPath;$0"
255 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
257 StrCpy $0 $0 -11 ; remove "\wintex.exe"
258 StrCpy $EditorPath "$EditorPath;$0"