installer:

- fix 2 uninstaller issues
- remove support for AFPL Ghostscript (license clash)
- only install Ghostscript if not already installed
- in case there are several Ghostscript installations, use the newest one
- remove an unused variable

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39582 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2011-09-05 06:09:13 +00:00
parent 79f5d30c2c
commit 4810db1280
6 changed files with 26 additions and 43 deletions

View File

@ -99,10 +99,6 @@ Function LaTeXActions
${andif} $LaTeXName != "MiKTeX 2.9" ${andif} $LaTeXName != "MiKTeX 2.9"
StrCpy $LaTeXName "TeXLive" StrCpy $LaTeXName "TeXLive"
${endif} ${endif}
${if} $PathLaTeX == ""
StrCpy $MissedProg "True"
${endif}
FunctionEnd FunctionEnd

View File

@ -34,53 +34,30 @@ FunctionEnd
Function MissingPrograms Function MissingPrograms
# check if third-party programs are installed # check if third-party programs are installed
# initialize variable, is later set to True when a program was not found
${if} $MissedProg != "True" # is already True when LaTeX is missing
StrCpy $MissedProg "False"
${endif}
# test if Ghostscript is installed # test if Ghostscript is installed
StrCpy $3 0
GSloop: GSloop:
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0 EnumRegKey $1 HKLM "Software\GPL Ghostscript" $3
${if} $1 == ""
EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
${if} $1 != ""
StrCpy $2 "True"
${endif}
${endif}
${if} $1 != "" ${if} $1 != ""
${if} $2 == "True" ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName"
StrCpy $0 "Software\GPL Ghostscript\$1" StrCpy $0 "Software\GPL Ghostscript\$1"
${else} ${if} $2 == "" # if nothing was found in the uninstall section
ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AFPL Ghostscript $1" "DisplayName" ReadRegStr $2 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
StrCpy $0 "Software\AFPL Ghostscript\$1"
${endif} ${endif}
${if} $3 == "" # if nothing was found in the uninstall section ${if} $2 == "" # if nothing was found in the uninstall section
ReadRegStr $3 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX
${endif}
${if} $3 == "" # if nothing was found in the uninstall section
DeleteRegKey HKLM "$0" DeleteRegKey HKLM "$0"
goto GSloop goto GSloop
${else} ${else}
ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL" ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL"
${if} $GhostscriptPath != "" ${if} $GhostscriptPath != ""
StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll" StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll"
${else}
StrCpy $MissedProg "True"
${endif} ${endif}
${endif} # if $3 # there might be several versions installed and we want to use the newest one
${else} # if $1 IntOp $3 $3 + 1
StrCpy $GhostscriptPath "" goto GSloop
StrCpy $MissedProg "True" ${endif} # if $2
${endif} ${endif}
# test if Imagemagick is installed
#ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
#${if} $ImageMagickPath == ""
# StrCpy $MissedProg "True"
#${endif}
# test if Python is installed # test if Python is installed
# only use an existing python when it is version 2.5 or newer because some # only use an existing python when it is version 2.5 or newer because some
# older Compaq and Dell PCs were delivered with outdated Python interpreters # older Compaq and Dell PCs were delivered with outdated Python interpreters

View File

@ -33,7 +33,6 @@ Var LaTeXInstalled
Var LilyPondPath Var LilyPondPath
Var MiKTeXUser Var MiKTeXUser
Var MiKTeXVersion Var MiKTeXVersion
Var MissedProg
Var Pointer Var Pointer
Var PSVPath Var PSVPath
Var PythonPath Var PythonPath

View File

@ -95,7 +95,7 @@ Section -Configure
# create the path prefix # create the path prefix
# $$ represents a literal $ in an NSIS string # $$ represents a literal $ in an NSIS string
StrCpy $PathPrefix "$$LyXDir\bin;$$LyXDir\python;$$LyXDir\imagemagick;$$LyXDir\ghostscript" StrCpy $PathPrefix "$$LyXDir\bin;$$LyXDir\python;$$LyXDir\imagemagick"
${if} $PathLaTeX != "" ${if} $PathLaTeX != ""
StrCpy $PathPrefix "$PathPrefix;$PathLaTeX" StrCpy $PathPrefix "$PathPrefix;$PathLaTeX"
@ -108,6 +108,9 @@ Section -Configure
${endif} ${endif}
${if} $ImageEditorPath != "" ${if} $ImageEditorPath != ""
StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath" StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
${endif}
${if} $GhostscriptPath != ""
StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
${endif} ${endif}
${if} $SVGPath != "" ${if} $SVGPath != ""
StrCpy $PathPrefix "$PathPrefix;$SVGPath" StrCpy $PathPrefix "$PathPrefix;$SVGPath"

View File

@ -79,13 +79,16 @@ Section -ProgramFiles SecProgramFiles
WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "ConfigurePath" "$INSTDIR\imagemagick\config" WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "ConfigurePath" "$INSTDIR\imagemagick\config"
WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "$INSTDIR\imagemagick\modules\filters" WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "$INSTDIR\imagemagick\modules\filters"
WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "LibPath" "$INSTDIR\imagemagick" WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "LibPath" "$INSTDIR\imagemagick"
WriteRegDWORD SHCTX "SOFTWARE\ImageMagick\Current" "QuantumDepth" 0x00000010 WriteRegDWORD SHCTX "SOFTWARE\ImageMagick\Current" "QuantumDepth" 0x00000010
WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "Version" "${ImageMagickVersion}" WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "Version" "${ImageMagickVersion}"
# Components of Ghostscript # Components of Ghostscript
SetOutPath "$INSTDIR\ghostscript" ${if} $GhostscriptPath == ""
File /r "${FILES_GHOSTSCRIPT}\" SetOutPath "$INSTDIR\ghostscript"
!insertmacro FileListMSVC File "${FILES_MSVC}\" File /r "${FILES_GHOSTSCRIPT}\"
!insertmacro FileListMSVC File "${FILES_MSVC}\"
StrCpy $GhostscriptPath "$INSTDIR\ghostscript\bin"
${endif}
!if ${SETUPTYPE} == BUNDLE !if ${SETUPTYPE} == BUNDLE

View File

@ -94,6 +94,11 @@ Section "un.LyX" un.SecUnProgramFiles
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"' ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
${EndIf} ${EndIf}
# clean other registry entries
DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
SectionEnd SectionEnd