CPack/NSIS: Fix uninstall command when run from installer

The quoting introduced by commit eb3b3bacdc (CPack/NSIS: Fix uninstall
on Windows using "Apps & Features", 2021-09-13, v3.22.0-rc1~136^2)
created two errors in the uninstaller call: double quoting of the
uninstaller executable, and quotes added to the `_?=` argument which
does not support them.  Simplify the command.
This commit is contained in:
Marc Jeanmougin
2022-03-21 12:25:10 -04:00
committed by Brad King
parent 0abd49ebb9
commit b795c96727

View File

@@ -932,9 +932,7 @@ Function .onInit
;Run the uninstaller
uninst:
ClearErrors
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
ExecWait '$0 /S'
IfErrors uninst_failed inst
uninst_failed: