Integration.nsh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. !verbose push 3
  2. !ifndef INTEGRATION_INCLUDED
  3. !define INTEGRATION_INCLUDED 1
  4. !include "Util.nsh"
  5. !define NotifyShell_AssocChanged `System::Call 'SHELL32::SHChangeNotify(i0x8000000,i0,p0,p0)'` ; Notify the shell with SHCNE_ASSOCCHANGED
  6. !define UnpinShortcut "!insertmacro UnpinShortcut "
  7. !macro UnpinShortcut lnkpath
  8. Push "${lnkpath}"
  9. ${CallArtificialFunction} UnpinShortcut_Implementation
  10. !macroend
  11. !macro UnpinShortcut_Implementation
  12. !include "LogicLib.nsh"
  13. !include "Win\COM.nsh"
  14. Exch $0
  15. Push $1
  16. !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r1 ""
  17. ${If} $1 P<> 0
  18. System::Call 'SHELL32::SHCreateItemFromParsingName(wr0,p0,g"${IID_IShellItem}",*p0r0)'
  19. ${If} $0 P<> 0
  20. ${IStartMenuPinnedList::RemoveFromList} $1 '(r0)'
  21. ${IUnknown::Release} $0 ""
  22. ${EndIf}
  23. ${IUnknown::Release} $1 ""
  24. !ifdef NSIS_IX86 | NSIS_AMD64
  25. ${Else}
  26. !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} "{ec35e37a-6579-4f3c-93cd-6e62c4ef7636}" r1 ""
  27. ${If} $1 P<> 0
  28. ExecShellWait /INVOKEIDLIST "unpin" $0 ; WinXP
  29. ${IUnknown::Release} $1 ""
  30. ${EndIf}
  31. !endif
  32. ${EndIf}
  33. Pop $1
  34. Pop $0
  35. !macroend
  36. !endif #!INCLUDED
  37. !verbose pop