diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh b/development/Win32/packaging/installer/include/LaTeX.nsh index ec51d73048..735e51dc18 100644 --- a/development/Win32/packaging/installer/include/LaTeX.nsh +++ b/development/Win32/packaging/installer/include/LaTeX.nsh @@ -99,10 +99,6 @@ Function LaTeXActions ${andif} $LaTeXName != "MiKTeX 2.9" StrCpy $LaTeXName "TeXLive" ${endif} - - ${if} $PathLaTeX == "" - StrCpy $MissedProg "True" - ${endif} FunctionEnd diff --git a/development/Win32/packaging/installer/include/detection.nsh b/development/Win32/packaging/installer/include/detection.nsh index 57e9b229ca..e5f761d362 100644 --- a/development/Win32/packaging/installer/include/detection.nsh +++ b/development/Win32/packaging/installer/include/detection.nsh @@ -34,53 +34,30 @@ FunctionEnd Function MissingPrograms # 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 + StrCpy $3 0 GSloop: - EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0 - ${if} $1 == "" - EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0 - ${if} $1 != "" - StrCpy $2 "True" - ${endif} - ${endif} + EnumRegKey $1 HKLM "Software\GPL Ghostscript" $3 ${if} $1 != "" - ${if} $2 == "True" - ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "DisplayName" + ReadRegStr $2 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" + ${if} $2 == "" # if nothing was found in the uninstall section + ReadRegStr $2 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" # check if Ghostscript was installed together with LyX ${endif} - ${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 - ${endif} - ${if} $3 == "" # if nothing was found in the uninstall section + ${if} $2 == "" # if nothing was found in the uninstall section DeleteRegKey HKLM "$0" goto GSloop ${else} ReadRegStr $GhostscriptPath HKLM $0 "GS_DLL" ${if} $GhostscriptPath != "" StrCpy $GhostscriptPath "$GhostscriptPath" -12 # remove ending "gsdll32.dll" - ${else} - StrCpy $MissedProg "True" ${endif} - ${endif} # if $3 - ${else} # if $1 - StrCpy $GhostscriptPath "" - StrCpy $MissedProg "True" + # there might be several versions installed and we want to use the newest one + IntOp $3 $3 + 1 + goto GSloop + ${endif} # if $2 ${endif} - # test if Imagemagick is installed - #ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath" - #${if} $ImageMagickPath == "" - # StrCpy $MissedProg "True" - #${endif} - # test if Python is installed # 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 diff --git a/development/Win32/packaging/installer/include/variables.nsh b/development/Win32/packaging/installer/include/variables.nsh index 7f7474a2d3..eca0397864 100644 --- a/development/Win32/packaging/installer/include/variables.nsh +++ b/development/Win32/packaging/installer/include/variables.nsh @@ -33,7 +33,6 @@ Var LaTeXInstalled Var LilyPondPath Var MiKTeXUser Var MiKTeXVersion -Var MissedProg Var Pointer Var PSVPath Var PythonPath diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh index 83a915a1d9..a2228372f1 100644 --- a/development/Win32/packaging/installer/setup/configure.nsh +++ b/development/Win32/packaging/installer/setup/configure.nsh @@ -95,7 +95,7 @@ Section -Configure # create the path prefix # $$ 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 != "" StrCpy $PathPrefix "$PathPrefix;$PathLaTeX" @@ -108,6 +108,9 @@ Section -Configure ${endif} ${if} $ImageEditorPath != "" StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath" + ${endif} + ${if} $GhostscriptPath != "" + StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath" ${endif} ${if} $SVGPath != "" StrCpy $PathPrefix "$PathPrefix;$SVGPath" diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index fe49702472..d406e05615 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -79,13 +79,16 @@ Section -ProgramFiles SecProgramFiles WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "ConfigurePath" "$INSTDIR\imagemagick\config" WriteRegStr SHCTX "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "$INSTDIR\imagemagick\modules\filters" 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}" # Components of Ghostscript - SetOutPath "$INSTDIR\ghostscript" - File /r "${FILES_GHOSTSCRIPT}\" - !insertmacro FileListMSVC File "${FILES_MSVC}\" + ${if} $GhostscriptPath == "" + SetOutPath "$INSTDIR\ghostscript" + File /r "${FILES_GHOSTSCRIPT}\" + !insertmacro FileListMSVC File "${FILES_MSVC}\" + StrCpy $GhostscriptPath "$INSTDIR\ghostscript\bin" + ${endif} !if ${SETUPTYPE} == BUNDLE diff --git a/development/Win32/packaging/installer/setup/uninstall.nsh b/development/Win32/packaging/installer/setup/uninstall.nsh index 9a03ec7b7d..7553c3151c 100644 --- a/development/Win32/packaging/installer/setup/uninstall.nsh +++ b/development/Win32/packaging/installer/setup/uninstall.nsh @@ -94,6 +94,11 @@ Section "un.LyX" un.SecUnProgramFiles ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"' ${EndIf} + + # clean other registry entries + DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe" + DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}" + SectionEnd