installer fix two bugs in the Update installer

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20922 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-10-11 22:26:52 +00:00
parent 9ce7cdcdc8
commit 1b2bcbee15
3 changed files with 40 additions and 38 deletions

View File

@ -226,50 +226,52 @@ Function RefreshRegUninst
# ImageMagick
ReadRegStr $0 SHCTX "Software\ImageMagick" "OnlyWithLyX"
${if} $0 == "Yes${PRODUCT_VERSION_SHORT_OLD}"
# set the new path
WriteRegStr HKLM "SOFTWARE\ImageMagick" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
ReadRegStr $0 HKLM "Software\ImageMagick\Current" "BinPath"
# set the new path
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\Current" "BinPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0 # macro from WordFunc.nsh
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "BinPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\Current" "CoderModulesPath"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\Current" "CoderModulesPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "CoderModulesPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\Current" "ConfigurePath"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\Current" "ConfigurePath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "ConfigurePath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\Current" "FilterModulesPath"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\Current" "FilterModulesPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\Current" "LibPath"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\Current" "LibPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "LibPath" "$0"
WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "Version" "${ImageMagickVersion}"
${COPY_REGISTRY_KEY} HKLM "Software\ImageMagick\${ImageMagickVersion_Old}" \
HKLM "Software\ImageMagick\${ImageMagickVersion}" # macro from registry.nsh
DeleteRegKey HKLM "Software\ImageMagick\${ImageMagickVersion_Old}"
# set the new path
ReadRegStr $0 HKLM "Software\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "BinPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}\Q:16" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\${ImageMagickVersion}\Q:16" "ConfigurePath"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "BinPath" "$0"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "CoderModulesPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "ConfigurePath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\${ImageMagickVersion}\Q:16" "FilterModulesPath"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "CoderModulesPath" "$0"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "ConfigurePath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "FilterModulesPath" "$0"
ReadRegStr $0 HKLM "Software\ImageMagick\${ImageMagickVersion}\Q:16" "LibPath"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "ConfigurePath" "$0"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "FilterModulesPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "LibPath" "$0"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "FilterModulesPath" "$0"
ReadRegStr $0 HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "LibPath"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion_Old}\Q:16" "LibPath" "$0"
${endif}
# Ghostscript and GSview
ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX"
${if} $0 == "Yes${PRODUCT_VERSION_SHORT_OLD}"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
# set the new path
ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion_Old}" "GS_DLL"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion_Old}" "GS_DLL" "$0"
ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion_Old}" "GS_LIB"
${WordReplace} $0 "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $0
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion_Old}" "GS_LIB" "$0"
${endif}
FunctionEnd

View File

@ -80,8 +80,6 @@ Var UserName
!insertmacro LineFind
!include "WordFunc.nsh"
!insertmacro WordReplace
!include "registry.nsh"
!insertmacro COPY_REGISTRY_KEY
# Set of various macros and functions
!include "LyXUtils.nsh"

View File

@ -1,11 +1,11 @@
# installer settings
# You should need to change only these macros for new releases.
!define PRODUCT_DIR "D:\LyXPackage1.6"
!define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX"
!define PRODUCT_VERSION "1.6svn"
!define PRODUCT_VERSION_SHORT "16svn"
!define PRODUCT_SUBFOLDER "lyx16"
!define PRODUCT_VERSION "1.5.2"
!define PRODUCT_VERSION_SHORT "152"
!define PRODUCT_SUBFOLDER "lyx15"
!define PRODUCT_LICENSE_FILE "${PRODUCT_DIR}\License.txt"
!define PRODUCT_SOURCEDIR "${PRODUCT_DIR}\LyX"
!define PRODUCT_EXE "$INSTDIR\bin\lyx.exe"
@ -19,12 +19,12 @@
!define PRODUCT_INFO_URL "http://www.lyx.org/"
!define LAUNCHER_EXE "$INSTDIR\bin\LyXLauncher.exe"
BrandingText "LyXWinInstaller v4.0 - ${INSTALLER_VERSION}"
BrandingText "LyXWinInstaller v3.20 - ${INSTALLER_VERSION}"
# to check later if this installer version is running at the same time
!define INSTALLER_EXE "LyX-${PRODUCT_VERSION_SHORT}-4-0-AltInstaller-${INSTALLER_VERSION}.exe"
!define INSTALLER2_EXE "LyX-${PRODUCT_VERSION_SHORT}-4-0-AltInstaller-${INSTALLER2_VERSION}.exe"
!define INSTALLER3_EXE "LyX-${PRODUCT_VERSION_SHORT}-4-0-AltInstaller-${INSTALLER3_VERSION}.exe"
!define INSTALLER_EXE "LyX-${PRODUCT_VERSION_SHORT}-3-20-AltInstaller-${INSTALLER_VERSION}.exe"
!define INSTALLER2_EXE "LyX-${PRODUCT_VERSION_SHORT}-3-20-AltInstaller-${INSTALLER2_VERSION}.exe"
!define INSTALLER3_EXE "LyX-${PRODUCT_VERSION_SHORT}-3-20-AltInstaller-${INSTALLER3_VERSION}.exe"
!define VERSION_BITMAP "${PRODUCT_DIR}\icons\lyx_logo_vert${PRODUCT_VERSION_SHORT}.bmp"
# Replaced by HKLM or HKCU depending on SetShellVarContext.
@ -38,11 +38,13 @@ BrandingText "LyXWinInstaller v4.0 - ${INSTALLER_VERSION}"
# definitions for the Update installer
!if ${INSTALLER_VERSION} == "Update"
!define PRODUCT_UNINST_KEY_OLD "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX150svn"
!define PRODUCT_VERSION_OLD "LyX 1.6svn"
!define PRODUCT_UNINST_KEY_OLD "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX151"
!define PRODUCT_VERSION_OLD "LyX 1.5.1"
!define PRODUCT_UNINSTALL_EXE_OLD "$INSTDIR\LyXWinUninstall.exe"
!define PRODUCT_VERSION_SHORT_OLD "160"
!define PRODUCT_VERSION_SHORT_OLD "151"
!define JabRefVersion "2.2" # could be an older version
!define ImageMagickVersion_Old "6.3.5" # could be an older version
!define GhostscriptVersion_Old "8.60"
!define MiKTeXDeliveredVersion "2.6" # could be an older version
!endif
@ -56,14 +58,14 @@ BrandingText "LyXWinInstaller v4.0 - ${INSTALLER_VERSION}"
!if ${INSTALLER_VERSION} == "Complete"
!define GSviewInstall "external\gsv48w32.exe"
!define JabRefInstall "external\JabRef-2.2-Setup.exe"
!define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.6.2742.exe"
!define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.6.2831.exe"
!define JabRefVersion "2.2"
!define MiKTeXDeliveredVersion "2.6"
!endif
!define ClassFileDir "${PRODUCT_SOURCEDIR}\Resources\tex"
!define ImageMagickVersion "6.3.5"
!define ImageMagickVersion "6.3.6"
# for some odd reason the ImageMagick folder may not be a subfolder of $INSTDIR\bin!
!define ImageMagickDir "$INSTDIR\etc\ImageMagick"
!define GhostscriptDir "$INSTDIR\etc\Ghostscript"