From 91756476d6c086c18955369f9e5fd2a57c4a8b96 Mon Sep 17 00:00:00 2001 From: anders_k Date: Sun, 29 Jun 2014 19:01:14 +0000 Subject: [PATCH] Don't use HKCR when uninstalling file associations because it will delete keys under both HKCU and HKLM, we only want to delete the keys we created! git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6508 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/makensis.nsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi index 6c0aec71..4a39f5fd 100644 --- a/Examples/makensis.nsi +++ b/Examples/makensis.nsi @@ -269,7 +269,7 @@ ${MementoSection} "NSIS Core Files (required)" SecCore WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"' ${EndIf} - System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' + System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p0, p0)' ${MementoSectionEnd} @@ -1029,18 +1029,18 @@ Section Uninstall DetailPrint "Deleting Registry Keys..." SetDetailsPrint listonly - ReadRegStr $R0 HKCR ".nsi" "" - StrCmp $R0 "NSIS.Script" 0 +2 - DeleteRegKey HKCR ".nsi" + !macro AssocDeleteFileExtAndProgId _hkey _dotext _pid + ReadRegStr $R0 ${_hkey} "Software\Classes\${_dotext}" "" + StrCmp $R0 "${_pid}" 0 +2 + DeleteRegKey ${_hkey} "Software\Classes\${_dotext}" - ReadRegStr $R0 HKCR ".nsh" "" - StrCmp $R0 "NSIS.Header" 0 +2 - DeleteRegKey HKCR ".nsh" + DeleteRegKey ${_hkey} "Software\Classes\${_pid}" + !macroend - DeleteRegKey HKCR "NSIS.Script" - DeleteRegKey HKCR "NSIS.Header" + !insertmacro AssocDeleteFileExtAndProgId HKLM ".nsi" "NSIS.Script" + !insertmacro AssocDeleteFileExtAndProgId HKLM ".nsh" "NSIS.Header" - System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)' + System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p0, p0)' DeleteRegKey HKLM "${REG_UNINST_KEY}" DeleteRegKey HKLM "Software\NSIS"