Browse Source

Merge branch 'cpack-nsis-fix-uninstall-quoting' into release-3.22

Merge-request: !7096
Brad King 3 years ago
parent
commit
01a4be3c60
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Modules/Internal/CPack/NSIS.template.in

+ 5 - 3
Modules/Internal/CPack/NSIS.template.in

@@ -932,9 +932,11 @@ Function .onInit
 ;Run the uninstaller
 uninst:
   ClearErrors
-  StrLen $2 "\@[email protected]"
-  StrCpy $3 $0 -$2 # remove "\@[email protected]" from UninstallString to get path
-  ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file
+  StrCpy $2 $0 1
+  StrCmp '"' $2 0 +3 ; checks if string is quoted (CPack before v3.20.6 did not quote it)
+  ExecWait '$0 /S'
+  Goto +2
+  ExecWait '"$0" /S'
 
   IfErrors uninst_failed inst
 uninst_failed: