[LyX/master] Win installer: fix registry issue
Uwe Stöhr
uwestoehr at lyx.org
Sun Oct 20 21:12:18 UTC 2019
commit 273d257f2a07dc1ef7942889649f47a97373f2a1
Author: Uwe Stöhr <uwestoehr at lyx.org>
Date: Sun Oct 20 23:26:08 2019 +0200
Win installer: fix registry issue
- when installing LyX 2.x.z over a previous 2.x.y installation a registry key was not deleted
- also fix some hardcoded occurrences of "lyx"
---
.../packaging/installer/include/declarations.nsh | 9 +++++----
.../Win32/packaging/installer/setup/configure.nsh | 4 +++-
.../Win32/packaging/installer/setup/install.nsh | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/development/Win32/packaging/installer/include/declarations.nsh b/development/Win32/packaging/installer/include/declarations.nsh
index 2e96869..84ebabd 100644
--- a/development/Win32/packaging/installer/include/declarations.nsh
+++ b/development/Win32/packaging/installer/include/declarations.nsh
@@ -37,6 +37,7 @@ Configuration of LyX installer
# Names and version
!define APP_NAME "LyX"
+!define APP_NAME_SMALL "lyx"
!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}.${APP_VERSION_BUILD}"
# for the proposed install folder we use the scheme "LyX 2.2" while we need for the registry the scheme "LyX 2.1.4"
# to check if it is exactly this version (to support side by side installations)
@@ -57,7 +58,7 @@ Configuration of LyX installer
!define APP_SETUPTYPE "Standard"
!endif
-!define BIN_LYX "LyX.exe"
+!define BIN_LYX "${APP_NAME}.exe"
!define APP_RUN "bin\${BIN_LYX}"
!define APP_REGKEY "Software\${APP_NAME}${APP_SERIES_KEY}" # like "LyX220"
@@ -66,8 +67,8 @@ Configuration of LyX installer
!define APP_REGNAME_DOC "${APP_NAME}.Document"
-!define APP_EXT ".lyx"
-!define APP_MIME_TYPE "application/lyx"
+!define APP_EXT ".${APP_NAME_SMALL}"
+!define APP_MIME_TYPE "application/${APP_NAME_SMALL}"
!define APP_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"
@@ -81,7 +82,7 @@ Configuration of LyX installer
!define SETUP_EXE ${ExeFile}
!endif
-!define SETUP_ICON "${FILES_ICONS}\lyx.ico"
+!define SETUP_ICON "${FILES_ICONS}\${APP_NAME_SMALL}.ico"
!define SETUP_HEADERIMAGE "graphics\header.bmp"
!define SETUP_WIZARDIMAGE "graphics\wizard.bmp"
!define SETUP_UNINSTALLER "Uninstall-${APP_NAME}.exe"
diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh
index 97bc945..5daf6d6 100644
--- a/development/Win32/packaging/installer/setup/configure.nsh
+++ b/development/Win32/packaging/installer/setup/configure.nsh
@@ -46,7 +46,7 @@ Section -InstallData
WriteRegStr SHCTX ${APP_UNINST_KEY} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
- WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx.exe"
+ WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\${APP_NAME_SMALL}.exe"
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "${APP_WEBPAGE}"
WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "https://www.lyx.org/AboutLyX"
WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "${APP_NAME} Team"
@@ -58,8 +58,10 @@ Section -InstallData
# if we install over an older existing version, remove the old uninstaller information
${if} $OldVersionNumber < ${APP_SERIES_KEY}
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber"
+ DeleteRegKey SHCTX "SOFTWARE\${APP_NAME}$OldVersionNumber"
# also delete in the case of an emergency release
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber1"
+ DeleteRegKey SHCTX "SOFTWARE\${APP_NAME}$OldVersionNumber1"
${endif}
SectionEnd
diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh
index 53196e3..8aeef94 100644
--- a/development/Win32/packaging/installer/setup/install.nsh
+++ b/development/Win32/packaging/installer/setup/install.nsh
@@ -18,7 +18,7 @@ Section -ProgramFiles SecProgramFiles
# be installed directly to C:\programs - the uninstaller will then delete the whole
# C:\programs directory
StrCpy $String $INSTDIR
- StrCpy $Search "LyX"
+ StrCpy $Search "${APP_NAME}"
Call StrPoint # function from LyXUtils.nsh
${if} $Pointer == "-1"
StrCpy $INSTDIR "$INSTDIR\${APP_DIR}"
More information about the lyx-cvs
mailing list