commit 4d4ba7b80c8328c6507566dd296feacf880249d9
Author: Uwe Stöhr <[email protected]>
Date: Sun Apr 27 15:14:01 2014 +0200
installer: fine-tuning
don't bother the user with questions if the uninstaller was accidentally
deleted
diff --git a/development/Win32/packaging/installer/include/init.nsh
b/development/Win32/packaging/installer/include/init.nsh
index 0535706..feade0d 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