Advertisement
Anders

ShellLink_Set_AppUserModel.PreventPinning

Feb 6th, 2012
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !include LogicLib.nsh
  2.  
  3. !define STGM_READWRITE 2
  4. !define VT_BOOL 11
  5. !define VARIANT_TRUE -1
  6. !define PKEY_AppUserModel_PreventPinning '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",9'
  7.  
  8. Function ShellLink_Set_AppUserModel.PreventPinning
  9. Exch $9
  10. System::Store S
  11. System::Call 'OLE32::CoCreateInstance(g "{00021401-0000-0000-c000-000000000046} ",i 0,i 1,g "{000214f9-0000-0000-c000-000000000046} ",*i.r1)i'
  12. ${If} $1 <> 0
  13.     System::Call '$1->0(g "{0000010b-0000-0000-C000-000000000046}",*i.r2)i'
  14.     ${If} $2 <> 0
  15.         System::Call '$2->5(w r9,i ${STGM_READWRITE})i.r0'
  16.         ${If} $0 = 0
  17.             System::Call '$1->0(g "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99} ",*i.r3)i'
  18.             ${If} $3 <> 0
  19.                 System::Call '*(&g16,&i4,&i2,&i6,&i8)i.r7' ;PROPERTYKEY+PROPVARIANT
  20.                 IntOp $8 $7 + 20
  21.                 System::Call '*$7(&g16,&i4)(${PKEY_AppUserModel_PreventPinning})'
  22.                 System::Call '*$8(&i2 ${VT_BOOL},&i6,&i8 ${VARIANT_TRUE})'
  23.                 System::Call '$3->6(ir7,ir8)i.r0'
  24.                 System::Call '$3->7()'
  25.                 System::Free $7
  26.                 System::Call '$3->2()'
  27.                 ${If} $0 = 0
  28.                     System::Call '$2->6(i0,i0)'
  29.                 ${EndIf}
  30.             ${EndIf}
  31.         ${EndIf}
  32.         System::Call '$2->2()'
  33.     ${EndIf}
  34.     System::Call '$1->2()'
  35. ${EndIf}
  36. System::Store L
  37. Pop $9
  38. FunctionEnd
  39. !macro ShellLink_Set_AppUserModel.PreventPinning lnk
  40. Push "${lnk}"
  41. call ShellLink_Set_AppUserModel.PreventPinning
  42. !macroend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement