1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 03:48:02 +08:00

CPack/NSIS: Fix CPACK_NSIS_UNINSTALL_NAME when not Uninstall.exe

If a previous installation was detected by the NSIS script the
uninstaller was not correctly run unless it was still named
`Uninstall.exe`.  This meant that using `CPACK_NSIS_UNINSTALL_NAME`
was simply broken.

Fixes: #22103
This commit is contained in:
Markus Israelsson
2021-04-26 16:21:12 +02:00
committed by Brad King
parent eeb771e4d6
commit 79f48da5c2

View File

@@ -919,8 +919,8 @@ Function .onInit
;Run the uninstaller
uninst:
ClearErrors
StrLen $2 "\Uninstall.exe"
StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
StrLen $2 "\@CPACK_NSIS_UNINSTALL_NAME@.exe"
StrCpy $3 $0 -$2 # remove "\@CPACK_NSIS_UNINSTALL_NAME@.exe" from UninstallString to get path
ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst