1
0

system.nsh 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. !ifndef NULLSOFT_NX_SYSTEM_NSIS_HEADER
  2. !define NULLSOFT_NX_SYSTEM_NSIS_HEADER
  3. ; LONG left;
  4. ; LONG top;
  5. ; LONG right;
  6. ; LONG bottom;
  7. ; } RECT, *PRECT;
  8. !ifndef stRECT
  9. !define stRECT '(i, i, i, i) i'
  10. !endif
  11. ;typedef struct tagSIZE
  12. ;{
  13. ; LONG cx;
  14. ; LONG cy;
  15. ;} SIZE, *PSIZE, *LPSIZE;
  16. !ifndef stSIZE
  17. !define stSIZE '(i, i) i'
  18. !endif
  19. ; typedef struct tagBITMAP {
  20. ; LONG bmType;
  21. ; LONG bmWidth;
  22. ; LONG bmHeight;
  23. ; LONG bmWidthBytes;
  24. ; WORD bmPlanes;
  25. ; WORD bmBitsPixel;
  26. ; LPVOID bmBits;
  27. ; } BITMAP, *PBITMAP;
  28. !ifndef stBITMAP
  29. !define stBITMAP '(i, i, i, i, &i2, &i2, i) i'
  30. !endif
  31. ;typedef struct _ICONINFO {
  32. ; BOOL fIcon;
  33. ; DWORD xHotspot;
  34. ; DWORD yHotspot;
  35. ; HBITMAP hbmMask;
  36. ; HBITMAP hbmColor;
  37. ;} ICONINFO, *PICONINFO;
  38. !ifndef stICONINFO
  39. !define stICONINFO '(i, i, i, i, i) i'
  40. !endif
  41. ;typedef struct tagTEXTMETRICW
  42. ;{
  43. ; LONG tmHeight;
  44. ; LONG tmAscent;
  45. ; LONG tmDescent;
  46. ; LONG tmInternalLeading;
  47. ; LONG tmExternalLeading;
  48. ; LONG tmAveCharWidth;
  49. ; LONG tmMaxCharWidth;
  50. ; LONG tmWeight;
  51. ; LONG tmOverhang;
  52. ; LONG tmDigitizedAspectX;
  53. ; LONG tmDigitizedAspectY;
  54. ; WCHAR tmFirstChar;
  55. ; WCHAR tmLastChar;
  56. ; WCHAR tmDefaultChar;
  57. ; WCHAR tmBreakChar;
  58. ; BYTE tmItalic;
  59. ; BYTE tmUnderlined;
  60. ; BYTE tmStruckOut;
  61. ; BYTE tmPitchAndFamily;
  62. ; BYTE tmCharSet;
  63. ;} TEXTMETRICW
  64. !ifndef stTEXTMETRIC
  65. !define stTEXTMETRIC '(i, i, i, i, i, i, i, i, i, i, i, &i2, &i2, &i2, &i2, &i1, &i1, &i1, &i1, &i1) i'
  66. !endif
  67. ;typedef struct tagLOGFONTW
  68. ;{
  69. ; LONG lfHeight;
  70. ; LONG lfWidth;
  71. ; LONG lfEscapement;
  72. ; LONG lfOrientation;
  73. ; LONG lfWeight;
  74. ; BYTE lfItalic;
  75. ; BYTE lfUnderline;
  76. ; BYTE lfStrikeOut;
  77. ; BYTE lfCharSet;
  78. ; BYTE lfOutPrecision;
  79. ; BYTE lfClipPrecision;
  80. ; BYTE lfQuality;
  81. ; BYTE lfPitchAndFamily;
  82. ; WCHAR lfFaceName[LF_FACESIZE];
  83. ;} LOGFONTW
  84. !ifndef stLOGFONT
  85. !define stLOGFONT '(i, i, i, i, i, &i1, &i1, &i1, &i1, &i1, &i1, &i1, &i1, &w32) i'
  86. !endif
  87. ;typedef struct tagNMHDR {
  88. ; HWND hwndFrom;
  89. ; UINT_PTR idFrom;
  90. ; UINT code;
  91. ;} NMHDR;
  92. !ifndef stNMHDR
  93. !define stNMHDR '(i, i, i) i'
  94. !endif
  95. !ifndef NM_FIRST
  96. !define NM_FIRST 0
  97. !endif
  98. !ifndef NM_CLICK
  99. !define /math NM_CLICK ${NM_FIRST} - 2
  100. !endif
  101. !ifndef NM_RETURN
  102. !define /math NM_RETURN ${NM_FIRST} - 4
  103. !endif
  104. ; BOOL GetWindowRect(HWND hWnd,
  105. ; LPRECT lpRect)
  106. !define fnGetWindowRect \
  107. 'User32::GetWindowRect(i, i) i'
  108. ; int MapWindowPoints(HWND hWndFrom,
  109. ; HWND hWndTo,
  110. ; LPPOINT lpPoints,
  111. ; UINT cPoints)
  112. !define fnMapWindowPoints \
  113. 'User32::MapWindowPoints(i, i, i, i) i'
  114. ; SetWindowPos() uFlags
  115. !define SWP_NOSIZE 0x0001
  116. !define SWP_NOMOVE 0x0002
  117. !define SWP_NOZORDER 0x0004
  118. !define SWP_NOREDRAW 0x0008
  119. !define SWP_NOACTIVATE 0x0010
  120. !define SWP_FRAMECHANGED 0x0020
  121. !define SWP_SHOWWINDOW 0x0040
  122. !define SWP_HIDEWINDOW 0x0080
  123. !define SWP_NOCOPYBITS 0x0100
  124. !define SWP_NOOWNERZORDER 0x0200
  125. !define SWP_NOSENDCHANGING 0x0400
  126. !define SWP_DRAWFRAME ${SWP_FRAMECHANGED}
  127. !define SWP_NOREPOSITION ${SWP_NOOWNERZORDER}
  128. !define SWP_DEFERERASE 0x2000
  129. !define SWP_ASYNCWINDOWPOS 0x4000
  130. ; BOOL SetWindowPos(HWND hWnd,
  131. ; HWND hWndInsertAfter,
  132. ; int X,
  133. ; int Y,
  134. ; int cx,
  135. ; int cy,
  136. ; UINT uFlags)
  137. !define fnSetWindowPos \
  138. 'User32::SetWindowPos(i, i, i, i, i, i, i) i'
  139. ; GetAncestor() gaFlags
  140. !define GA_PARENT 1
  141. ; HWND GetAncestor(HWND hwnd,
  142. ; UINT gaFlags)
  143. !define fnGetAncestor \
  144. 'User32::GetAncestor(i, i) i'
  145. ; BOOL MapDialogRect(HWND hDlg,
  146. ; LPRECT lpRect)
  147. !define fnMapDialogRect \
  148. 'User32::MapDialogRect(i, i) i'
  149. ; GetDCEx() flags
  150. !define DCX_WINDOW 0x00000001
  151. !define DCX_CACHE 0x00000002
  152. !define DCX_NORESETATTRS 0x00000004
  153. ; HDC GetDCEx(HWND hWnd,
  154. ; HRGN hrgnClip,
  155. ; DWORD flags)
  156. !define fnGetDCEx \
  157. 'User32::GetDCEx(i, i, i ) i'
  158. ; DrawText uFormat
  159. !define DT_CALCRECT 0x00000400
  160. !define DT_LEFT 0x00000000
  161. !define DT_TOP 0x00000000
  162. !define DT_EDITCONTROL 0x00002000
  163. !define DT_NOPREFIX 0x00000800
  164. !define DT_SINGLELINE 0x00000020
  165. !define DT_WORDBREAK 0x00000010
  166. ; int DrawText(HDC hDC,
  167. ; LPCTSTR lpchText,
  168. ; int nCount,
  169. ; LPRECT lpRect,
  170. ; UINT uFormat)
  171. !define fnDrawText \
  172. 'User32::DrawText(i, t, i, i, i) i'
  173. ; int ReleaseDC(HWND hWnd,
  174. ; HDC hDC)
  175. !define fnReleaseDC \
  176. 'User32::ReleaseDC(i, i) i'
  177. ; GetWindowLong()/SetWindowLong() nIndex
  178. !define GWL_WNDPROC -4
  179. !define GWL_HINSTANCE -6
  180. !define GWL_HWNDPARENT -8
  181. !ifndef GWL_STYLE ; defined in nsDialogs
  182. !define GWL_STYLE -16
  183. !endif
  184. !ifndef GWL_EXSTYLE ; defined in nsDialogs
  185. !define GWL_EXSTYLE -16
  186. !endif
  187. !define GWL_USERDATA -21
  188. !define GWL_ID -12
  189. ; LONG GetWindowLong(HWND hWnd,
  190. ; int nIndex)
  191. !define fnGetWindowLong \
  192. 'User32::GetWindowLong(i, i) i'
  193. ; LONG SetWindowLong(HWND hWnd,
  194. ; int nIndex
  195. ; LONG dwNewLong)
  196. !define fnSetWindowLong \
  197. 'User32::SetWindowLong(i, i, i) i'
  198. ; int GetWindowText(HWND hWnd,
  199. ; LPTSTR lpString,
  200. ; int nMaxCount)
  201. !define fnGetWindowText \
  202. 'User32::GetWindowText(i, t, i) i'
  203. ; BOOL SetWindowText(HWND hWnd,
  204. ; LPCTSTR lpString)
  205. !define fnSetWindowText \
  206. 'User32::SetWindowText(i, t) i'
  207. ;HGDIOBJ SelectObject(HDC hdc,
  208. ; HGDIOBJ hgdiobj)
  209. !define fnSelectObject \
  210. 'GDI32::SelectObject(i, i) i'
  211. ;BOOL GetTextMetrics(HDC hdc,
  212. ; LPTEXTMETRIC lptm)
  213. !define fnGetTextMetrics \
  214. 'GDI32::GetTextMetricsW(i, i) i'
  215. ; GetSystemMetrics()
  216. !define SM_CXSCREEN 0
  217. !define SM_CYSCREEN 1
  218. !define SM_CXVSCROLL 2
  219. !define SM_CYHSCROLL 3
  220. !define SM_CYCAPTION 4
  221. !define SM_CXBORDER 5
  222. !define SM_CYBORDER 6
  223. !define SM_CXDLGFRAME 7
  224. !define SM_CYDLGFRAME 8
  225. !define SM_CYVTHUMB 9
  226. !define SM_CXHTHUMB 10
  227. !define SM_CXICON 11
  228. !define SM_CYICON 12
  229. !define SM_CXCURSOR 13
  230. !define SM_CYCURSOR 14
  231. !define SM_CYMENU 15
  232. !define SM_CXFULLSCREEN 16
  233. !define SM_CYFULLSCREEN 17
  234. !define SM_CYKANJIWINDOW 18
  235. !define SM_MOUSEPRESENT 19
  236. !define SM_CYVSCROLL 20
  237. !define SM_CXHSCROLL 21
  238. !define SM_DEBUG 22
  239. !define SM_SWAPBUTTON 23
  240. !define SM_RESERVED1 24
  241. !define SM_RESERVED2 25
  242. !define SM_RESERVED3 26
  243. !define SM_RESERVED4 27
  244. !define SM_CXMIN 28
  245. !define SM_CYMIN 29
  246. !define SM_CXSIZE 30
  247. !define SM_CYSIZE 31
  248. !define SM_CXFRAME 32
  249. !define SM_CYFRAME 33
  250. !define SM_CXMINTRACK 34
  251. !define SM_CYMINTRACK 35
  252. !define SM_CXDOUBLECLK 36
  253. !define SM_CYDOUBLECLK 37
  254. !define SM_CXICONSPACING 38
  255. !define SM_CYICONSPACING 39
  256. !define SM_MENUDROPALIGNMENT 40
  257. !define SM_PENWINDOWS 41
  258. !define SM_DBCSENABLED 42
  259. !define SM_CMOUSEBUTTONS 43
  260. !define SM_CXFIXEDFRAME ${SM_CXDLGFRAME}
  261. !define SM_CYFIXEDFRAME ${SM_CYDLGFRAME}
  262. !define SM_CXSIZEFRAME ${SM_CXFRAME}
  263. !define SM_CYSIZEFRAME ${SM_CYFRAME}
  264. !define SM_SECURE 44
  265. !define SM_CXEDGE 45
  266. !define SM_CYEDGE 46
  267. !define SM_CXMINSPACING 47
  268. !define SM_CYMINSPACING 48
  269. !define SM_CXSMICON 49
  270. !define SM_CYSMICON 50
  271. !define SM_CYSMCAPTION 51
  272. !define SM_CXSMSIZE 52
  273. !define SM_CYSMSIZE 53
  274. !define SM_CXMENUSIZE 54
  275. !define SM_CYMENUSIZE 55
  276. !define SM_ARRANGE 56
  277. !define SM_CXMINIMIZED 57
  278. !define SM_CYMINIMIZED 58
  279. !define SM_CXMAXTRACK 59
  280. !define SM_CYMAXTRACK 60
  281. !define SM_CXMAXIMIZED 61
  282. !define SM_CYMAXIMIZED 62
  283. !define SM_NETWORK 63
  284. !define SM_CLEANBOOT 67
  285. !define SM_CXDRAG 68
  286. !define SM_CYDRAG 69
  287. !define SM_SHOWSOUNDS 70
  288. !define SM_CXMENUCHECK 71
  289. !define SM_CYMENUCHECK 72
  290. !define SM_SLOWMACHINE 73
  291. !define SM_MIDEASTENABLED 74
  292. !define SM_MOUSEWHEELPRESENT 75
  293. !define SM_XVIRTUALSCREEN 76
  294. !define SM_YVIRTUALSCREEN 77
  295. !define SM_CXVIRTUALSCREEN 78
  296. !define SM_CYVIRTUALSCREEN 79
  297. !define SM_CMONITORS 80
  298. !define SM_SAMEDISPLAYFORMAT 81
  299. !define SM_IMMENABLED 82
  300. !define SM_CXFOCUSBORDER 83
  301. ;!define SM_TABLETPC 86
  302. ;!define SM_MEDIACENTER 87
  303. ;!define SM_STARTER 88
  304. ;!define SM_SERVERR2 89
  305. !define SM_MOUSEHORIZONTALWHEELPRESENT 91
  306. !define SM_CXPADDEDBORDER 92
  307. !define SM_DIGITIZER 94
  308. !define SM_MAXIMUMTOUCHES 95
  309. !define SM_REMOTESESSION 0x1000
  310. !define SM_SHUTTINGDOWN 0x2000
  311. !define SM_REMOTECONTROL 0x2001
  312. !define SM_CARETBLINKINGENABLED 0x2002
  313. !define SM_CONVERTIBLESLATEMODE 0x2003
  314. !define SM_SYSTEMDOCKED 0x2004
  315. ;int GetSystemMetrics(int nIndex)
  316. !define fnGetSystemMetrics \
  317. 'User32::GetSystemMetrics(i) i'
  318. ; Image types
  319. !ifndef IMAGE_BITMAP
  320. !define IMAGE_BITMAP 0
  321. !endif
  322. !ifndef IMAGE_ICON
  323. !define IMAGE_ICON 1
  324. !endif
  325. !ifndef IMAGE_CURSOR
  326. !define IMAGE_CURSOR 2
  327. !endif
  328. !ifndef IMAGE_ENHMETAFILE
  329. !define IMAGE_ENHMETAFILE 3
  330. !endif
  331. ; Load Image Flags
  332. !ifndef LR_DEFAULTCOLOR
  333. !define LR_DEFAULTCOLOR 0x00000000
  334. !define LR_MONOCHROME 0x00000001
  335. !define LR_COLOR 0x00000002
  336. !define LR_COPYRETURNORG 0x00000004
  337. !define LR_COPYDELETEORG 0x00000008
  338. !define LR_LOADFROMFILE 0x00000010
  339. !define LR_LOADTRANSPARENT 0x00000020
  340. !define LR_DEFAULTSIZE 0x00000040
  341. !define LR_VGACOLOR 0x00000080
  342. !define LR_LOADMAP3DCOLORS 0x00001000
  343. !define LR_CREATEDIBSECTION 0x00002000
  344. !define LR_COPYFROMRESOURCE 0x00004000
  345. !define LR_SHARED 0x00008000
  346. !endif ; defined (LR_DEFAULTCOLOR)
  347. ; HANDLE LoadImage(HINSTANCE hinst,
  348. ; LPCTSTR lpszName,
  349. ; UINT uType,
  350. ; int cxDesired,
  351. ; int cyDesired,
  352. ; UINT fuLoad)
  353. !define fnLoadImage \
  354. 'User32::LoadImage(i, t, i, i, i, i) i'
  355. ;BOOL DeleteObject(HGDIOBJ hObject);
  356. !define fnDeleteObject \
  357. 'GDI32::DeleteObject(i) i'
  358. ;int GetObject(HGDIOBJ hgdiobj,
  359. ; int cbBuffer,
  360. ; LPVOID lpvObject);
  361. !define fnGetObject \
  362. 'GDI32::GetObject(i, i, i) i'
  363. ;BOOL GetIconInfo(HICON hIcon,
  364. ; PICONINFO piconinfo)
  365. !define fnGetIconInfo \
  366. 'User32::GetIconInfo(i, i) i'
  367. ;BOOL DestroyIcon(HICON hIcon)
  368. !define fnDestroyIcon \
  369. 'User32::DestroyIcon(i) i'
  370. ;BOOL DestroyWindow(HWND hWnd)
  371. !define fnDestroyWindow \
  372. 'User32::DestroyWindow(i) i'
  373. ;HWND WINAPI CreateWindowEx(DWORD dwExStyle,
  374. ; LPCTSTR lpClassName,
  375. ; LPCTSTR lpWindowName,
  376. ; DWORD dwStyle,
  377. ; int x,
  378. ; int y,
  379. ; int nWidth,
  380. ; int nHeight,
  381. ; HWND hWndParent,
  382. ; HMENU hMenu,
  383. ; HINSTANCE hInstance,
  384. ; LPVOID lpParam)
  385. !define fnCreateWindowEx \
  386. 'User32::CreateWindowEx(i, t, t, i, i, i, i, i, i, i, i, i) i'
  387. !endif ; defined(NULLSOFT_NX_SYSTEM_NSIS_HEADER)