git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7200 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2020-07-31 22:53:37 +00:00
parent fe5b26b4b5
commit 6ff4ca0df5

View file

@ -1,44 +1,44 @@
!verbose push 3 !verbose push 3
!ifndef INTEGRATION_INCLUDED !ifndef INTEGRATION_INCLUDED
!define INTEGRATION_INCLUDED 1 !define INTEGRATION_INCLUDED 1
!include "Util.nsh" !include "Util.nsh"
!define NotifyShell_AssocChanged `System::Call 'SHELL32::SHChangeNotify(i0x8000000,i0,p0,p0)'` ; Notify the shell with SHCNE_ASSOCCHANGED !define NotifyShell_AssocChanged `System::Call 'SHELL32::SHChangeNotify(i0x8000000,i0,p0,p0)'` ; Notify the shell with SHCNE_ASSOCCHANGED
!define UnpinShortcut "!insertmacro UnpinShortcut " !define UnpinShortcut "!insertmacro UnpinShortcut "
!macro UnpinShortcut lnkpath !macro UnpinShortcut lnkpath
Push "${lnkpath}" Push "${lnkpath}"
${CallArtificialFunction} UnpinShortcut_Implementation ${CallArtificialFunction} UnpinShortcut_Implementation
!macroend !macroend
!macro UnpinShortcut_Implementation !macro UnpinShortcut_Implementation
!include "LogicLib.nsh" !include "LogicLib.nsh"
!include "Win\COM.nsh" !include "Win\COM.nsh"
Exch $0 Exch $0
Push $1 Push $1
!insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r1 "" !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r1 ""
${If} $1 P<> 0 ${If} $1 P<> 0
System::Call 'SHELL32::SHCreateItemFromParsingName(wr0,p0,g"${IID_IShellItem}",*p0r0)' System::Call 'SHELL32::SHCreateItemFromParsingName(wr0,p0,g"${IID_IShellItem}",*p0r0)'
${If} $0 P<> 0 ${If} $0 P<> 0
${IStartMenuPinnedList::RemoveFromList} $1 '(r0)' ${IStartMenuPinnedList::RemoveFromList} $1 '(r0)'
${IUnknown::Release} $0 "" ${IUnknown::Release} $0 ""
${EndIf} ${EndIf}
${IUnknown::Release} $1 "" ${IUnknown::Release} $1 ""
!ifdef NSIS_IX86 | NSIS_AMD64 !ifdef NSIS_IX86 | NSIS_AMD64
${Else} ${Else}
!insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} "{ec35e37a-6579-4f3c-93cd-6e62c4ef7636}" r1 "" !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} "{ec35e37a-6579-4f3c-93cd-6e62c4ef7636}" r1 ""
${If} $1 P<> 0 ${If} $1 P<> 0
ExecShellWait /INVOKEIDLIST "unpin" $0 ; WinXP ExecShellWait /INVOKEIDLIST "unpin" $0 ; WinXP
${IUnknown::Release} $1 "" ${IUnknown::Release} $1 ""
${EndIf} ${EndIf}
!endif !endif
${EndIf} ${EndIf}
Pop $1 Pop $1
Pop $0 Pop $0
!macroend !macroend
!endif #!INCLUDED !endif #!INCLUDED
!verbose pop !verbose pop