Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !include LogicLib.nsh
- !define STGM_READWRITE 2
- !define VT_BOOL 11
- !define VARIANT_TRUE -1
- !define PKEY_AppUserModel_PreventPinning '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",9'
- Function ShellLink_Set_AppUserModel.PreventPinning
- Exch $9
- System::Store S
- System::Call 'OLE32::CoCreateInstance(g "{00021401-0000-0000-c000-000000000046} ",i 0,i 1,g "{000214f9-0000-0000-c000-000000000046} ",*i.r1)i'
- ${If} $1 <> 0
- System::Call '$1->0(g "{0000010b-0000-0000-C000-000000000046}",*i.r2)i'
- ${If} $2 <> 0
- System::Call '$2->5(w r9,i ${STGM_READWRITE})i.r0'
- ${If} $0 = 0
- System::Call '$1->0(g "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99} ",*i.r3)i'
- ${If} $3 <> 0
- System::Call '*(&g16,&i4,&i2,&i6,&i8)i.r7' ;PROPERTYKEY+PROPVARIANT
- IntOp $8 $7 + 20
- System::Call '*$7(&g16,&i4)(${PKEY_AppUserModel_PreventPinning})'
- System::Call '*$8(&i2 ${VT_BOOL},&i6,&i8 ${VARIANT_TRUE})'
- System::Call '$3->6(ir7,ir8)i.r0'
- System::Call '$3->7()'
- System::Free $7
- System::Call '$3->2()'
- ${If} $0 = 0
- System::Call '$2->6(i0,i0)'
- ${EndIf}
- ${EndIf}
- ${EndIf}
- System::Call '$2->2()'
- ${EndIf}
- System::Call '$1->2()'
- ${EndIf}
- System::Store L
- Pop $9
- FunctionEnd
- !macro ShellLink_Set_AppUserModel.PreventPinning lnk
- Push "${lnk}"
- call ShellLink_Set_AppUserModel.PreventPinning
- !macroend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement