1 Function MissingPrograms
2 # check if third-party programs are installed
4 # initialize variable, is later set to True when a program was not found
5 ${if} $MissedProg != "True" # is already True when LaTeX is missing
6 StrCpy $MissedProg "False"
9 # test if Ghostscript is installed
11 EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
13 EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
20 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
21 StrCpy $0 "Software\GPL Ghostscript\$1"
23 ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName"
24 StrCpy $0 "Software\AFPL Ghostscript\$1"
26 ${if} $3 == "" # if nothing was found in the uninstall section
27 ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
29 ${if} $3 == "" # if nothing was found in the uninstall section
30 DeleteRegKey HKLM "$0"
33 ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
34 ${if} $GhostscriptPath != ""
35 StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
37 StrCpy $MissedProg "True"
41 StrCpy $GhostscriptPath ""
42 StrCpy $MissedProg "True"
45 # test if Imagemagick is installed
46 ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
47 ${if} $ImageMagickPath == ""
48 StrCpy $MissedProg "True"
51 # test if Aiksaurus is installed
52 !insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" # macro from LyXUtils.nsh
54 StrCpy $AiksaurusPath "${AiksaurusDir}"
56 # ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
58 # test if Aspell is installed
60 ReadRegStr $5 HKCU "SOFTWARE\Aspell" "Base Path"
62 ReadRegStr $5 HKLM "SOFTWARE\Aspell" "Base Path"
63 StrCpy $AspellBaseReg "HKLM" # used in the aspell installation section
65 StrCpy $AspellBaseReg "HKCU"
68 StrCpy $MissedProg "True"
70 StrCpy $AspellPath "$5"
73 # test if Python is installed
74 # only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
75 # with outdated Python interpreters
76 ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
77 ${if} $PythonPath != ""
78 StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
79 StrCpy $DelPythonFiles "True"
82 # test if Acrobat or Adobe Reader is used as PDF-viewer
83 ReadRegStr $String HKCR ".pdf" ""
84 ${if} $String != "AcroExch.Document" # this name is only used by Acrobat and Adobe Reader
85 StrCpy $Acrobat "None"
90 # test if a PostScript-viewer is installed, only check for GSview32
92 ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
94 # test if an editor with syntax-highlighting for LaTeX-files is installed
97 # test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
98 StrCpy $ImageEditorPath ""
99 ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
100 ${if} $ImageEditorPath != ""
101 StrCpy $ImageEditorPath "$ImageEditorPath" -13 # delete "\gimp-2.x.exe"
103 # check for Photoshop
104 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
106 StrCpy $0 "$0" -1 # delete the last "\"
107 ${if} $ImageEditorPath != ""
108 StrCpy $ImageEditorPath "$ImageEditorPath;$0"
110 StrCpy $ImageEditorPath $0
114 # test if the BibTeX-editor JabRef is installed
115 StrCpy $BibTeXEditorPath ""
116 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.1" "UninstallString"
117 ${if} $BibTeXEditorPath == ""
118 ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.2" "UninstallString"
123 # ---------------------------------------
125 Function MissingProgramsPage
126 # generate the page showing the missing programs that will be installed
128 StrCpy $0 "2" # start value for the dynamical item numbering
129 !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_missing_progs.ini"
130 !insertmacro MUI_HEADER_TEXT "$(MissProgHeader)" ""
132 ${if} $MissedProg == "False"
133 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 6" "Text" "$(MissProgMessage)"
135 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 1" "Text" "$(MissProgCap)"
136 ${if} ${INSTALLER_VERSION} == "Complete"
137 ${if} $LatexPath == ""
138 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgLatex)"
142 ${if} $GhostscriptPath == ""
143 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgGhostscript)"
146 ${if} $ImageMagickPath == ""
147 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgImageMagick)"
150 ${if} $AspellPath == ""
151 !insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgAspell)"
155 !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_missing_progs.ini"
159 # ---------------------------------------
161 Function MissingProgramsPage_LeaveFunction
163 # this empty function is needed for the installer page
167 # ---------------------------------------
170 # test if an editor with syntax-highlighting for LaTeX-files is installed
172 # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
173 StrCpy $EditorPath ""
176 ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
177 ${if} $EditorPath != ""
178 StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
182 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
185 StrCpy $EditorPath "$EditorPath;$0"
189 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
192 StrCpy $EditorPath "$EditorPath;$0"
196 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
199 StrCpy $EditorPath "$EditorPath;$0"
201 # check for Crimson Editor
203 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Crimson Editor" "UninstallString"
205 StrCpy $0 $0 -14 # remove "\uninstall.exe"
206 StrCpy $EditorPath "$EditorPath;$0"
210 ReadRegStr $0 HKLM "Software\Classes\Applications\gvim.exe\shell\edit\command" ""
212 StrCpy $0 $0 -13 # remove "gvim.exe "%1""
213 StrCpy $EditorPath "$EditorPath;$0"
217 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0" "UninstallString"
219 StrCpy $0 $0 -18 # remove "\uninstall-gui.exe"
220 StrCpy $EditorPath "$EditorPath;$0"
222 # check for TeXnicCenter
224 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "Inno Setup: App Path"
226 StrCpy $EditorPath "$EditorPath;$0"
228 # check for LaTeXEditor
230 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
232 StrCpy $EditorPath "$EditorPath;$0"
236 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
239 StrCpy $EditorPath "$EditorPath;$0"
243 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LEd_is1" "InstallLocation"
246 StrCpy $EditorPath "$EditorPath;$0"
250 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
252 StrCpy $0 $0 -11 # remove "\wintex.exe"
253 StrCpy $EditorPath "$EditorPath;$0"