From 367a67b965b56a2e92a2ed57a4544bca50446e2d Mon Sep 17 00:00:00 2001 From: anders_k Date: Sun, 13 Mar 2011 20:41:17 +0000 Subject: [PATCH] More .nsh COM stuff (IShellItem, IStartMenuPinnedList, IPropertyStore and basic PROPVARIANT support) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6144 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Win/COM.nsh | 27 ++++++++++++++++++++++++- Include/Win/Propkey.nsh | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 Include/Win/Propkey.nsh diff --git a/Include/Win/COM.nsh b/Include/Win/COM.nsh index e5721455..09c3c236 100644 --- a/Include/Win/COM.nsh +++ b/Include/Win/COM.nsh @@ -148,6 +148,31 @@ ${NSISCOMIFACEDECL}IShellLinkDataList SetFlags 7 (i)i !define /ifndef SLDF_PREFER_ENVIRONMENT_PATH 0x02000000 !define /ifndef SLDF_KEEP_LOCAL_IDLIST_FOR_UNC_TARGET 0x04000000 +!ifndef IID_IShellItem +!define IID_IShellItem {43826d1e-e718-42ee-bc55-a1e261c37bfe} +${NSISCOMIFACEDECL}IShellItem BindToHandler 3 (p,g,g,*p)i +${NSISCOMIFACEDECL}IShellItem GetParent 4 (*p)i +${NSISCOMIFACEDECL}IShellItem GetDisplayName 5 (i,*p)i +${NSISCOMIFACEDECL}IShellItem GetAttributes 6 (i,*i)i +${NSISCOMIFACEDECL}IShellItem Compare 7 (p,i,*i)i +!endif + +!ifndef CLSID_StartMenuPin +!define CLSID_StartMenuPin {a2a9545d-a0c2-42b4-9708-a0b2badd77c8} +!endif +!ifndef IID_IStartMenuPinnedList +!define IID_IStartMenuPinnedList {4CD19ADA-25A5-4A32-B3B7-347BEE5BE36B} +${NSISCOMIFACEDECL}IStartMenuPinnedList RemoveFromList 3 (p)i +!endif + +!ifndef IID_IPropertyStore +!define IID_IPropertyStore {886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99} +${NSISCOMIFACEDECL}IPropertyStore GetCount 3 (*i)i +${NSISCOMIFACEDECL}IPropertyStore GetAt 4 (i,p)i +${NSISCOMIFACEDECL}IPropertyStore GetValue 5 (p,p)i +${NSISCOMIFACEDECL}IPropertyStore SetValue 6 (p,p)i +${NSISCOMIFACEDECL}IPropertyStore Commit 7 ()i +!endif !verbose pop -!endif /* __WIN_COM__INC */ \ No newline at end of file +!endif /* __WIN_COM__INC */ diff --git a/Include/Win/Propkey.nsh b/Include/Win/Propkey.nsh new file mode 100644 index 00000000..bd89f4ad --- /dev/null +++ b/Include/Win/Propkey.nsh @@ -0,0 +1,44 @@ +!ifndef __WIN_PROPKEY__INC +!define __WIN_PROPKEY__INC +!verbose push +!verbose 3 + + +/************************************************** +WTypes.h +**************************************************/ +;NOTE: This list is incomplete +!define VT_EMPTY 0 +!define VT_NULL 1 +!define VT_I4 3 +!define VT_BSTR 8 +!define VT_BOOL 11 +!define VT_UI4 19 +!define VT_INT 22 +!define VT_UINT 23 +!define VT_HRESULT 25 +!define VT_PTR 26 +!define VT_SAFEARRAY 27 +!define VT_LPSTR 30 +!define VT_LPWSTR 31 + +!define SYSSIZEOF_PROPERTYKEY 20 +!define SYSSTRUCT_PROPERTYKEY (&g16,&i4) ;System.dll is buggy when it comes to g and forces us to specify the size + + +/************************************************** +PropIdl.h +**************************************************/ +!define SYSSIZEOF_PROPVARIANT 16 +!define SYSSTRUCT_PROPVARIANT (&i2,&i6,&i8) + + +/************************************************** +Propkey.h +**************************************************/ +!define PKEY_AppUserModel_ID '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",5' +!define PKEY_AppUserModel_PreventPinning '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",9' + + +!verbose pop +!endif /* __WIN_PROPKEY__INC */