فهرست منبع

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.
David Golub 12 سال پیش
والد
کامیت
40566ef2f8
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      Modules/NSIS.template.in

+ 3 - 1
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: