summaryrefslogtreecommitdiffstats
path: root/Modules/NSIS.template.in
diff options
context:
space:
mode:
authorDavid Golub <golubdr@gmail.com>2013-05-02 13:47:08 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-02 14:22:20 (GMT)
commit40566ef2f808cc5bffa5109250f0edf864da5f7e (patch)
tree8636c58ffd2f10a3a12bb2259c80a27fef89dc39 /Modules/NSIS.template.in
parente9e088a4df62f33cacffe7bfd1840ade3ac52db8 (diff)
downloadCMake-40566ef2f808cc5bffa5109250f0edf864da5f7e.zip
CMake-40566ef2f808cc5bffa5109250f0edf864da5f7e.tar.gz
CMake-40566ef2f808cc5bffa5109250f0edf864da5f7e.tar.bz2
CPack/NSIS: Obtain path from which to uninstall from registry (#14124)
Without this, when CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL is set, the installer tries to uninstall the old version from the default installation path for the new version, rather than using the path from the registry where the old version is installed.
Diffstat (limited to 'Modules/NSIS.template.in')
-rw-r--r--Modules/NSIS.template.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 59a444b..76310af 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -916,7 +916,9 @@ Function .onInit
;Run the uninstaller
uninst:
ClearErrors
- ExecWait '$0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+ StrLen $2 "\Uninstall.exe"
+ StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
+ ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst
uninst_failed: