From 4d4ba7b80c8328c6507566dd296feacf880249d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 27 Apr 2014 15:14:01 +0200 Subject: [PATCH] installer: fine-tuning don't bother the user with questions if the uninstaller was accidentally deleted --- .../Win32/packaging/installer/include/init.nsh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/development/Win32/packaging/installer/include/init.nsh b/development/Win32/packaging/installer/include/init.nsh index 053570619f..feade0dfd6 100644 --- a/development/Win32/packaging/installer/include/init.nsh +++ b/development/Win32/packaging/installer/include/init.nsh @@ -626,15 +626,24 @@ Function .onInit # check if this LyX version is already installed ${if} $MultiUser.Privileges == "Admin" ${orif} $MultiUser.Privileges == "Power" - ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher" + ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon" ${else} - ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher" + ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayIcon" # handle also the case that LyX is already installed in HKLM ${if} $0 == "" - ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher" + ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "DisplayIcon" ${endif} ${endif} ${if} $0 != "" + # check if the uninstaller was acidentally deleted + # if so don't bother the user if he realy wants to install a new LyX over an existing one + # because he won't have a chance to deny this + StrCpy $4 $0 -10 # remove '\bin\lyx,0' + # (for FileCheck the variables $0 and $1 cannot be used) + !insertmacro FileCheck $5 "Uninstall-LyX.exe" "$4" # macro from LyXUtils.nsh + ${if} $5 == "False" + Goto ForceInstallation + ${endif} # installing over an existing installation of the same LyX release is not necessary # if the users does this he most probably has a problem with LyX that can better be solved # by reinstalling LyX -- 2.39.5