From 3846cc3dae71eb536e1fd999148198aa1eeea01d Mon Sep 17 00:00:00 2001 From: "Vladimir.Orlov" Date: Tue, 2 May 2017 12:40:31 +0300 Subject: [PATCH] IDEA-157745 Uninstaller deletes entier folder contents without checking the current folder location --- build/conf/nsis/idea.nsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build/conf/nsis/idea.nsi b/build/conf/nsis/idea.nsi index ab804f300896..3f0ca3c19418 100644 --- a/build/conf/nsis/idea.nsi +++ b/build/conf/nsis/idea.nsi @@ -1142,6 +1142,19 @@ FunctionEnd Section "Uninstall" + StrCpy $0 $baseRegKey + StrCpy $1 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_WITH_VER}" + StrCpy $2 "InstallLocation" + Call un.OMReadRegStr + StrCmp $INSTDIR "$3\bin" check_if_IDE_in_use invalid_installation_dir +invalid_installation_dir: + ;check if uninstaller runs from not installation folder + IfFileExists "$INSTDIR\IdeaWin32.dll" 0 end_of_uninstall + IfFileExists "$INSTDIR\IdeaWin64.dll" 0 end_of_uninstall + IfFileExists "$INSTDIR\${PRODUCT_EXE_FILE_64}" 0 end_of_uninstall + IfFileExists "$INSTDIR\${PRODUCT_EXE_FILE}" check_if_IDE_in_use 0 + goto end_of_uninstall +check_if_IDE_in_use: ;check if the uninstalled application is running Call un.checkIfIDEInUse ; Uninstaller is in the \bin directory, we need upper level dir