mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-11 23:43:58 +03:00
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 <golubdr@gmail.com> Fixes: #14112
This commit is contained in:
1 parent
ebe181646e
commit
33e85acff7
1 file changed
+2
-1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user