2007-05-25 09:39:18 +00:00
|
|
|
# This script contains the following functions:
|
|
|
|
#
|
|
|
|
# - MissingPrograms, (check if third-party programs are installed), uses:
|
|
|
|
# EditorCheck
|
|
|
|
# FileCheck
|
|
|
|
#
|
|
|
|
# - MissingProgramsPage,
|
|
|
|
# (generate the page showing the missing programs that will be installed)
|
|
|
|
#
|
|
|
|
# - EditorCheck,
|
|
|
|
# (test if an editor with syntax-highlighting for LaTeX-files is installed)
|
|
|
|
#
|
|
|
|
#--------------------------
|
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
Function MissingPrograms
|
2007-05-15 22:43:05 +00:00
|
|
|
# check if third-party programs are installed
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# initialize variable, is later set to True when a program was not found
|
2007-05-15 22:43:05 +00:00
|
|
|
${if} $MissedProg != "True" # is already True when LaTeX is missing
|
|
|
|
StrCpy $MissedProg "False"
|
|
|
|
${endif}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Ghostscript is installed
|
2007-02-08 21:09:30 +00:00
|
|
|
GSloop:
|
|
|
|
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
|
|
|
|
${if} $1 == ""
|
|
|
|
EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
|
|
|
|
${if} $1 != ""
|
|
|
|
StrCpy $2 "True"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
${if} $1 != ""
|
|
|
|
${if} $2 == "True"
|
|
|
|
ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
|
|
|
|
StrCpy $0 "Software\GPL Ghostscript\$1"
|
|
|
|
${else}
|
|
|
|
ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName"
|
|
|
|
StrCpy $0 "Software\AFPL Ghostscript\$1"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
${if} $3 == "" # if nothing was found in the uninstall section
|
|
|
|
ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
|
2007-02-08 21:09:30 +00:00
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
${if} $3 == "" # if nothing was found in the uninstall section
|
2007-02-08 21:09:30 +00:00
|
|
|
DeleteRegKey HKLM "$0"
|
|
|
|
goto GSloop
|
|
|
|
${else}
|
|
|
|
ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
|
|
|
|
${if} $GhostscriptPath != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
|
2007-02-08 21:09:30 +00:00
|
|
|
${else}
|
|
|
|
StrCpy $MissedProg "True"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
${endif} # if $3
|
|
|
|
${else} # if $1
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $GhostscriptPath ""
|
|
|
|
StrCpy $MissedProg "True"
|
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Imagemagick is installed
|
2007-02-08 21:09:30 +00:00
|
|
|
ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
|
|
|
|
${if} $ImageMagickPath == ""
|
|
|
|
StrCpy $MissedProg "True"
|
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Aiksaurus is installed
|
|
|
|
!insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" # macro from LyXUtils.nsh
|
2007-02-08 21:09:30 +00:00
|
|
|
${if} $5 == "True"
|
|
|
|
StrCpy $AiksaurusPath "${AiksaurusDir}"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Aspell is installed
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $5 ""
|
|
|
|
ReadRegStr $5 HKCU "SOFTWARE\Aspell" "Base Path"
|
|
|
|
${if} $5 == ""
|
|
|
|
ReadRegStr $5 HKLM "SOFTWARE\Aspell" "Base Path"
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $AspellBaseReg "HKLM" # used in the aspell installation section
|
2007-02-08 21:09:30 +00:00
|
|
|
${else}
|
|
|
|
StrCpy $AspellBaseReg "HKCU"
|
|
|
|
${endif}
|
|
|
|
${if} $5 == ""
|
|
|
|
StrCpy $MissedProg "True"
|
|
|
|
${else}
|
|
|
|
StrCpy $AspellPath "$5"
|
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Python is installed
|
|
|
|
# only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
|
|
|
|
# with outdated Python interpreters
|
2007-02-08 21:09:30 +00:00
|
|
|
ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
|
|
|
|
${if} $PythonPath != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $DelPythonFiles "True"
|
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if Acrobat or Adobe Reader is used as PDF-viewer
|
2007-02-08 21:09:30 +00:00
|
|
|
ReadRegStr $String HKCR ".pdf" ""
|
2007-05-01 17:55:54 +00:00
|
|
|
${if} $String != "AcroExch.Document" # this name is only used by Acrobat and Adobe Reader
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $Acrobat "None"
|
2007-05-07 01:19:52 +00:00
|
|
|
${else}
|
|
|
|
StrCpy $Acrobat "Yes"
|
2007-02-08 21:09:30 +00:00
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if a PostScript-viewer is installed, only check for GSview32
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $PSVPath ""
|
|
|
|
ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if an editor with syntax-highlighting for LaTeX-files is installed
|
2007-04-24 22:08:27 +00:00
|
|
|
Call EditorCheck
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $ImageEditorPath ""
|
|
|
|
ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
|
|
|
|
${if} $ImageEditorPath != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $ImageEditorPath "$ImageEditorPath" -13 # delete "\gimp-2.x.exe"
|
2007-02-08 21:09:30 +00:00
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for Photoshop
|
2007-02-08 21:09:30 +00:00
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
|
|
|
|
${if} $0 != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $0 "$0" -1 # delete the last "\"
|
2007-02-08 21:09:30 +00:00
|
|
|
${if} $ImageEditorPath != ""
|
|
|
|
StrCpy $ImageEditorPath "$ImageEditorPath;$0"
|
|
|
|
${else}
|
|
|
|
StrCpy $ImageEditorPath $0
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if the BibTeX-editor JabRef is installed
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $BibTeXEditorPath ""
|
|
|
|
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.1" "UninstallString"
|
|
|
|
${if} $BibTeXEditorPath == ""
|
|
|
|
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.2" "UninstallString"
|
|
|
|
${endif}
|
2007-12-17 22:34:35 +00:00
|
|
|
${if} $BibTeXEditorPath == ""
|
|
|
|
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.3" "UninstallString"
|
|
|
|
${endif}
|
|
|
|
${if} $BibTeXEditorPath == ""
|
|
|
|
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.3.1" "UninstallString"
|
|
|
|
${endif}
|
2007-05-25 09:39:18 +00:00
|
|
|
|
|
|
|
# test if Inkscape is installed
|
|
|
|
ReadRegStr $SVGPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" "InstallLocation"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# ---------------------------------------
|
2007-04-24 22:08:27 +00:00
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
Function MissingProgramsPage
|
2007-05-15 22:43:05 +00:00
|
|
|
# generate the page showing the missing programs that will be installed
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-05-15 22:43:05 +00:00
|
|
|
StrCpy $0 "2" # start value for the dynamical item numbering
|
2007-02-08 21:09:30 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_missing_progs.ini"
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(MissProgHeader)" ""
|
|
|
|
|
|
|
|
${if} $MissedProg == "False"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 6" "Text" "$(MissProgMessage)"
|
|
|
|
${else}
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field 1" "Text" "$(MissProgCap)"
|
|
|
|
${if} ${INSTALLER_VERSION} == "Complete"
|
|
|
|
${if} $LatexPath == ""
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgLatex)"
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
${if} $GhostscriptPath == ""
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgGhostscript)"
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
${endif}
|
|
|
|
${if} $ImageMagickPath == ""
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgImageMagick)"
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
${endif}
|
|
|
|
${if} $AspellPath == ""
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_missing_progs.ini" "Field $0" "Text" "$(MissProgAspell)"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_missing_progs.ini"
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# ---------------------------------------
|
2007-04-24 22:08:27 +00:00
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
Function MissingProgramsPage_LeaveFunction
|
|
|
|
|
2007-05-15 22:43:05 +00:00
|
|
|
# this empty function is needed for the installer page
|
2007-04-24 22:08:27 +00:00
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# ---------------------------------------
|
2007-04-24 22:08:27 +00:00
|
|
|
|
|
|
|
Function EditorCheck
|
2007-05-01 17:55:54 +00:00
|
|
|
# test if an editor with syntax-highlighting for LaTeX-files is installed
|
2007-05-15 22:43:05 +00:00
|
|
|
|
2007-05-01 17:55:54 +00:00
|
|
|
# (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $EditorPath ""
|
|
|
|
StrCpy $0 ""
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for jEdit
|
2007-04-24 22:08:27 +00:00
|
|
|
ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
|
|
|
|
${if} $EditorPath != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
|
2007-04-24 22:08:27 +00:00
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for PSPad
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $0 $0 -1
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for WinShell
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $0 $0 -1
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for ConTEXT
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $0 $0 -1
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for Crimson Editor
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Crimson Editor" "UninstallString"
|
|
|
|
${if} $0 != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $0 $0 -14 # remove "\uninstall.exe"
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for Vim 6.x
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Classes\Applications\gvim.exe\shell\edit\command" ""
|
|
|
|
${if} $0 != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $0 $0 -13 # remove "gvim.exe "%1""
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for Vim 7.0
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0" "UninstallString"
|
|
|
|
${if} $0 != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $0 $0 -18 # remove "\uninstall-gui.exe"
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for TeXnicCenter
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "Inno Setup: App Path"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for LaTeXEditor
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for WinEdt
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $0 $0 -1
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for LEd
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LEd_is1" "InstallLocation"
|
|
|
|
${if} $0 != ""
|
|
|
|
StrCpy $0 $0 -1
|
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
2007-05-01 17:55:54 +00:00
|
|
|
# check for WinTeX
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $0 ""
|
|
|
|
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
|
|
|
|
${if} $0 != ""
|
2007-05-01 17:55:54 +00:00
|
|
|
StrCpy $0 $0 -11 # remove "\wintex.exe"
|
2007-04-24 22:08:27 +00:00
|
|
|
StrCpy $EditorPath "$EditorPath;$0"
|
|
|
|
${endif}
|
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
FunctionEnd
|
2007-04-24 22:08:27 +00:00
|
|
|
|