WinCore.nsh 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /*
  2. WinCore.nsh & Win\*.nsh - Collection of common windows defines
  3. !define __WIN_NOINC_xxx to exclude a windows header file
  4. !define __WIN_MS_xxx to exclude specific things (The original #ifdef xxx checks can be found in the official Microsoft headers)
  5. */
  6. !ifndef __WIN_WINDOWS__INC
  7. !define __WIN_WINDOWS__INC
  8. !verbose push
  9. !verbose 3
  10. !include Win\WinDef.nsh
  11. !include Win\WinError.nsh
  12. !include Win\WinNT.nsh
  13. !include Win\WinUser.nsh
  14. !ifndef __WIN_MS_NOWINMESSAGES
  15. !include WinMessages.nsh
  16. !endif
  17. /**************************************************
  18. WinBase.h
  19. **************************************************/
  20. !ifndef __WIN_NOINC_WINBASE
  21. !define /ifndef INVALID_HANDLE_VALUE -1
  22. !define /ifndef INVALID_FILE_SIZE 0xFFFFFFFF
  23. !define /ifndef INVALID_SET_FILE_POINTER -1
  24. !define /ifndef INVALID_FILE_ATTRIBUTES -1
  25. !define WAIT_FAILED 0xFFFFFFFF
  26. !define WAIT_OBJECT_0 0 ;((STATUS_WAIT_0 ) + 0 )
  27. !define WAIT_ABANDONED 0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )
  28. !define WAIT_ABANDONED_0 0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )
  29. !define DRIVE_UNKNOWN 0
  30. !define DRIVE_NO_ROOT_DIR 1
  31. !define DRIVE_REMOVABLE 2
  32. !define DRIVE_FIXED 3
  33. !define DRIVE_REMOTE 4
  34. !define DRIVE_CDROM 5
  35. !define DRIVE_RAMDISK 6
  36. !define FILE_TYPE_UNKNOWN 0x0000
  37. !define FILE_TYPE_DISK 0x0001
  38. !define FILE_TYPE_CHAR 0x0002
  39. !define FILE_TYPE_PIPE 0x0003
  40. !define FILE_TYPE_REMOTE 0x8000
  41. !define STD_INPUT_HANDLE -10
  42. !define STD_OUTPUT_HANDLE -11
  43. !define STD_ERROR_HANDLE -12
  44. #define IGNORE 0 ; Ignore signal
  45. !define INFINITE 0xFFFFFFFF ; Infinite timeout
  46. !endif /* __WIN_NOINC_WINBASE */
  47. /**************************************************
  48. WinGDI.h
  49. **************************************************/
  50. !ifndef __WIN_MS_NOGDI & __WIN_NOINC_WINGDI
  51. !define HORZRES 8
  52. !define VERTRES 10
  53. !define BITSPIXEL 12
  54. !define LOGPIXELSX 88
  55. !define LOGPIXELSY 90
  56. !define COLORRES 108
  57. !define VREFRESH 116
  58. !define DESKTOPVERTRES 117
  59. !define DESKTOPHORZRES 118
  60. !endif /* __WIN_MS_NOGDI & __WIN_NOINC_WINGDI */
  61. /**************************************************
  62. WinReg.h
  63. **************************************************/
  64. !ifndef __WIN_NOINC_WINREG
  65. !ifndef __WIN_NOHKEY & HKEY_CLASSES_ROOT & HKEY_CURRENT_USER & HKEY_LOCAL_MACHINE & HKEY_USERS
  66. !define HKEY_CLASSES_ROOT 0x80000000
  67. !define HKEY_CURRENT_USER 0x80000001
  68. !define HKEY_LOCAL_MACHINE 0x80000002
  69. !define HKEY_USERS 0x80000003
  70. !define HKEY_PERFORMANCE_DATA 0x80000004
  71. !define HKEY_PERFORMANCE_TEXT 0x80000050
  72. !define HKEY_PERFORMANCE_NLSTEXT 0x80000060
  73. !define HKEY_CURRENT_CONFIG 0x80000005
  74. !define HKEY_DYN_DATA 0x80000006
  75. !ifndef __WIN_NOSHORTHKEY & HKCR & HKCU & HKLM
  76. !define HKCR ${HKEY_CLASSES_ROOT}
  77. !define HKCU ${HKEY_CURRENT_USER}
  78. !define HKLM ${HKEY_LOCAL_MACHINE}
  79. !endif
  80. !endif
  81. !endif /* __WIN_NOINC_WINREG */
  82. /**************************************************
  83. WindowsX.h
  84. **************************************************/
  85. !ifndef __WIN_NOINC_WINDOWSX
  86. !ifndef GET_X_LPARAM & GET_Y_LPARAM
  87. !macro _Win_GET_X_LPARAM _outvar _in
  88. IntOp ${_outvar} "${_in}" << 16 ;We can't just use LOWORD, we need to keep the sign,
  89. IntOp ${_outvar} ${_outvar} >> 16 ;so we let NSIS sign extend for us
  90. !macroend
  91. !define GET_X_LPARAM "!insertmacro _Win_GET_X_LPARAM "
  92. !macro _Win_GET_Y_LPARAM _outvar _in
  93. IntOp ${_outvar} "${_in}" >> 16
  94. !macroend
  95. !define GET_Y_LPARAM "!insertmacro _Win_GET_Y_LPARAM "
  96. !endif
  97. !endif /* __WIN_NOINC_WINDOWSX */
  98. /**************************************************
  99. ShlObj.h
  100. **************************************************/
  101. !ifndef __WIN_NOINC_SHLOBJ
  102. !ifndef __WIN_NOSHELLFOLDERCSIDL
  103. !define CSIDL_DESKTOP 0x0000
  104. !define CSIDL_INTERNET 0x0001 ;Internet Explorer (icon on desktop)
  105. !define CSIDL_PROGRAMS 0x0002 ;Start Menu\Programs
  106. !define CSIDL_CONTROLS 0x0003 ;My Computer\Control Panel
  107. !define CSIDL_PRINTERS 0x0004 ;My Computer\Printers
  108. !define CSIDL_PERSONAL 0x0005 ;My Documents
  109. !define CSIDL_FAVORITES 0x0006 ;<user name>\Favorites
  110. !define CSIDL_STARTUP 0x0007 ;Start Menu\Programs\Startup
  111. !define CSIDL_RECENT 0x0008 ;<user name>\Recent
  112. !define CSIDL_SENDTO 0x0009 ;<user name>\SendTo
  113. !define CSIDL_BITBUCKET 0x000a ;<desktop>\Recycle Bin
  114. !define CSIDL_STARTMENU 0x000b ;<user name>\Start Menu
  115. !define CSIDL_MYDOCUMENTS 0x000c ;logical "My Documents" desktop icon
  116. !define CSIDL_MYMUSIC 0x000d ;"My Music" folder
  117. !define CSIDL_MYVIDEO 0x000e ;"My Videos" folder
  118. !define CSIDL_DESKTOPDIRECTORY 0x0010 ;<user name>\Desktop
  119. !define CSIDL_DRIVES 0x0011 ;My Computer
  120. !define CSIDL_NETWORK 0x0012 ;Network Neighborhood
  121. !define CSIDL_NETHOOD 0x0013 ;<user name>\nethood
  122. !define CSIDL_FONTS 0x0014 ;windows\fonts
  123. !define CSIDL_TEMPLATES 0x0015
  124. !define CSIDL_COMMON_STARTMENU 0x0016 ;All Users\Start Menu
  125. !define CSIDL_COMMON_PROGRAMS 0x0017 ;All Users\Start Menu\Programs
  126. !define CSIDL_COMMON_STARTUP 0x0018 ;All Users\Startup
  127. !define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 ;All Users\Desktop
  128. !define CSIDL_APPDATA 0x001a ;<user name>\Application Data
  129. !define CSIDL_PRINTHOOD 0x001b ;<user name>\PrintHood
  130. !define CSIDL_LOCAL_APPDATA 0x001c ;<user name>\Local Settings\Applicaiton Data (non roaming)
  131. !define CSIDL_ALTSTARTUP 0x001d ;non localized startup
  132. !define CSIDL_COMMON_ALTSTARTUP 0x001e ;non localized common startup
  133. !define CSIDL_COMMON_FAVORITES 0x001f
  134. !define CSIDL_INTERNET_CACHE 0x0020
  135. !define CSIDL_COOKIES 0x0021
  136. !define CSIDL_HISTORY 0x0022
  137. !define CSIDL_COMMON_APPDATA 0x0023 ;All Users\Application Data
  138. !define CSIDL_WINDOWS 0x0024 ;GetWindowsDirectory
  139. !define CSIDL_SYSTEM 0x0025 ;GetSystemDirectory
  140. !define CSIDL_PROGRAM_FILES 0x0026 ;C:\Program Files
  141. !define CSIDL_MYPICTURES 0x0027
  142. !define CSIDL_PROFILE 0x0028 ;USERPROFILE
  143. !define CSIDL_SYSTEMX86 0x0029 ;x86 system directory on RISC
  144. !define CSIDL_PROGRAM_FILESX86 0x002a ;x86 C:\Program Files on RISC
  145. !define CSIDL_PROGRAM_FILES_COMMON 0x002b ;C:\Program Files\Common
  146. !define CSIDL_PROGRAM_FILES_COMMONX86 0x002c ;x86 Program Files\Common on RISC
  147. !define CSIDL_COMMON_TEMPLATES 0x002d ;All Users\Templates
  148. !define CSIDL_COMMON_DOCUMENTS 0x002e ;All Users\Documents
  149. !define CSIDL_COMMON_ADMINTOOLS 0x002f ;All Users\Start Menu\Programs\Administrative Tools
  150. !define CSIDL_ADMINTOOLS 0x0030 ;<user name>\Start Menu\Programs\Administrative Tools
  151. !define CSIDL_CONNECTIONS 0x0031 ;Network and Dial-up Connections
  152. !define CSIDL_COMMON_MUSIC 0x0035 ;All Users\My Music
  153. !define CSIDL_COMMON_PICTURES 0x0036 ;All Users\My Pictures
  154. !define CSIDL_COMMON_VIDEO 0x0037 ;All Users\My Video
  155. !define CSIDL_RESOURCES 0x0038 ;Resource Direcotry
  156. !define CSIDL_RESOURCES_LOCALIZED 0x0039 ;Localized Resource Direcotry
  157. !define CSIDL_COMMON_OEM_LINKS 0x003a ;Links to All Users OEM specific apps
  158. !define CSIDL_CDBURN_AREA 0x003b ;USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
  159. !define CSIDL_COMPUTERSNEARME 0x003d ;Computers Near Me (computered from Workgroup membership)
  160. !define CSIDL_FLAG_CREATE 0x8000 ;combine with CSIDL_ value to force folder creation in SHGetFolderPath()
  161. !define CSIDL_FLAG_DONT_VERIFY 0x4000 ;combine with CSIDL_ value to return an unverified folder path
  162. !define CSIDL_FLAG_NO_ALIAS 0x1000 ;combine with CSIDL_ value to insure non-alias versions of the pidl
  163. !define CSIDL_FLAG_PER_USER_INIT 0x0800 ;combine with CSIDL_ value to indicate per-user init (eg. upgrade)
  164. !define CSIDL_FLAG_MASK 0xFF00
  165. !endif /* __WIN_NOSHELLFOLDERCSIDL */
  166. !endif /* __WIN_NOINC_SHLOBJ */
  167. /**************************************************
  168. Shobjidl.h
  169. **************************************************/
  170. !ifndef __WIN_NOINC_SHOBJIDL
  171. ; ASSOCIATIONLEVEL
  172. !define AL_MACHINE 0
  173. !define AL_EFFECTIVE 1
  174. !define AL_USER 2
  175. ; ASSOCIATIONTYPE
  176. !define AT_FILEEXTENSION 0
  177. !define AT_URLPROTOCOL 1
  178. !define AT_STARTMENUCLIENT 2
  179. !define AT_MIMETYPE 3
  180. !endif /* __WIN_NOINC_SHOBJIDL */
  181. !verbose pop
  182. !endif /* __WIN_WINDOWS__INC */