From 33e85acff70f1ac0c3cce6daa56cfdb5904aee0b Mon Sep 17 00:00:00 2001 From: Nikita Nemkin Date: Thu, 20 Feb 2025 13:12:11 +0500 Subject: [PATCH] CPack/NSIS: Use the installed display name in uninstall prompt When a new installation prompts to uninstall the old version, use the display name of the old version from the registry. This only affects packages that change their CPACK_NSIS_DISPLAY_NAME. Patch-by: David Golub Fixes: #14112 --- Modules/Internal/CPack/NSIS.template.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in index 6349f9d23d..c0b61e37e0 100644 --- a/Modules/Internal/CPack/NSIS.template.in +++ b/Modules/Internal/CPack/NSIS.template.in @@ -923,8 +923,9 @@ Function .onInit ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString" StrCmp $0 "" inst + ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DisplayName" MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ - "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \ + "$1 is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \ /SD IDYES IDYES uninst IDNO inst Abort