Add installer to repo
This commit is contained in:
392
installer/tools/Include/Win/COM.nsh
Normal file
392
installer/tools/Include/Win/COM.nsh
Normal file
@ -0,0 +1,392 @@
|
||||
/*
|
||||
-------------
|
||||
COM.nsh
|
||||
-------------
|
||||
|
||||
COM defines and helper macros
|
||||
|
||||
; Example usage:
|
||||
!include LogicLib.nsh
|
||||
!include Win\COM.nsh
|
||||
!include Win\Propkey.nsh
|
||||
!insertmacro ComHlpr_CreateInProcInstance ${CLSID_ShellLink} ${IID_IShellLink} r0 ""
|
||||
${If} $0 P<> 0
|
||||
${IShellLink::SetPath} $0 '("%COMSPEC%").r1'
|
||||
${IShellLink::SetArguments} $0 '("/k echo HelloWorld").r2'
|
||||
${If} $1 = 0
|
||||
${AndIf} $2 = 0
|
||||
${IUnknown::QueryInterface} $0 '("${IID_IPropertyStore}",.r1)'
|
||||
${If} $1 P<> 0
|
||||
System::Call '*${SYSSTRUCT_PROPERTYKEY}(${PKEY_AppUserModel_StartPinOption})p.r2'
|
||||
System::Call '*${SYSSTRUCT_PROPVARIANT}(${VT_UI4},,&i4 ${APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL})p.r3'
|
||||
${IPropertyStore::SetValue} $1 '($2,$3)'
|
||||
|
||||
; Reuse the PROPERTYKEY & PROPVARIANT buffers to set another property
|
||||
System::Call '*$2${SYSSTRUCT_PROPERTYKEY}(${PKEY_AppUserModel_ExcludeFromShowInNewInstall})'
|
||||
System::Call '*$3${SYSSTRUCT_PROPVARIANT}(${VT_BOOL},,&i2 ${VARIANT_TRUE})'
|
||||
${IPropertyStore::SetValue} $1 '($2,$3)'
|
||||
|
||||
System::Free $2
|
||||
System::Free $3
|
||||
${IPropertyStore::Commit} $1 ""
|
||||
${IUnknown::Release} $1 ""
|
||||
${EndIf}
|
||||
${IUnknown::QueryInterface} $0 '("${IID_IPersistFile}",.r1)'
|
||||
${If} $1 P<> 0
|
||||
${IPersistFile::Save} $1 '("$SMPrograms\nsis_test.lnk",1)'
|
||||
${IUnknown::Release} $1 ""
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
${IUnknown::Release} $0 ""
|
||||
${EndIf}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
!ifndef __WIN_COM__INC
|
||||
!define __WIN_COM__INC ${NSIS_CHAR_SIZE}
|
||||
!verbose push
|
||||
!verbose 3
|
||||
|
||||
!define /ifndef STGM_READ 0
|
||||
!define /ifndef STGM_WRITE 1
|
||||
!define /ifndef STGM_READWRITE 2
|
||||
!define /ifndef STGM_SHARE_DENY_NONE 0x00000040
|
||||
!define /ifndef STGM_SHARE_DENY_READ 0x00000030
|
||||
!define /ifndef STGM_SHARE_DENY_WRITE 0x00000020
|
||||
!define /ifndef STGM_SHARE_EXCLUSIVE 0x00000010
|
||||
!define /ifndef STGM_PRIORITY 0x00040000
|
||||
!define /ifndef STGM_CREATE 0x00001000
|
||||
!define /ifndef STGM_CONVERT 0x00020000
|
||||
!define /ifndef STGM_FAILIFTHERE 0
|
||||
!define /ifndef STGM_DELETEONRELEASE 0x04000000
|
||||
|
||||
!define /ifndef CLSCTX_INPROC_SERVER 0x1
|
||||
!define /ifndef CLSCTX_INPROC_HANDLER 0x2
|
||||
!define /ifndef CLSCTX_LOCAL_SERVER 0x4
|
||||
!define /ifndef CLSCTX_REMOTE_SERVER 0x10
|
||||
!define /ifndef CLSCTX_ACTIVATE_32_BIT_SERVER 0x40000
|
||||
!define /ifndef CLSCTX_ACTIVATE_64_BIT_SERVER 0x80000
|
||||
!define /ifndef CLSCTX_ENABLE_CLOAKING 0x100000
|
||||
|
||||
!define NSISCOMCALL "!insertmacro NSISCOMCALL "
|
||||
!macro NSISCOMCALL vtblidx decl ptr params
|
||||
!if ${NSIS_CHAR_SIZE} <> ${__WIN_COM__INC}
|
||||
; Warn if QueryInterface() for IID_IShellLink etc will return the wrong interface
|
||||
!warning "NSIS_CHAR_SIZE changed, existing defines and macros might not work correctly!"
|
||||
!endif
|
||||
System::Call `${ptr}->${vtblidx}${decl}${params}`
|
||||
!macroend
|
||||
!define NSISCOMIFACEDECL "!insertmacro NSISCOMIFACEDECL "
|
||||
!macro NSISCOMIFACEDECL iface method vtblidx decl
|
||||
!define ${iface}::${method} `${NSISCOMCALL} ${vtblidx} ${decl} `
|
||||
!macroend
|
||||
|
||||
!macro ComHlpr_CreateInstance clsid iid sysoutvarIFacePtr sysret
|
||||
System::Call 'OLE32::CoCreateInstance(g"${clsid}",i0,i23,g"${iid}",*p.${sysoutvarIFacePtr})i${sysret}'
|
||||
!macroend
|
||||
!macro ComHlpr_CreateInProcInstance clsid iid sysoutvarIFacePtr sysret
|
||||
System::Call 'OLE32::CoCreateInstance(g"${clsid}",i0,i${CLSCTX_INPROC_SERVER},g"${iid}",*p.${sysoutvarIFacePtr})i${sysret}'
|
||||
!macroend
|
||||
|
||||
!macro ComHlpr_SafeRelease _p
|
||||
${If} ${_p} P<> 0
|
||||
${IUnknown::Release} ${_p} ""
|
||||
${EndIf}
|
||||
!macroend
|
||||
!macro ComHlpr_SafeReleaseAndNull _p
|
||||
${If} ${_p} P<> 0
|
||||
${IUnknown::Release} ${_p} ""
|
||||
StrCpy ${_p} 0
|
||||
${EndIf}
|
||||
!macroend
|
||||
|
||||
|
||||
!ifndef IID_IUnknown
|
||||
!define IID_IUnknown {00000000-0000-0000-C000-000000000046}
|
||||
${NSISCOMIFACEDECL}IUnknown QueryInterface 0 (g,*p)i
|
||||
${NSISCOMIFACEDECL}IUnknown AddRef 1 ()i
|
||||
${NSISCOMIFACEDECL}IUnknown Release 2 ()i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IPersist
|
||||
!define IID_IPersist {0000010c-0000-0000-C000-000000000046}
|
||||
${NSISCOMIFACEDECL}IPersist GetClassID 3 (g)i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IPersistStream
|
||||
!define IID_IPersistStream {00000109-0000-0000-C000-000000000046} ; IPersist>
|
||||
${NSISCOMIFACEDECL}IPersistStream IsDirty 4 ()i
|
||||
${NSISCOMIFACEDECL}IPersistStream Load 5 (p,i)i
|
||||
${NSISCOMIFACEDECL}IPersistStream Save 6 (p,i)i
|
||||
${NSISCOMIFACEDECL}IPersistStream GetSizeMax 7 (*l)i
|
||||
!endif
|
||||
!ifndef IID_IPersistStreamInit
|
||||
!define IID_IPersistStreamInit {7FD52380-4E07-101B-AE2D-08002B2EC713} ; IPersist>
|
||||
${NSISCOMIFACEDECL}IPersistStreamInit IsDirty 4 ()i
|
||||
${NSISCOMIFACEDECL}IPersistStreamInit Load 5 (p,i)i
|
||||
${NSISCOMIFACEDECL}IPersistStreamInit Save 6 (p,i)i
|
||||
${NSISCOMIFACEDECL}IPersistStreamInit GetSizeMax 7 (*l)i
|
||||
${NSISCOMIFACEDECL}IPersistStreamInit InitNew 8 ()i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IPersistFile
|
||||
!define IID_IPersistFile {0000010b-0000-0000-C000-000000000046} ; IPersist>
|
||||
${NSISCOMIFACEDECL}IPersistFile IsDirty 4 ()i
|
||||
${NSISCOMIFACEDECL}IPersistFile Load 5 (w,i)i
|
||||
${NSISCOMIFACEDECL}IPersistFile Save 6 (w,i)i
|
||||
${NSISCOMIFACEDECL}IPersistFile SaveCompleted 7 (w)i
|
||||
${NSISCOMIFACEDECL}IPersistFile GetCurFile 8 (*w)i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_ShellLink
|
||||
!define CLSID_ShellLink {00021401-0000-0000-c000-000000000046}
|
||||
!endif
|
||||
!ifndef IID_IShellLink
|
||||
!define IID_IShellLinkA {000214ee-0000-0000-c000-000000000046}
|
||||
!define IID_IShellLinkW {000214f9-0000-0000-c000-000000000046}
|
||||
!ifdef NSIS_UNICODE
|
||||
!define IID_IShellLink ${IID_IShellLinkW}
|
||||
!else
|
||||
!define IID_IShellLink ${IID_IShellLinkA}
|
||||
!endif
|
||||
${NSISCOMIFACEDECL}IShellLink GetPath 3 (t,i,p,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetIDList 4 (*p)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetIDList 5 (p)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetDescription 6 (t,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetDescription 7 (t)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetWorkingDirectory 8 (t,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetWorkingDirectory 9 (t)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetArguments 10 (t,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetArguments 11 (t)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetHotkey 12 (*i0)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetHotkey 13 (&i2)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetShowCmd 14 (*i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetShowCmd 15 (i)i
|
||||
${NSISCOMIFACEDECL}IShellLink GetIconLocation 16 (t,i,*i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetIconLocation 17 (t,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetRelativePath 18 (t,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink Resolve 19 (p,i)i
|
||||
${NSISCOMIFACEDECL}IShellLink SetPath 20 (t)i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IShellLinkDataList
|
||||
!define IID_IShellLinkDataList {45e2b4ae-b1c3-11d0-b92f-00a0c90312e1}
|
||||
${NSISCOMIFACEDECL}IShellLinkDataList AddDataBlock 3 (p)i
|
||||
${NSISCOMIFACEDECL}IShellLinkDataList CopyDataBlock 4 (i,*p)i
|
||||
${NSISCOMIFACEDECL}IShellLinkDataList RemoveDataBlock 5 (i)i
|
||||
${NSISCOMIFACEDECL}IShellLinkDataList GetFlags 6 (*i)i
|
||||
${NSISCOMIFACEDECL}IShellLinkDataList SetFlags 7 (i)i
|
||||
!endif
|
||||
!define /ifndef EXP_SZ_LINK_SIG 0xA0000001
|
||||
!define /ifndef NT_CONSOLE_PROPS_SIG 0xA0000002
|
||||
!define /ifndef NT_FE_CONSOLE_PROPS_SIG 0xA0000004
|
||||
!define /ifndef EXP_SPECIAL_FOLDER_SIG 0xA0000005
|
||||
!define /ifndef EXP_DARWIN_ID_SIG 0xA0000006
|
||||
!define /ifndef EXP_SZ_ICON_SIG 0xA0000007
|
||||
!define /ifndef EXP_PROPERTYSTORAGE_SIG 0xA0000009
|
||||
;SHELL_LINK_DATA_FLAGS
|
||||
!define /ifndef SLDF_HAS_ID_LIST 0x00000001
|
||||
!define /ifndef SLDF_HAS_LINK_INFO 0x00000002
|
||||
!define /ifndef SLDF_HAS_NAME 0x00000004
|
||||
!define /ifndef SLDF_HAS_RELPATH 0x00000008
|
||||
!define /ifndef SLDF_HAS_WORKINGDIR 0x00000010
|
||||
!define /ifndef SLDF_HAS_ARGS 0x00000020
|
||||
!define /ifndef SLDF_HAS_ICONLOCATION 0x00000040
|
||||
!define /ifndef SLDF_UNICODE 0x00000080
|
||||
!define /ifndef SLDF_FORCE_NO_LINKINFO 0x00000100
|
||||
!define /ifndef SLDF_HAS_EXP_SZ 0x00000200
|
||||
!define /ifndef SLDF_RUN_IN_SEPARATE 0x00000400
|
||||
!define /ifndef SLDF_HAS_LOGO3ID 0x00000800
|
||||
!define /ifndef SLDF_HAS_DARWINID 0x00001000
|
||||
!define /ifndef SLDF_RUNAS_USER 0x00002000
|
||||
!define /ifndef SLDF_HAS_EXP_ICON_SZ 0x00004000
|
||||
!define /ifndef SLDF_NO_PIDL_ALIAS 0x00008000
|
||||
!define /ifndef SLDF_FORCE_UNCNAME 0x00010000
|
||||
!define /ifndef SLDF_RUN_WITH_SHIMLAYER 0x00020000
|
||||
!define /ifndef SLDF_FORCE_NO_LINKTRACK 0x00040000 ;[Vista+]
|
||||
!define /ifndef SLDF_ENABLE_TARGET_METADATA 0x00080000
|
||||
!define /ifndef SLDF_DISABLE_LINK_PATH_TRACKING 0x00100000 ;[Seven+]
|
||||
!define /ifndef SLDF_DISABLE_KNOWNFOLDER_RELATIVE_TRACKING 0x00200000
|
||||
!define /ifndef SLDF_NO_KF_ALIAS 0x00400000
|
||||
!define /ifndef SLDF_ALLOW_LINK_TO_LINK 0x00800000
|
||||
!define /ifndef SLDF_UNALIAS_ON_SAVE 0x01000000
|
||||
!define /ifndef SLDF_PREFER_ENVIRONMENT_PATH 0x02000000
|
||||
!define /ifndef SLDF_KEEP_LOCAL_IDLIST_FOR_UNC_TARGET 0x04000000
|
||||
!define /ifndef SLDF_PERSIST_VOLUME_ID_RELATIVE 0x08000000 ;[Eight+]
|
||||
|
||||
!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 CLSID_ApplicationDestinations
|
||||
!define CLSID_ApplicationDestinations {86c14003-4d6b-4ef3-a7b4-0506663b2e68}
|
||||
!endif
|
||||
!ifndef IID_IApplicationDestinations
|
||||
!define IID_IApplicationDestinations {12337D35-94C6-48A0-BCE7-6A9C69D4D600} ;[Seven+]
|
||||
${NSISCOMIFACEDECL}IApplicationDestinations SetAppID 3 (w)i
|
||||
${NSISCOMIFACEDECL}IApplicationDestinations RemoveDestination 4 (p)i ; IShellItem or IShellLink
|
||||
${NSISCOMIFACEDECL}IApplicationDestinations RemoveAllDestinations 5 ()i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_DestinationList
|
||||
!define CLSID_DestinationList {77f10cf0-3db5-4966-b520-b7c54fd35ed6}
|
||||
!endif
|
||||
!ifndef IID_ICustomDestinationList
|
||||
!define IID_ICustomDestinationList {6332debf-87b5-4670-90c0-5e57b408a49e} ;[Seven+]
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList SetAppID 3 (w)i
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList BeginList 4 (*i,g,*p)i ; IObjectArray or IEnumObjects
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList AppendCategory 5 (w,p)i ; IObjectArray*
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList AppendKnownCategory 6 (i)i
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList AddUserTasks 7 (p)i ; IObjectArray*
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList CommitList 8 ()i
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList GetRemovedDestinations 9 (g,*p)i ; IObjectCollection
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList DeleteList 10 (w)i
|
||||
${NSISCOMIFACEDECL}ICustomDestinationList AbortList 11 ()i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_EnumerableObjectCollection
|
||||
!define CLSID_EnumerableObjectCollection {2d3468c1-36a7-43b6-ac24-d3f02fd9607a}
|
||||
!endif
|
||||
!ifndef IID_IObjectArray
|
||||
!define IID_IObjectArray {92CA9DCD-5622-4bba-A805-5E9F541BD8C9}
|
||||
${NSISCOMIFACEDECL}IObjectArray GetCount 3 (*i)i
|
||||
${NSISCOMIFACEDECL}IObjectArray GetAt 4 (i,g,*p)i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IObjectCollection
|
||||
!define IID_IObjectCollection {5632b1a4-e38a-400a-928a-d4cd63230295} ; IObjectArray>
|
||||
${NSISCOMIFACEDECL}IObjectCollection AddObject 5 (p)i ; IUnknown*
|
||||
${NSISCOMIFACEDECL}IObjectCollection AddFromArray 6 (p)i ; IObjectArray*
|
||||
${NSISCOMIFACEDECL}IObjectCollection RemoveObjectAt 7 (i)i
|
||||
${NSISCOMIFACEDECL}IObjectCollection Clear 8 ()i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IEnumObjects
|
||||
!define IID_IEnumObjects {2c1c7e2e-2d0e-4059-831e-1e6f82335c2e}
|
||||
${NSISCOMIFACEDECL}IEnumObjects Next 3 (i,g,*p,*i)i
|
||||
${NSISCOMIFACEDECL}IEnumObjects Skip 4 (i)i
|
||||
${NSISCOMIFACEDECL}IEnumObjects Reset 5 ()i
|
||||
${NSISCOMIFACEDECL}IEnumObjects Clone 6 (*p)i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IEnumUnknown
|
||||
!define IID_IEnumUnknown {00000100-0000-0000-C000-000000000046}
|
||||
${NSISCOMIFACEDECL}IEnumUnknown Next 3 (i,*p,*i)i
|
||||
${NSISCOMIFACEDECL}IEnumUnknown Skip 4 (i)i
|
||||
${NSISCOMIFACEDECL}IEnumUnknown Reset 5 ()i
|
||||
${NSISCOMIFACEDECL}IEnumUnknown Clone 6 (*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
|
||||
|
||||
!ifndef IID_IPropertyStorage
|
||||
!define IID_IPropertyStorage {00000138-0000-0000-C000-000000000046}
|
||||
${NSISCOMIFACEDECL}IPropertyStorage ReadMultiple 3 (i,p,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage WriteMultiple 4 (i,p,p,i)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage DeleteMultiple 5 (i,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage ReadPropertyNames 6 (p,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage WritePropertyNames 7 (i,p,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage DeletePropertyNames 8 (i,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage Commit 9 (i)i ; Note: Some implementations might return E_NOTIMPL
|
||||
${NSISCOMIFACEDECL}IPropertyStorage Revert 10 ()i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage Enum 11 (*p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage SetTimes 12 (p,p,p)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage SetClass 13 (g)i
|
||||
${NSISCOMIFACEDECL}IPropertyStorage Stat 14 (p)i
|
||||
!endif
|
||||
|
||||
!ifndef IID_IPropertySetStorage
|
||||
!define IID_IPropertySetStorage {0000013A-0000-0000-C000-000000000046}
|
||||
${NSISCOMIFACEDECL}IPropertySetStorage Create 3 (g,g,i,i,*p)i
|
||||
${NSISCOMIFACEDECL}IPropertySetStorage Open 4 (g,i,*p)i
|
||||
${NSISCOMIFACEDECL}IPropertySetStorage Delete 5 (g)i
|
||||
${NSISCOMIFACEDECL}IPropertySetStorage Enum 6 (*p)i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_ApplicationAssociationRegistration
|
||||
!define CLSID_ApplicationAssociationRegistration {591209c7-767b-42b2-9fba-44ee4615f2c7}
|
||||
!endif
|
||||
!ifndef IID_IApplicationAssociationRegistration
|
||||
!define IID_IApplicationAssociationRegistration {4e530b0a-e611-4c77-a3ac-9031d022281b} ;[Vista+]
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryCurrentDefault 3 (w,i,i,*p)i
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryAppIsDefault 4 (w,i,i,w,*i)i
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryAppIsDefaultAll 5 (i,w,*i)i
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration SetAppAsDefault 6 (w,w,i)i
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration SetAppAsDefaultAll 7 (w)i
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistration ClearUserAssociations 8 ()i
|
||||
!endif
|
||||
!ifndef CLSID_ApplicationAssociationRegistrationUI
|
||||
!define CLSID_ApplicationAssociationRegistrationUI {1968106d-f3b5-44cf-890e-116fcb9ecef1}
|
||||
!endif
|
||||
!ifndef IID_IApplicationAssociationRegistrationUI
|
||||
!define IID_IApplicationAssociationRegistrationUI {1f76a169-f994-40ac-8fc8-0959e8874710} ;[Vista+]
|
||||
${NSISCOMIFACEDECL}IApplicationAssociationRegistrationUI LaunchAdvancedAssociationUI 3 (w)i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_GameExplorer
|
||||
!define CLSID_GameExplorer {9A5EA990-3034-4D6F-9128-01F3C61022BC}
|
||||
!endif
|
||||
!ifndef IID_IGameExplorer
|
||||
!define IID_IGameExplorer {E7B2FB72-D728-49B3-A5F2-18EBF5F1349E} ;[Vista+]
|
||||
${NSISCOMIFACEDECL}IGameExplorer AddGame 3 (p,p,i,g)i
|
||||
${NSISCOMIFACEDECL}IGameExplorer RemoveGame 4 (i,i,i,i)i ; The parameter is a GUID, not REFGUID so the 'g' type cannot be used!
|
||||
${NSISCOMIFACEDECL}IGameExplorer UpdateGame 5 (i,i,i,i)i
|
||||
${NSISCOMIFACEDECL}IGameExplorer VerifyAccess 6 (p,*i)i
|
||||
!endif
|
||||
!define /ifndef GIS_NOT_INSTALLED 1
|
||||
!define /ifndef GIS_CURRENT_USER 2
|
||||
!define /ifndef GIS_ALL_USERS 3
|
||||
!ifndef IID_IGameExplorer2
|
||||
!define IID_IGameExplorer2 {86874AA7-A1ED-450d-A7EB-B89E20B2FFF3} ;[Seven+]
|
||||
${NSISCOMIFACEDECL}IGameExplorer2 InstallGame 3 (w,w,i)i
|
||||
${NSISCOMIFACEDECL}IGameExplorer2 UninstallGame 4 (w)i
|
||||
${NSISCOMIFACEDECL}IGameExplorer2 CheckAccess 5 (w,*i)i
|
||||
!endif
|
||||
!ifndef CLSID_GameStatistics
|
||||
!define CLSID_GameStatistics {DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4}
|
||||
!endif
|
||||
!ifndef IID_IGameStatisticsMgr
|
||||
!define IID_IGameStatisticsMgr {AFF3EA11-E70E-407d-95DD-35E612C41CE2} ;[Seven+]
|
||||
${NSISCOMIFACEDECL}IGameStatisticsMgr GetGameStatistics 3 (w,i,*i,*p)i
|
||||
${NSISCOMIFACEDECL}IGameStatisticsMgr RemoveGameStatistics 4 (w)i
|
||||
!endif
|
||||
|
||||
!ifndef CLSID_InternetShortcut
|
||||
!define CLSID_InternetShortcut {FBF23B40-E3F0-101B-8488-00AA003E56F8}
|
||||
!endif
|
||||
!ifndef IID_IUniformResourceLocator
|
||||
!define IID_IUniformResourceLocatorA {FBF23B80-E3F0-101B-8488-00AA003E56F8}
|
||||
!define IID_IUniformResourceLocatorW {CABB0DA0-DA57-11CF-9974-0020AFD79762}
|
||||
!ifdef NSIS_UNICODE
|
||||
!define IID_IUniformResourceLocator ${IID_IUniformResourceLocatorW}
|
||||
!else
|
||||
!define IID_IUniformResourceLocator ${IID_IUniformResourceLocatorA}
|
||||
!endif
|
||||
${NSISCOMIFACEDECL}IUniformResourceLocator SetURL 3 (t,i)i
|
||||
${NSISCOMIFACEDECL}IUniformResourceLocator GetURL 4 (*p)i
|
||||
${NSISCOMIFACEDECL}IUniformResourceLocator InvokeCommand 5 (p)i
|
||||
!endif
|
||||
|
||||
!verbose pop
|
||||
!endif /* __WIN_COM__INC */
|
216
installer/tools/Include/Win/Propkey.nsh
Normal file
216
installer/tools/Include/Win/Propkey.nsh
Normal file
@ -0,0 +1,216 @@
|
||||
!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_I2 2
|
||||
!define VT_I4 3
|
||||
!define VT_BSTR 8
|
||||
!define VT_BOOL 11
|
||||
!define VT_I1 16
|
||||
!define VT_UI1 17
|
||||
!define VT_UI2 18
|
||||
!define VT_UI4 19
|
||||
!define VT_I8 20
|
||||
!define VT_UI8 21
|
||||
!define VT_INT 22
|
||||
!define VT_UINT 23
|
||||
!define VT_HRESULT 25
|
||||
!define VT_PTR 26
|
||||
!define VT_SAFEARRAY 27
|
||||
!define VT_LPSTR 30 ; SHStrDupA
|
||||
!define VT_LPWSTR 31 ; SHStrDupW
|
||||
!define VT_FILETIME 64
|
||||
!define VT_STREAM 66
|
||||
!define VT_CLSID 72 ; Pointer to CoTaskMem allocated GUID
|
||||
!define VT_TYPEMASK 0xFFF
|
||||
!define VT_VECTOR 0x1000
|
||||
!define VT_ARRAY 0x2000
|
||||
!define VT_BYREF 0x4000
|
||||
|
||||
!define /ifndef VARIANT_TRUE -1
|
||||
!define /ifndef VARIANT_FALSE 0
|
||||
|
||||
!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
|
||||
|
||||
!define STGC_DEFAULT 0
|
||||
!define STGC_OVERWRITE 1
|
||||
!define STGC_ONLYIFCURRENT 2
|
||||
!define STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE 4
|
||||
!define STGC_CONSOLIDATE 8
|
||||
|
||||
|
||||
/**************************************************
|
||||
OAIdl.h
|
||||
**************************************************/
|
||||
!if "${NSIS_PTR_SIZE}" > 4
|
||||
!define SYSSIZEOF_VARIANT 24
|
||||
!define SYSSTRUCT_VARIANT (&i2,&i6,&i8,&i8)
|
||||
!else
|
||||
!define SYSSIZEOF_VARIANT 16
|
||||
!define SYSSTRUCT_VARIANT (&i2,&i6,&i8)
|
||||
!endif
|
||||
|
||||
|
||||
/**************************************************
|
||||
PropIdl.h
|
||||
**************************************************/
|
||||
!if "${NSIS_PTR_SIZE}" > 4
|
||||
!define SYSSIZEOF_PROPVARIANT 24
|
||||
!define SYSSTRUCT_PROPVARIANT (&i2,&i6,&i8,&i8)
|
||||
!else
|
||||
!define SYSSIZEOF_PROPVARIANT 16
|
||||
!define SYSSTRUCT_PROPVARIANT (&i2,&i6,&i8)
|
||||
!endif
|
||||
|
||||
!define PRSPEC_LPWSTR 0
|
||||
!define PRSPEC_PROPID 1
|
||||
!define SYSSTRUCT_PROPSPEC (p,p)
|
||||
|
||||
|
||||
/**************************************************
|
||||
Propkey.h
|
||||
**************************************************/
|
||||
!define PKEY_AppUserModel_RelaunchCommand '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",2' ; VT_LPWSTR (SHGetPropertyStoreForWindow)
|
||||
!define PKEY_AppUserModel_RelaunchIconResource '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",3' ; VT_LPWSTR (SHGetPropertyStoreForWindow, optional. Path to icon or module, with resource ID or index.)
|
||||
!define PKEY_AppUserModel_RelaunchDisplayNameResource '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",4' ; VT_LPWSTR (SHGetPropertyStoreForWindow. @ style indirect resource string or a plain string.)
|
||||
!define PKEY_AppUserModel_ID '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",5' ; VT_LPWSTR
|
||||
!define PKEY_AppUserModel_IsDestListSeparator '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",6' ; VT_BOOL
|
||||
!define PKEY_AppUserModel_ExcludeFromShowInNewInstall '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",8' ; VT_BOOL
|
||||
!define PKEY_AppUserModel_PreventPinning '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",9' ; VT_BOOL
|
||||
!define PKEY_AppUserModel_IsDualMode '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",11' ; [Eight+] VT_BOOL
|
||||
!define APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL 1
|
||||
!define APPUSERMODEL_STARTPINOPTION_USERPINNED 2
|
||||
!define PKEY_AppUserModel_StartPinOption '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",12' ; [Eight+] VT_UI4
|
||||
!define PKEY_AppUserModel_ToastActivatorCLSID '"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}",26' ; [10FU1507+] VT_CLSID
|
||||
!define PKEY_EdgeGesture_DisableTouchWhenFullscreen '"{32CE38B2-2C9A-41B1-9BC5-B3784394AA44}",2' ; [Eight+] VT_BOOL (SHGetPropertyStoreForWindow)
|
||||
|
||||
|
||||
/**************************************************
|
||||
ShlGuid.h & ShlObj.h
|
||||
**************************************************/
|
||||
!define FMTID_Intshcut {000214A0-0000-0000-C000-000000000046}
|
||||
!define PID_IS_URL 2 ; VT_LPWSTR
|
||||
!define PID_IS_HOTKEY 6 ; VT_UI2
|
||||
!define PID_IS_ICONINDEX 8 ; VT_I4
|
||||
!define PID_IS_ICONFILE 9 ; VT_LPWSTR
|
||||
!define PKEY_Intshcut_Url '"${FMTID_Intshcut}",${PID_IS_URL}' ; Undocumented
|
||||
!define FMTID_InternetSite {000214A1-0000-0000-C000-000000000046}
|
||||
!define PID_INTSITE_LASTVISIT 4 ; VT_FILETIME
|
||||
!define PID_INTSITE_VISITCOUNT 6 ; VT_UI4
|
||||
|
||||
|
||||
/**************************************************
|
||||
Helper macros
|
||||
**************************************************/
|
||||
!define V_GetVT '!insertmacro V_GetVT '
|
||||
!macro V_GetVT pPV sysdst
|
||||
System::Call '*${pPV}(&i2.${sysdst})'
|
||||
!macroend
|
||||
!define V_SetVT '!insertmacro V_SetVT '
|
||||
!macro V_SetVT pPV syssrc
|
||||
System::Call '*${pPV}(&i2 ${syssrc})'
|
||||
!macroend
|
||||
!macro V_GetHelper sysvaltyp pPV sysdst
|
||||
System::Call '*${pPV}(l,${sysvaltyp}.${sysdst})'
|
||||
!macroend
|
||||
!macro V_GenericSetHelper sysvaltyp pPV VT syssrc
|
||||
!if "${VT}" != "" ; Setting the VT is optional
|
||||
System::Call '*${pPV}(&i2 ${VT},&i6,${sysvaltyp}${syssrc})'
|
||||
!else
|
||||
System::Call '*${pPV}(l,${sysvaltyp}${syssrc})'
|
||||
!endif
|
||||
!macroend
|
||||
!macro V_SpecificSetHelper VT sysvaltyp pPV syssrc
|
||||
System::Call '*${pPV}(&i2 ${VT},&i6,${sysvaltyp}${syssrc})'
|
||||
!macroend
|
||||
!macro Make_V_GetterSetter name sysvaltyp setsep
|
||||
!define V_Get${name} '!insertmacro V_GetHelper "${sysvaltyp}" '
|
||||
!ifdef VT_${name}
|
||||
!define V_Set${name} '!insertmacro V_SpecificSetHelper ${VT_${name}} "${sysvaltyp}${setsep}" '
|
||||
!else
|
||||
!define V_Set${name} '!insertmacro V_GenericSetHelper "${sysvaltyp}${setsep}" '
|
||||
!endif
|
||||
!macroend
|
||||
!insertmacro Make_V_GetterSetter Int8 "&i1" " " ; Generic
|
||||
!insertmacro Make_V_GetterSetter Int16 "&i2" " " ; Generic
|
||||
!insertmacro Make_V_GetterSetter Int32 "i" "" ; Generic
|
||||
!insertmacro Make_V_GetterSetter Int64 "l" "" ; Generic
|
||||
!insertmacro Make_V_GetterSetter Pointer "p" "" ; Generic
|
||||
!insertmacro Make_V_GetterSetter I4 "i" " "
|
||||
!insertmacro Make_V_GetterSetter BOOL "&i2" " "
|
||||
!insertmacro Make_V_GetterSetter FILETIME "l" ""
|
||||
|
||||
!macro VariantInit pV
|
||||
${V_SetVT} ${pV} ${VT_EMPTY}
|
||||
!macroend
|
||||
!macro VariantClear pV
|
||||
System::Call 'OLEAUT32::#9(p${pV})'
|
||||
!macroend
|
||||
!macro VariantCopy pDstV pSrcV sysretHR
|
||||
System::Call 'OLEAUT32::#10(p${pDstV},p${pSrcV})i.${sysretHR}' ; (Frees the destination variant before it copies the source)
|
||||
!macroend
|
||||
!macro VariantCopyInd pDstV pSrcV sysretHR
|
||||
System::Call 'OLEAUT32::#11(p${pDstV},p${pSrcV})i.${sysretHR}' ; (Frees the destination variant before it copies the source)
|
||||
!macroend
|
||||
!macro VariantChangeType pDstV pSrcV Flags VT sysretHR
|
||||
System::Call 'OLEAUT32::#12(p${pDstV},p${pSrcV},i${Flags},i${VT})i.${sysretHR}' ; (Might free the destination on success)
|
||||
!macroend
|
||||
|
||||
|
||||
!macro PropVariantClear pPV
|
||||
System::Call 'OLE32::PropVariantClear(p${pPV})' ; WinNT4.SP0+, Win98+, IE4+
|
||||
!macroend
|
||||
!macro PropVariantCopy pDstPV pSrcPV sysretHR
|
||||
System::Call 'OLE32::PropVariantCopy(p${pDstPV},p${pSrcPV})i.${sysretHR}' ; WinNT4.SP0+, Win98+, IE4+ (Does NOT free the destination before it copies the source)
|
||||
!macroend
|
||||
!macro PropVariantChangeType pDstPV pSrcPV VT sysretHR
|
||||
!ifdef NSIS_ARM | NSIS_ARM32 | NSIS_ARMNT | NSIS_ARM64
|
||||
System::Call 'PROPSYS::PropVariantChangeType(p${pDstPV},p${pSrcPV},i0,i${VT})i.${sysretHR}'
|
||||
!else
|
||||
Push "${VT}"
|
||||
Push ${pSrcPV}
|
||||
Push ${pDstPV}
|
||||
!include Util.nsh
|
||||
${CallArtificialFunction} TryPropVariantChangeType
|
||||
System::Call 'KERNEL32::SetLastError(is${sysretHR})' ; A hack to move the result from the stack to somewhere with System variable syntax
|
||||
!endif
|
||||
!macroend
|
||||
!macro TryPropVariantChangeType
|
||||
System::Store S
|
||||
System::Call 'PROPSYS::PropVariantChangeType(psr1,psr2,i0,isr3)i.r0' ; Vista+ (Source and destination cannot be the same address)
|
||||
StrCmp $0 error "" done
|
||||
System::Call 'OLE32::PropVariantChangeType(pr1,pr2,i0,i0,ir3})i.r0' ; 2000+ (Source and destination cannot be the same address)
|
||||
!if ${NSIS_PTR_SIZE} < 8
|
||||
StrCmp $0 error "" done
|
||||
!insertmacro VariantChangeType $1 $2 0 $3 r0 ; This is not really correct but there is no PROPVARIANT support on these platforms. Might free the destination!
|
||||
!endif
|
||||
done:
|
||||
Push $0
|
||||
System::Store L
|
||||
!macroend
|
||||
|
||||
|
||||
!macro IPropertyStorage_ReadPropById pPS ID pPV sysoutHR
|
||||
System::Call '*(p${PRSPEC_PROPID},p${ID})p.s'
|
||||
${IPropertyStorage::ReadMultiple} ${pPS} '(1,pss,p${pPV})${sysoutHR}'
|
||||
System::Free
|
||||
!macroend
|
||||
|
||||
!macro IPropertyStorage_WritePropById pPS ID pPV sysoutHR
|
||||
System::Call '*(p${PRSPEC_PROPID},p${ID})p.s'
|
||||
${IPropertyStorage::WriteMultiple} ${pPS} '(1,pss,p${pPV},2)${sysoutHR}'
|
||||
System::Free
|
||||
!macroend
|
||||
|
||||
|
||||
!verbose pop
|
||||
!endif /* __WIN_PROPKEY__INC */
|
117
installer/tools/Include/Win/RestartManager.nsh
Normal file
117
installer/tools/Include/Win/RestartManager.nsh
Normal file
@ -0,0 +1,117 @@
|
||||
!ifndef __WIN_RESTARTMANAGER__INC
|
||||
!define __WIN_RESTARTMANAGER__INC 1
|
||||
|
||||
/**************************************************
|
||||
WinBase.h
|
||||
**************************************************/
|
||||
!define /IfNDef RESTART_MAX_CMD_LINE 1024
|
||||
|
||||
!define /IfNDef RESTART_NO_CRASH 1
|
||||
!define /IfNDef RESTART_NO_HANG 2
|
||||
!define /IfNDef RESTART_NO_PATCH 4
|
||||
!define /IfNDef RESTART_NO_REBOOT 8 ; Do not restart the process when the system is rebooted due to patch installations
|
||||
|
||||
!define /IfNDef RECOVERY_DEFAULT_PING_INTERVAL 5000
|
||||
!define /IfNDef /math RECOVERY_MAX_PING_INTERVAL 5000 * 60
|
||||
|
||||
|
||||
/**************************************************
|
||||
RestartManager.h
|
||||
**************************************************/
|
||||
!define RM_SESSION_KEY_LEN 16
|
||||
!define CCH_RM_SESSION_KEY 32
|
||||
!define CCH_RM_MAX_APP_NAME 255
|
||||
!define CCH_RM_MAX_SVC_NAME 63
|
||||
!define RM_INVALID_TS_SESSION -1
|
||||
!define RM_INVALID_PROCESS -1
|
||||
|
||||
!define RmUnknownApp 0
|
||||
!define RmMainWindow 1
|
||||
!define RmOtherWindow 2
|
||||
!define RmService 3
|
||||
!define RmExplorer 4
|
||||
!define RmConsole 5
|
||||
!define RmCritical 1000 ; Application is critical system process where a reboot is required to restart
|
||||
|
||||
!define RmForceShutdown 0x1 ; Force unresponsive applications and services to shut down after the timeout period
|
||||
!define RmShutdownOnlyRegistered 0x10 ; Only shutdown apps if all apps registered for restart (RegisterApplicationRestart)
|
||||
|
||||
!define RmStatusUnknown 0
|
||||
!define RmStatusRunning 1
|
||||
!define RmStatusStopped 2 ; Application stopped by Restart Manager
|
||||
!define RmStatusStoppedOther 4
|
||||
!define RmStatusRestarted 8
|
||||
!define RmStatusErrorOnStop 0x10
|
||||
!define RmStatusErrorOnRestart 0x20
|
||||
!define RmStatusShutdownMasked 0x40
|
||||
!define RmStatusRestartMasked 0x80
|
||||
|
||||
!define RmRebootReasonNone 0
|
||||
!define RmRebootReasonPermissionDenied 1
|
||||
!define RmRebootReasonSessionMismatch 2
|
||||
!define RmRebootReasonCriticalProcess 4
|
||||
!define RmRebootReasonCriticalService 8
|
||||
!define RmRebootReasonDetectedSelf 0x10
|
||||
|
||||
|
||||
!define SYSSIZEOF_RM_UNIQUE_PROCESS 12
|
||||
!define SYSSTRUCT_RM_UNIQUE_PROCESS (i,l)
|
||||
|
||||
|
||||
!include LogicLib.nsh
|
||||
!include Util.nsh
|
||||
|
||||
|
||||
!macro RestartManager_StartSession outvarhandle
|
||||
System::Call 'RSTRTMGR::RmStartSession(*i-1s, i0, w)i.s'
|
||||
Pop ${outvarhandle}
|
||||
${If} ${outvarhandle} <> 0
|
||||
${OrIf} ${outvarhandle} == error
|
||||
Pop ${outvarhandle}
|
||||
Push ""
|
||||
${EndIf}
|
||||
Pop ${outvarhandle}
|
||||
!macroend
|
||||
|
||||
!macro RestartManager_EndSession handle
|
||||
System::Call 'RSTRTMGR::RmEndSession(i${handle})'
|
||||
!macroend
|
||||
|
||||
!macro RestartManager_RegisterFile handle path
|
||||
System::Call 'RSTRTMGR::RmRegisterResources(i${handle},i1,*ws,i0,p0,i0,p0)i.r0' "${path}"
|
||||
!macroend
|
||||
|
||||
!macro RestartManager_Shutdown handle
|
||||
System::Call 'RSTRTMGR::RmShutdown(i${handle}, i${RmForceShutdown}, p0)'
|
||||
!macroend
|
||||
|
||||
!macro RestartManager_Restart handle
|
||||
System::Call 'RSTRTMGR::RmRestart(i${handle}, i0, p0)'
|
||||
!macroend
|
||||
|
||||
|
||||
!macro RestartManager_ShutdownFile fullpath outvar_errcode
|
||||
Push "${fullpath}"
|
||||
!insertmacro CallArtificialFunction RestartManager_ShutdownFileImp
|
||||
Pop ${outvar_errcode}
|
||||
!macroend
|
||||
!macro RestartManager_ShutdownFileImp
|
||||
Exch $1
|
||||
Push $0
|
||||
System::Call 'RSTRTMGR::RmStartSession(*i-1s, i0, w)i.r0'
|
||||
${If} $0 == error
|
||||
Pop $0
|
||||
StrCpy $0 1150
|
||||
${Else}
|
||||
System::Call 'RSTRTMGR::RmRegisterResources(isr1,i1,*wr1,i0,p0,i0,p0)i.r0'
|
||||
${If} $0 = 0
|
||||
System::Call 'RSTRTMGR::RmShutdown(ir1, i${RmForceShutdown}, p0)i.r0'
|
||||
${EndIf}
|
||||
System::Call 'RSTRTMGR::RmEndSession(ir1)'
|
||||
${EndIf}
|
||||
Exch
|
||||
Pop $1
|
||||
Exch $0
|
||||
!macroend
|
||||
|
||||
!endif ;~ Include guard
|
67
installer/tools/Include/Win/WinDef.nsh
Normal file
67
installer/tools/Include/Win/WinDef.nsh
Normal file
@ -0,0 +1,67 @@
|
||||
!ifndef __WIN_WINDEF__INC
|
||||
!define __WIN_WINDEF__INC
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!ifndef __WIN_NOINC_WINDEF
|
||||
|
||||
|
||||
!define /ifndef MAX_PATH 260
|
||||
#define NULL 0
|
||||
|
||||
|
||||
!macro _Win_MINMAX _intcmp _j1 _j2 _outvar _a _b
|
||||
${_intcmp} "${_a}" "${_b}" ${_j1} ${_j1} ${_j2}
|
||||
StrCpy ${_outvar} "${_a}"
|
||||
goto +2
|
||||
StrCpy ${_outvar} "${_b}"
|
||||
!macroend
|
||||
!ifndef __WIN_MS_NOMINMAX & min & max & min_u & max_u
|
||||
!define min "!insertmacro _Win_MINMAX IntCmp +1 +3 "
|
||||
!define max "!insertmacro _Win_MINMAX IntCmp +3 +1 "
|
||||
!define min_u "!insertmacro _Win_MINMAX IntCmpU +1 +3 "
|
||||
!define max_u "!insertmacro _Win_MINMAX IntCmpU +3 +1 "
|
||||
!endif
|
||||
|
||||
!macro _Win_LOBYTE _outvar _in
|
||||
IntOp ${_outvar} "${_in}" & 0xFF
|
||||
!macroend
|
||||
!define LOBYTE "!insertmacro _Win_LOBYTE "
|
||||
|
||||
!macro _Win_HIBYTE _outvar _in
|
||||
IntOp ${_outvar} "${_in}" >> 8
|
||||
${LOBYTE} ${_outvar} ${_outvar}
|
||||
!macroend
|
||||
!define HIBYTE "!insertmacro _Win_HIBYTE "
|
||||
|
||||
!macro _Win_LOWORD _outvar _in
|
||||
IntOp ${_outvar} "${_in}" & 0xFFFF
|
||||
!macroend
|
||||
!define LOWORD "!insertmacro _Win_LOWORD "
|
||||
|
||||
!macro _Win_HIWORD _outvar _in
|
||||
IntOp ${_outvar} "${_in}" >>> 16
|
||||
!macroend
|
||||
!define HIWORD "!insertmacro _Win_HIWORD "
|
||||
|
||||
!macro _Win_MAKEWORD _outvar _tmpvar _lo _hi
|
||||
${LOBYTE} ${_outvar} "${_hi}"
|
||||
${LOBYTE} ${_tmpvar} "${_lo}"
|
||||
IntOp ${_outvar} ${_outvar} << 8
|
||||
IntOp ${_outvar} ${_outvar} | ${_tmpvar}
|
||||
!macroend
|
||||
!define MAKEWORD "!insertmacro _Win_MAKEWORD "
|
||||
|
||||
!macro _Win_MAKELONG32 _outvar _tmpvar _wlo _whi
|
||||
${LOWORD} ${_outvar} "${_wlo}"
|
||||
IntOp ${_tmpvar} "${_whi}" << 16
|
||||
IntOp ${_outvar} ${_outvar} | ${_tmpvar}
|
||||
!macroend
|
||||
!define MAKELONG "!insertmacro _Win_MAKELONG32 "
|
||||
!define MAKEWPARAM "${MAKELONG}"
|
||||
!define MAKELPARAM "${MAKELONG}"
|
||||
!define MAKELRESULT "${MAKELONG}"
|
||||
|
||||
|
||||
!endif /* __WIN_NOINC_WINDEF */
|
||||
!verbose pop
|
||||
!endif /* __WIN_WINDEF__INC */
|
155
installer/tools/Include/Win/WinError.nsh
Normal file
155
installer/tools/Include/Win/WinError.nsh
Normal file
@ -0,0 +1,155 @@
|
||||
!ifndef __WIN_WINERROR__INC
|
||||
!define __WIN_WINERROR__INC
|
||||
!verbose push
|
||||
!verbose 3
|
||||
|
||||
!ifndef __WIN_NOINC_WINERROR
|
||||
#define NO_ERROR 0
|
||||
!define ERROR_SUCCESS 0
|
||||
!define ERROR_INVALID_FUNCTION 1
|
||||
!define ERROR_FILE_NOT_FOUND 2
|
||||
!define ERROR_PATH_NOT_FOUND 3
|
||||
!define ERROR_TOO_MANY_OPEN_FILES 4
|
||||
!define ERROR_ACCESS_DENIED 5
|
||||
!define ERROR_INVALID_HANDLE 6
|
||||
!define ERROR_ARENA_TRASHED 7
|
||||
!define ERROR_NOT_ENOUGH_MEMORY 8
|
||||
!define ERROR_INVALID_BLOCK 9
|
||||
!define ERROR_BAD_ENVIRONMENT 10
|
||||
!define ERROR_BAD_FORMAT 11
|
||||
!define ERROR_INVALID_ACCESS 12
|
||||
!define ERROR_INVALID_DATA 13
|
||||
!define ERROR_OUTOFMEMORY 14
|
||||
!define ERROR_INVALID_DRIVE 15
|
||||
!define ERROR_CURRENT_DIRECTORY 16
|
||||
!define ERROR_NOT_SAME_DEVICE 17
|
||||
!define ERROR_NO_MORE_FILES 18
|
||||
!define ERROR_WRITE_PROTECT 19
|
||||
!define ERROR_BAD_UNIT 20
|
||||
!define ERROR_NOT_READY 21
|
||||
!define ERROR_BAD_COMMAND 22
|
||||
!define ERROR_CRC 23
|
||||
!define ERROR_BAD_LENGTH 24
|
||||
!define ERROR_SEEK 25
|
||||
!define ERROR_NOT_DOS_DISK 26
|
||||
!define ERROR_SECTOR_NOT_FOUND 27
|
||||
!define ERROR_OUT_OF_PAPER 28
|
||||
!define ERROR_WRITE_FAULT 29
|
||||
!define ERROR_READ_FAULT 30
|
||||
!define ERROR_GEN_FAILURE 31
|
||||
!define ERROR_SHARING_VIOLATION 32
|
||||
!define ERROR_LOCK_VIOLATION 33
|
||||
!define ERROR_WRONG_DISK 34
|
||||
!define ERROR_SHARING_BUFFER_EXCEEDED 36
|
||||
!define ERROR_HANDLE_EOF 38
|
||||
!define ERROR_HANDLE_DISK_FULL 39
|
||||
!define ERROR_NOT_SUPPORTED 50
|
||||
!define ERROR_CANNOT_MAKE 82 ; "The directory or file cannot be created"
|
||||
!define ERROR_INVALID_PARAMETER 87
|
||||
!define ERROR_DISK_FULL 112
|
||||
!define ERROR_CALL_NOT_IMPLEMENTED 120 ; "This function is not supported on this system"
|
||||
!define ERROR_INSUFFICIENT_BUFFER 122
|
||||
!define ERROR_INVALID_NAME 123 ; "The filename, directory name, or volume label syntax is incorrect"
|
||||
!define ERROR_MOD_NOT_FOUND 126 ; "The specified module could not be found"
|
||||
!define ERROR_BAD_ARGUMENTS 160
|
||||
!define ERROR_BAD_PATHNAME 161
|
||||
!define ERROR_LOCK_FAILED 167 ; "Unable to lock a region of a file"
|
||||
!define ERROR_BUSY 170 ; "The requested resource is in use"
|
||||
!define ERROR_ALREADY_EXISTS 183 ; "Cannot create a file when that file already exists"
|
||||
!define ERROR_FILENAME_EXCED_RANGE 206 ; "The filename or extension is too long"
|
||||
!define ERROR_EXE_MACHINE_TYPE_MISMATCH 216 ; "This version of %1 is not compatible with the version of Windows you're running"
|
||||
!define ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT 308
|
||||
!define ERROR_DATA_CHECKSUM_ERROR 323
|
||||
!define ERROR_ELEVATION_REQUIRED 740
|
||||
!define ERROR_SERVICE_DOES_NOT_EXIST 1060
|
||||
!define ERROR_NO_MEDIA_IN_DRIVE 1112
|
||||
!define ERROR_NO_UNICODE_TRANSLATION 1113
|
||||
!define ERROR_DLL_INIT_FAILED 1114
|
||||
!define ERROR_SHUTDOWN_IN_PROGRESS 1115
|
||||
!define ERROR_OLD_WIN_VERSION 1150 ; "The specified program requires a newer version of Windows"
|
||||
!define ERROR_APP_WRONG_OS 1151 ; "The specified program is not a Windows or MS-DOS program"
|
||||
!define ERROR_SINGLE_INSTANCE_APP 1152 ; "Cannot start more than one instance of the specified program"
|
||||
!define ERROR_RMODE_APP 1153 ; "The specified program was written for an earlier version of Windows"
|
||||
!define ERROR_INVALID_DLL 1154
|
||||
!define ERROR_NO_ASSOCIATION 1155
|
||||
!define ERROR_DDE_FAIL 1156
|
||||
!define ERROR_DLL_NOT_FOUND 1157
|
||||
!define ERROR_NOT_FOUND 1168 ; "Element not found"
|
||||
!define ERROR_NO_MATCH 1169 ; "There was no match for the specified key in the index"
|
||||
!define ERROR_NO_VOLUME_ID 1173
|
||||
!define ERROR_UNABLE_TO_REMOVE_REPLACED 1175 ; "Unable to remove the file to be replaced"
|
||||
!define ERROR_UNABLE_TO_MOVE_REPLACEMENT 1176
|
||||
!define ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 1177
|
||||
!define ERROR_SHUTDOWN_IS_SCHEDULED 1190
|
||||
!define ERROR_SHUTDOWN_USERS_LOGGED_ON 1191 ; "The system shutdown cannot be initiated because there are other users logged on to the computer"
|
||||
!define ERROR_NO_NETWORK 1222
|
||||
!define ERROR_CANCELLED 1223 ; "The operation was canceled by the user"
|
||||
!define ERROR_RETRY 1237
|
||||
!define ERROR_SERVICE_NOT_FOUND 1243
|
||||
!define ERROR_NOT_AUTHENTICATED 1244
|
||||
!define ERROR_UNIDENTIFIED_ERROR 1287
|
||||
!define ERROR_PRIVILEGE_NOT_HELD 1314
|
||||
!define ERROR_LOGON_FAILURE 1326 ; "The user name or password is incorrect"
|
||||
!define ERROR_INTERNAL_ERROR 1359 ; "An internal error occurred"
|
||||
!define ERROR_FILE_CORRUPT 1392 ; "The file or directory is corrupted and unreadable"
|
||||
!define ERROR_INVALID_WINDOW_HANDLE 1400 ; "Invalid window handle"
|
||||
!define ERROR_INVALID_INDEX 1413
|
||||
!define ERROR_TIMEOUT 1460
|
||||
!define ERROR_SYMLINK_NOT_SUPPORTED 1464
|
||||
!define ERROR_XML_PARSE_ERROR 1465
|
||||
!define ERROR_RESTART_APPLICATION 1467 ; "This application must be restarted"
|
||||
!define ERROR_INSTALL_USEREXIT 1602 ; "User cancelled installation"
|
||||
!define ERROR_INSTALL_FAILURE 1603 ; "Fatal error during installation"
|
||||
!define ERROR_INSTALL_SUSPEND 1604 ; "Installation suspended, incomplete"
|
||||
!define ERROR_UNKNOWN_PRODUCT 1605 ; "This action is only valid for products that are currently installed"
|
||||
!define ERROR_BAD_CONFIGURATION 1610
|
||||
!define ERROR_INSTALL_SOURCE_ABSENT 1612
|
||||
!define ERROR_PRODUCT_UNINSTALLED 1614
|
||||
!define ERROR_INSTALL_ALREADY_RUNNING 1618 ; "Another installation is already in progress. Complete that installation before proceeding with this install."
|
||||
!define ERROR_INSTALL_PACKAGE_INVALID 1620
|
||||
!define ERROR_INSTALL_LOG_FAILURE 1622
|
||||
!define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623
|
||||
!define ERROR_FUNCTION_FAILED 1627
|
||||
!define ERROR_DATATYPE_MISMATCH 1629
|
||||
!define ERROR_UNSUPPORTED_TYPE 1630
|
||||
!define ERROR_INSTALL_TEMP_UNWRITABLE 1632 ; "The Temp folder is on a drive that is full or is inaccessible"
|
||||
!define ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633 ; "This installation package is not supported by this processor type. Contact your product vendor."
|
||||
!define ERROR_PRODUCT_VERSION 1638 ; "Another version of this product is already installed"
|
||||
!define ERROR_SUCCESS_REBOOT_INITIATED 1641 ; "The requested operation completed successfully. The system will be restarted so the changes can take effect."
|
||||
!define ERROR_INSTALL_REJECTED 1654 ; "The app that you are trying to run is not supported on this version of Windows"
|
||||
!define ERROR_TAG_NOT_FOUND 2012
|
||||
!define ERROR_BAD_USERNAME 2202 ; "The user name or group name parameter is invalid"
|
||||
!define ERROR_SUCCESS_REBOOT_REQUIRED 3010
|
||||
!define ERROR_SUCCESS_RESTART_REQUIRED 3011
|
||||
!define ERROR_INSTALL_INVALID_PACKAGE 15602
|
||||
!define ERROR_INSTALL_OUT_OF_DISK_SPACE 15604
|
||||
!define ERROR_INSTALL_CANCEL 15608 ; "User cancelled the install request"
|
||||
!define ERROR_INSTALL_FAILED 15609
|
||||
!define ERROR_REMOVE_FAILED 15610
|
||||
!define ERROR_NEEDS_REMEDIATION 15612 ; "The application cannot be started. Try reinstalling the application to fix the problem."
|
||||
|
||||
!define SEVERITY_SUCCESS 0
|
||||
!define SEVERITY_ERROR 1
|
||||
!define FACILITY_STORAGE 3
|
||||
!define FACILITY_WIN32 7
|
||||
!define FACILITY_SECURITY 9
|
||||
!define FACILITY_SETUPAPI 15
|
||||
!define FACILITY_SXS 23
|
||||
!define /IfNDef S_OK 0
|
||||
!define /IfNDef S_FALSE 1
|
||||
!define E_UNEXPECTED 0x8000FFFF
|
||||
!define E_NOTIMPL 0x80004001
|
||||
!define E_OUTOFMEMORY 0x8007000E
|
||||
!define E_INVALIDARG 0x80070057
|
||||
!define E_NOINTERFACE 0x80004002
|
||||
!define E_POINTER 0x80004003
|
||||
!define E_HANDLE 0x80070006
|
||||
!define E_ABORT 0x80004004
|
||||
!define E_FAIL 0x80004005
|
||||
!define E_ACCESSDENIED 0x80070005
|
||||
!define E_PENDING 0x8000000A
|
||||
|
||||
!endif /* __WIN_NOINC_WINERROR */
|
||||
|
||||
!verbose pop
|
||||
!endif /* __WIN_WINERROR__INC */
|
224
installer/tools/Include/Win/WinNT.nsh
Normal file
224
installer/tools/Include/Win/WinNT.nsh
Normal file
@ -0,0 +1,224 @@
|
||||
!ifndef __WIN_WINNT__INC
|
||||
!define __WIN_WINNT__INC
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!ifndef __WIN_NOINC_WINNT
|
||||
|
||||
|
||||
#define MINCHAR 0x80
|
||||
#define MAXCHAR 0x7f
|
||||
!define MINSHORT 0x8000
|
||||
!define MAXSHORT 0x7fff
|
||||
!define MINLONG 0x80000000
|
||||
!define MAXLONG 0x7fffffff
|
||||
!define MAXBYTE 0xff
|
||||
!define MAXWORD 0xffff
|
||||
!define MAXDWORD 0xffffffff
|
||||
|
||||
!ifndef WIN32_NO_STATUS
|
||||
!define STATUS_WAIT_0 0x00000000
|
||||
!define STATUS_ABANDONED_WAIT_0 0x00000080
|
||||
!define STATUS_USER_APC 0x000000C0
|
||||
!define STATUS_TIMEOUT 0x00000102
|
||||
!define STATUS_PENDING 0x00000103
|
||||
!define DBG_EXCEPTION_HANDLED 0x00010001
|
||||
!define DBG_CONTINUE 0x00010002
|
||||
!define STATUS_SEGMENT_NOTIFICATION 0x40000005
|
||||
!define DBG_TERMINATE_THREAD 0x40010003
|
||||
!define DBG_TERMINATE_PROCESS 0x40010004
|
||||
!define DBG_CONTROL_C 0x40010005
|
||||
!define DBG_CONTROL_BREAK 0x40010008
|
||||
!define DBG_COMMAND_EXCEPTION 0x40010009
|
||||
!define STATUS_GUARD_PAGE_VIOLATION 0x80000001
|
||||
!define STATUS_DATATYPE_MISALIGNMENT 0x80000002
|
||||
!define STATUS_BREAKPOINT 0x80000003
|
||||
!define STATUS_SINGLE_STEP 0x80000004
|
||||
!define DBG_EXCEPTION_NOT_HANDLED 0x80010001
|
||||
!define STATUS_ACCESS_VIOLATION 0xC0000005
|
||||
!define STATUS_IN_PAGE_ERROR 0xC0000006
|
||||
!define STATUS_INVALID_HANDLE 0xC0000008
|
||||
!define STATUS_NO_MEMORY 0xC0000017
|
||||
!define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
|
||||
!define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
|
||||
!define STATUS_INVALID_DISPOSITION 0xC0000026
|
||||
!define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
|
||||
!define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
|
||||
!define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
|
||||
!define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
|
||||
!define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
|
||||
!define STATUS_FLOAT_OVERFLOW 0xC0000091
|
||||
!define STATUS_FLOAT_STACK_CHECK 0xC0000092
|
||||
!define STATUS_FLOAT_UNDERFLOW 0xC0000093
|
||||
!define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
|
||||
!define STATUS_INTEGER_OVERFLOW 0xC0000095
|
||||
!define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
|
||||
!define STATUS_STACK_OVERFLOW 0xC00000FD
|
||||
!define STATUS_CONTROL_C_EXIT 0xC000013A
|
||||
!define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
|
||||
!define STATUS_FLOAT_MULTIPLE_TRAPS 0xC00002B5
|
||||
!define STATUS_REG_NAT_CONSUMPTION 0xC00002C9
|
||||
!define STATUS_SXS_EARLY_DEACTIVATION 0xC015000F
|
||||
!define STATUS_SXS_INVALID_DEACTIVATION 0xC0150010
|
||||
!endif /*WIN32_NO_STATUS*/
|
||||
|
||||
#define MAXIMUM_WAIT_OBJECTS 64
|
||||
|
||||
!define DELETE 0x00010000
|
||||
!define READ_CONTROL 0x00020000
|
||||
!define WRITE_DAC 0x00040000
|
||||
!define WRITE_OWNER 0x00080000
|
||||
!define SYNCHRONIZE 0x00100000
|
||||
!define STANDARD_RIGHTS_REQUIRED 0x000F0000
|
||||
!define STANDARD_RIGHTS_READ ${READ_CONTROL}
|
||||
!define STANDARD_RIGHTS_WRITE ${READ_CONTROL}
|
||||
!define STANDARD_RIGHTS_EXECUTE ${READ_CONTROL}
|
||||
!define STANDARD_RIGHTS_ALL 0x001F0000
|
||||
!define SPECIFIC_RIGHTS_ALL 0x0000FFFF
|
||||
!define ACCESS_SYSTEM_SECURITY 0x01000000
|
||||
!define MAXIMUM_ALLOWED 0x02000000
|
||||
!define GENERIC_READ 0x80000000
|
||||
!define GENERIC_WRITE 0x40000000
|
||||
!define GENERIC_EXECUTE 0x20000000
|
||||
!define GENERIC_ALL 0x10000000
|
||||
|
||||
!define SE_PRIVILEGE_ENABLED_BY_DEFAULT 0x00000001
|
||||
!define SE_PRIVILEGE_ENABLED 0x00000002
|
||||
!define SE_PRIVILEGE_REMOVED 0x00000004
|
||||
!define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
|
||||
|
||||
!define SE_CREATE_TOKEN_NAME "SeCreateTokenPrivilege"
|
||||
!define SE_ASSIGNPRIMARYTOKEN_NAME "SeAssignPrimaryTokenPrivilege"
|
||||
!define SE_LOCK_MEMORY_NAME "SeLockMemoryPrivilege"
|
||||
!define SE_INCREASE_QUOTA_NAME "SeIncreaseQuotaPrivilege"
|
||||
!define SE_UNSOLICITED_INPUT_NAME "SeUnsolicitedInputPrivilege"
|
||||
!define SE_MACHINE_ACCOUNT_NAME "SeMachineAccountPrivilege"
|
||||
!define SE_TCB_NAME "SeTcbPrivilege"
|
||||
!define SE_SECURITY_NAME "SeSecurityPrivilege"
|
||||
!define SE_TAKE_OWNERSHIP_NAME "SeTakeOwnershipPrivilege"
|
||||
!define SE_LOAD_DRIVER_NAME "SeLoadDriverPrivilege"
|
||||
!define SE_SYSTEM_PROFILE_NAME "SeSystemProfilePrivilege"
|
||||
!define SE_SYSTEMTIME_NAME "SeSystemtimePrivilege"
|
||||
!define SE_PROF_SINGLE_PROCESS_NAME "SeProfileSingleProcessPrivilege"
|
||||
!define SE_INC_BASE_PRIORITY_NAME "SeIncreaseBasePriorityPrivilege"
|
||||
!define SE_CREATE_PAGEFILE_NAME "SeCreatePagefilePrivilege"
|
||||
!define SE_CREATE_PERMANENT_NAME "SeCreatePermanentPrivilege"
|
||||
!define SE_BACKUP_NAME "SeBackupPrivilege"
|
||||
!define SE_RESTORE_NAME "SeRestorePrivilege"
|
||||
!define SE_SHUTDOWN_NAME "SeShutdownPrivilege"
|
||||
!define SE_DEBUG_NAME "SeDebugPrivilege"
|
||||
!define SE_AUDIT_NAME "SeAuditPrivilege"
|
||||
!define SE_SYSTEM_ENVIRONMENT_NAME "SeSystemEnvironmentPrivilege"
|
||||
!define SE_CHANGE_NOTIFY_NAME "SeChangeNotifyPrivilege"
|
||||
!define SE_REMOTE_SHUTDOWN_NAME "SeRemoteShutdownPrivilege"
|
||||
!define SE_UNDOCK_NAME "SeUndockPrivilege"
|
||||
!define SE_SYNC_AGENT_NAME "SeSyncAgentPrivilege"
|
||||
!define SE_ENABLE_DELEGATION_NAME "SeEnableDelegationPrivilege"
|
||||
!define SE_MANAGE_VOLUME_NAME "SeManageVolumePrivilege"
|
||||
!define SE_IMPERSONATE_NAME "SeImpersonatePrivilege"
|
||||
!define SE_CREATE_GLOBAL_NAME "SeCreateGlobalPrivilege"
|
||||
|
||||
!define TOKEN_ASSIGN_PRIMARY 0x0001
|
||||
!define TOKEN_DUPLICATE 0x0002
|
||||
!define TOKEN_IMPERSONATE 0x0004
|
||||
!define TOKEN_QUERY 0x0008
|
||||
!define TOKEN_QUERY_SOURCE 0x0010
|
||||
!define TOKEN_ADJUST_PRIVILEGES 0x0020
|
||||
!define TOKEN_ADJUST_GROUPS 0x0040
|
||||
!define TOKEN_ADJUST_DEFAULT 0x0080
|
||||
!define TOKEN_ADJUST_SESSIONID 0x0100
|
||||
!define TOKEN_ALL_ACCESS_P 0xF00FF
|
||||
!define /math TOKEN_ALL_ACCESS ${TOKEN_ALL_ACCESS_P} | ${TOKEN_ADJUST_SESSIONID}
|
||||
!define /math TOKEN_READ ${STANDARD_RIGHTS_READ} | ${TOKEN_QUERY}
|
||||
!define TOKEN_WRITE 0x200E0 ;(STANDARD_RIGHTS_WRITE|TOKEN_ADJUST_PRIVILEGES|TOKEN_ADJUST_GROUPS|TOKEN_ADJUST_DEFAULT)
|
||||
!define TOKEN_EXECUTE ${STANDARD_RIGHTS_EXECUTE}
|
||||
|
||||
!define PROCESS_TERMINATE 0x0001
|
||||
!define PROCESS_CREATE_THREAD 0x0002
|
||||
!define PROCESS_SET_SESSIONID 0x0004
|
||||
!define PROCESS_VM_OPERATION 0x0008
|
||||
!define PROCESS_VM_READ 0x0010
|
||||
!define PROCESS_VM_WRITE 0x0020
|
||||
!define PROCESS_DUP_HANDLE 0x0040
|
||||
!define PROCESS_CREATE_PROCESS 0x0080
|
||||
!define PROCESS_SET_QUOTA 0x0100
|
||||
!define PROCESS_SET_INFORMATION 0x0200
|
||||
!define PROCESS_QUERY_INFORMATION 0x0400
|
||||
!define PROCESS_SUSPEND_RESUME 0x0800
|
||||
!define PROCESS_ALL_ACCESS 0x1F0FFF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF)
|
||||
!define THREAD_TERMINATE 0x0001
|
||||
!define THREAD_SUSPEND_RESUME 0x0002
|
||||
!define THREAD_GET_CONTEXT 0x0008
|
||||
!define THREAD_SET_CONTEXT 0x0010
|
||||
!define THREAD_SET_INFORMATION 0x0020
|
||||
!define THREAD_QUERY_INFORMATION 0x0040
|
||||
!define THREAD_SET_THREAD_TOKEN 0x0080
|
||||
!define THREAD_IMPERSONATE 0x0100
|
||||
!define THREAD_DIRECT_IMPERSONATION 0x0200
|
||||
!define THREAD_ALL_ACCESS 0x1F03FF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF)
|
||||
!define JOB_OBJECT_ASSIGN_PROCESS 0x0001
|
||||
!define JOB_OBJECT_SET_ATTRIBUTES 0x0002
|
||||
!define JOB_OBJECT_QUERY 0x0004
|
||||
!define JOB_OBJECT_TERMINATE 0x0008
|
||||
!define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 0x0010
|
||||
!define JOB_OBJECT_ALL_ACCESS 0x1F001F ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1F )
|
||||
!define EVENT_MODIFY_STATE 0x0002
|
||||
!define EVENT_ALL_ACCESS 0x1F0003 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
|
||||
!define MUTANT_QUERY_STATE 0x0001
|
||||
!define MUTANT_ALL_ACCESS 0x1F0001 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
|
||||
|
||||
!define FILE_SHARE_READ 0x00000001
|
||||
!define FILE_SHARE_WRITE 0x00000002
|
||||
!define FILE_SHARE_DELETE 0x00000004
|
||||
!define FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
!define FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
!define FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
!define FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
!define FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
!define FILE_ATTRIBUTE_DEVICE 0x00000040
|
||||
!define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
!define FILE_ATTRIBUTE_TEMPORARY 0x00000100
|
||||
!define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
|
||||
!define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
|
||||
!define FILE_ATTRIBUTE_COMPRESSED 0x00000800
|
||||
!define FILE_ATTRIBUTE_OFFLINE 0x00001000
|
||||
!define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
|
||||
!define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
|
||||
|
||||
!define DUPLICATE_CLOSE_SOURCE 0x00000001
|
||||
!define DUPLICATE_SAME_ACCESS 0x00000002
|
||||
|
||||
!define /ifndef VER_PLATFORM_WIN32s 0
|
||||
!define /ifndef VER_PLATFORM_WIN32_WINDOWS 1
|
||||
!define /ifndef VER_PLATFORM_WIN32_NT 2
|
||||
|
||||
!ifndef REG_SZ & NSIS_WINDOWS__NO_REGTYPES
|
||||
!define REG_NONE 0
|
||||
!define REG_SZ 1
|
||||
!define REG_EXPAND_SZ 2
|
||||
!define REG_BINARY 3
|
||||
!define REG_DWORD 4
|
||||
!define REG_DWORD_LITTLE_ENDIAN 4
|
||||
!define REG_DWORD_BIG_ENDIAN 5
|
||||
!define REG_LINK 6
|
||||
!define REG_MULTI_SZ 7
|
||||
!endif
|
||||
|
||||
!define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
|
||||
!define PROCESSOR_ARCHITECTURE_INTEL 0 ; x86
|
||||
!define PROCESSOR_ARCHITECTURE_ARM 5
|
||||
!define PROCESSOR_ARCHITECTURE_IA64 6 ; Itanium
|
||||
!define PROCESSOR_ARCHITECTURE_AMD64 9 ; x86-64/x64
|
||||
!define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10
|
||||
!define PROCESSOR_ARCHITECTURE_ARM64 12
|
||||
!define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13
|
||||
|
||||
!define IMAGE_FILE_MACHINE_UNKNOWN 0
|
||||
!define IMAGE_FILE_MACHINE_I386 332 ; x86
|
||||
!define IMAGE_FILE_MACHINE_ARMNT 452
|
||||
!define IMAGE_FILE_MACHINE_IA64 512 ; Itanium
|
||||
!define IMAGE_FILE_MACHINE_AMD64 34404 ; x86-64/x64
|
||||
!define IMAGE_FILE_MACHINE_ARM64 43620
|
||||
|
||||
!endif /* __WIN_NOINC_WINNT */
|
||||
!verbose pop
|
||||
!endif /* __WIN_WINNT__INC */
|
199
installer/tools/Include/Win/WinUser.nsh
Normal file
199
installer/tools/Include/Win/WinUser.nsh
Normal file
@ -0,0 +1,199 @@
|
||||
!ifndef __WIN_WINUSER__INC
|
||||
!define __WIN_WINUSER__INC
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!ifndef __WIN_MS_NOUSER & __WIN_NOINC_WINUSER
|
||||
|
||||
!ifndef __WIN_MS_NOVIRTUALKEYCODES
|
||||
!define VK_LBUTTON 0x01
|
||||
!define VK_RBUTTON 0x02
|
||||
!define VK_CANCEL 0x03
|
||||
!define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */
|
||||
!define VK_XBUTTON1 0x05 /* NOT contiguous with L & RBUTTON */
|
||||
!define VK_XBUTTON2 0x06 /* NOT contiguous with L & RBUTTON */
|
||||
!define VK_BACK 0x08
|
||||
!define VK_TAB 0x09
|
||||
!define VK_CLEAR 0x0C
|
||||
!define VK_RETURN 0x0D
|
||||
!define VK_SHIFT 0x10
|
||||
!define VK_CONTROL 0x11
|
||||
!define VK_MENU 0x12
|
||||
!define VK_PAUSE 0x13
|
||||
!define VK_CAPITAL 0x14
|
||||
!define VK_ESCAPE 0x1B
|
||||
!define VK_CONVERT 0x1C
|
||||
!define VK_NONCONVERT 0x1D
|
||||
!define VK_ACCEPT 0x1E
|
||||
!define VK_MODECHANGE 0x1F
|
||||
!define VK_SPACE 0x20
|
||||
!define VK_PRIOR 0x21
|
||||
!define VK_NEXT 0x22
|
||||
!define VK_END 0x23
|
||||
!define VK_HOME 0x24
|
||||
!define VK_LEFT 0x25
|
||||
!define VK_UP 0x26
|
||||
!define VK_RIGHT 0x27
|
||||
!define VK_DOWN 0x28
|
||||
!define VK_SELECT 0x29
|
||||
!define VK_PRINT 0x2A
|
||||
!define VK_EXECUTE 0x2B
|
||||
!define VK_SNAPSHOT 0x2C
|
||||
!define VK_INSERT 0x2D
|
||||
!define VK_DELETE 0x2E
|
||||
!define VK_HELP 0x2F
|
||||
; VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
|
||||
; VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
|
||||
!define VK_LWIN 0x5B
|
||||
!define VK_RWIN 0x5C
|
||||
!define VK_APPS 0x5D
|
||||
!define VK_SLEEP 0x5F
|
||||
!define VK_NUMPAD0 0x60
|
||||
!define VK_NUMPAD1 0x61
|
||||
!define VK_NUMPAD2 0x62
|
||||
!define VK_NUMPAD3 0x63
|
||||
!define VK_NUMPAD4 0x64
|
||||
!define VK_NUMPAD5 0x65
|
||||
!define VK_NUMPAD6 0x66
|
||||
!define VK_NUMPAD7 0x67
|
||||
!define VK_NUMPAD8 0x68
|
||||
!define VK_NUMPAD9 0x69
|
||||
!define VK_MULTIPLY 0x6A
|
||||
!define VK_ADD 0x6B
|
||||
!define VK_SEPARATOR 0x6C
|
||||
!define VK_SUBTRACT 0x6D
|
||||
!define VK_DECIMAL 0x6E
|
||||
!define VK_DIVIDE 0x6F
|
||||
!define VK_F1 0x70
|
||||
!define VK_F2 0x71
|
||||
!define VK_F3 0x72
|
||||
!define VK_F4 0x73
|
||||
!define VK_F5 0x74
|
||||
!define VK_F6 0x75
|
||||
!define VK_F7 0x76
|
||||
!define VK_F8 0x77
|
||||
!define VK_F9 0x78
|
||||
!define VK_F10 0x79
|
||||
!define VK_F11 0x7A
|
||||
!define VK_F12 0x7B
|
||||
!define VK_NUMLOCK 0x90
|
||||
!define VK_SCROLL 0x91
|
||||
!define VK_OEM_NEC_EQUAL 0x92 ; '=' key on numpad
|
||||
!define VK_LSHIFT 0xA0
|
||||
!define VK_RSHIFT 0xA1
|
||||
!define VK_LCONTROL 0xA2
|
||||
!define VK_RCONTROL 0xA3
|
||||
!define VK_LMENU 0xA4
|
||||
!define VK_RMENU 0xA5
|
||||
!endif
|
||||
|
||||
!ifndef __WIN_MS_NOWINOFFSETS
|
||||
!define /ifndef GWL_STYLE -16
|
||||
!define /ifndef GWL_EXSTYLE -20
|
||||
!define /ifndef GWLP_WNDPROC -4
|
||||
!define /ifndef GWLP_HINSTANCE -6
|
||||
!define /ifndef GWLP_HWNDPARENT -8
|
||||
!define /ifndef GWLP_USERDATA -21
|
||||
!define /ifndef GWLP_ID -12
|
||||
!define DWLP_MSGRESULT 0
|
||||
!define /math DWLP_DLGPROC ${DWLP_MSGRESULT} + ${NSIS_PTR_SIZE} ;DWLP_MSGRESULT + sizeof(LRESULT)
|
||||
!define /math DWLP_USER ${DWLP_DLGPROC} + ${NSIS_PTR_SIZE} ;DWLP_DLGPROC + sizeof(DLGPROC)
|
||||
!endif
|
||||
|
||||
!ifndef __WIN_MS_NONCMESSAGES
|
||||
!define HTERROR -2
|
||||
!define HTTRANSPARENT -1
|
||||
!define HTNOWHERE 0
|
||||
!define HTCLIENT 1
|
||||
!define HTCAPTION 2
|
||||
!define HTSYSMENU 3
|
||||
!define HTGROWBOX 4
|
||||
!define HTSIZE ${HTGROWBOX}
|
||||
!define HTMENU 5
|
||||
!define HTHSCROLL 6
|
||||
!define HTVSCROLL 7
|
||||
!define HTMINBUTTON 8
|
||||
!define HTMAXBUTTON 9
|
||||
!define HTLEFT 10
|
||||
!define HTRIGHT 11
|
||||
!define HTTOP 12
|
||||
!define HTTOPLEFT 13
|
||||
!define HTTOPRIGHT 14
|
||||
!define HTBOTTOM 15
|
||||
!define HTBOTTOMLEFT 16
|
||||
!define HTBOTTOMRIGHT 17
|
||||
!define HTBORDER 18
|
||||
!define HTREDUCE ${HTMINBUTTON}
|
||||
!define HTZOOM ${HTMAXBUTTON}
|
||||
!define HTSIZEFIRST ${HTLEFT}
|
||||
!define HTSIZELAST ${HTBOTTOMRIGHT}
|
||||
!define HTOBJECT 19
|
||||
!define HTCLOSE 20
|
||||
!define HTHELP 21
|
||||
!endif
|
||||
|
||||
!ifndef __WIN_MS_NOSYSCOMMANDS
|
||||
!define SC_SIZE 0xF000
|
||||
!define SC_MOVE 0xF010
|
||||
!define SC_MINIMIZE 0xF020
|
||||
!define SC_MAXIMIZE 0xF030
|
||||
!define SC_NEXTWINDOW 0xF040
|
||||
!define SC_PREVWINDOW 0xF050
|
||||
!define SC_CLOSE 0xF060
|
||||
!define SC_VSCROLL 0xF070
|
||||
!define SC_HSCROLL 0xF080
|
||||
!define SC_MOUSEMENU 0xF090
|
||||
!define SC_KEYMENU 0xF100
|
||||
!define SC_ARRANGE 0xF110
|
||||
!define SC_RESTORE 0xF120
|
||||
!define SC_TASKLIST 0xF130
|
||||
!define SC_SCREENSAVE 0xF140
|
||||
!define SC_HOTKEY 0xF150
|
||||
!define SC_DEFAULT 0xF160
|
||||
!define SC_MONITORPOWER 0xF170
|
||||
!define SC_CONTEXTHELP 0xF180
|
||||
!define SC_SEPARATOR 0xF00F
|
||||
!endif
|
||||
|
||||
!define /ifndef IDC_ARROW 32512
|
||||
!define /ifndef IDC_IBEAM 32513
|
||||
!define /ifndef IDC_WAIT 32514
|
||||
!define /ifndef IDC_CROSS 32515
|
||||
!define /ifndef IDC_UPARROW 32516
|
||||
!define /ifndef IDC_SIZE 32640
|
||||
!define /ifndef IDC_ICON 32641
|
||||
!define /ifndef IDC_SIZENWSE 32642
|
||||
!define /ifndef IDC_SIZENESW 32643
|
||||
!define /ifndef IDC_SIZEWE 32644
|
||||
!define /ifndef IDC_SIZENS 32645
|
||||
!define /ifndef IDC_SIZEALL 32646
|
||||
!define /ifndef IDC_NO 32648
|
||||
!define /ifndef IDC_HAND 32649
|
||||
!define /ifndef IDC_APPSTARTING 32650
|
||||
!define /ifndef IDC_HELP 32651
|
||||
|
||||
!define /ifndef IMAGE_BITMAP 0
|
||||
!define /ifndef IMAGE_ICON 1
|
||||
!define /ifndef IMAGE_CURSOR 2
|
||||
!define /ifndef IMAGE_ENHMETAFILE 3
|
||||
|
||||
!define /ifndef LR_DEFAULTCOLOR 0x0000
|
||||
!define /ifndef LR_MONOCHROME 0x0001
|
||||
!define /ifndef LR_COLOR 0x0002
|
||||
!define /ifndef LR_COPYRETURNORG 0x0004
|
||||
!define /ifndef LR_COPYDELETEORG 0x0008
|
||||
!define /ifndef LR_LOADFROMFILE 0x0010
|
||||
!define /ifndef LR_LOADTRANSPARENT 0x0020
|
||||
!define /ifndef LR_DEFAULTSIZE 0x0040
|
||||
!define /ifndef LR_VGACOLOR 0x0080
|
||||
!define /ifndef LR_LOADMAP3DCOLORS 0x1000
|
||||
!define /ifndef LR_CREATEDIBSECTION 0x2000
|
||||
!define /ifndef LR_COPYFROMRESOURCE 0x4000
|
||||
!define /ifndef LR_SHARED 0x8000
|
||||
|
||||
!define GA_PARENT 1
|
||||
!define GA_ROOT 2
|
||||
!define GA_ROOTOWNER 3
|
||||
|
||||
!endif /* __WIN_MS_NOUSER & __WIN_NOINC_WINUSER */
|
||||
!verbose pop
|
||||
!endif /* __WIN_WINUSER__INC */
|
Reference in New Issue
Block a user