Răsfoiți Sursa

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
Markus Israelsson 4 ani în urmă
părinte
comite
79f48da5c2
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      Modules/Internal/CPack/NSIS.template.in

+ 2 - 2
Modules/Internal/CPack/NSIS.template.in

@@ -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