aboutsummaryrefslogtreecommitdiff
path: root/Src/installer/shared/scripts/system.nsh
blob: 763e6419b14ea4c8ef63d8b02306f211928ec8ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
!ifndef NULLSOFT_NX_SYSTEM_NSIS_HEADER
!define NULLSOFT_NX_SYSTEM_NSIS_HEADER

;   LONG left; 
;   LONG top; 
;   LONG right; 
;   LONG bottom; 
; } RECT, *PRECT; 
!ifndef stRECT
!define stRECT '(i, i, i, i) i'
!endif

;typedef struct tagSIZE
;{
;    LONG        cx;
;    LONG        cy;
;} SIZE, *PSIZE, *LPSIZE;
!ifndef stSIZE
!define stSIZE '(i, i) i'
!endif

; typedef struct tagBITMAP {
;   LONG   bmType; 
;   LONG   bmWidth; 
;   LONG   bmHeight; 
;   LONG   bmWidthBytes; 
;   WORD   bmPlanes; 
;   WORD   bmBitsPixel; 
;   LPVOID bmBits; 
; } BITMAP, *PBITMAP; 
!ifndef stBITMAP
!define stBITMAP '(i, i, i, i, &i2, &i2, i) i'
!endif

;typedef struct _ICONINFO {
;  BOOL    fIcon;
;  DWORD   xHotspot;
;  DWORD   yHotspot;
;  HBITMAP hbmMask;
;  HBITMAP hbmColor;
;} ICONINFO, *PICONINFO;
!ifndef stICONINFO
!define stICONINFO '(i, i, i, i, i) i'
!endif

;typedef struct tagTEXTMETRICW
;{
;    LONG        tmHeight;
;    LONG        tmAscent;
;    LONG        tmDescent;
;    LONG        tmInternalLeading;
;    LONG        tmExternalLeading;
;    LONG        tmAveCharWidth;
;    LONG        tmMaxCharWidth;
;    LONG        tmWeight;
;    LONG        tmOverhang;
;    LONG        tmDigitizedAspectX;
;    LONG        tmDigitizedAspectY;
;    WCHAR       tmFirstChar;
;    WCHAR       tmLastChar;
;    WCHAR       tmDefaultChar;
;    WCHAR       tmBreakChar;
;    BYTE        tmItalic;
;   BYTE        tmUnderlined;
;    BYTE        tmStruckOut;
;    BYTE        tmPitchAndFamily;
;    BYTE        tmCharSet;
;} TEXTMETRICW
!ifndef stTEXTMETRIC
!define stTEXTMETRIC '(i, i, i, i, i, i, i, i, i, i, i, &i2, &i2, &i2, &i2, &i1, &i1, &i1, &i1, &i1) i'
!endif

;typedef struct tagLOGFONTW
;{
;    LONG      lfHeight;
;    LONG      lfWidth;
;    LONG      lfEscapement;
;    LONG      lfOrientation;
;    LONG      lfWeight;
;    BYTE      lfItalic;
;    BYTE      lfUnderline;
;    BYTE      lfStrikeOut;
;    BYTE      lfCharSet;
;    BYTE      lfOutPrecision;
;    BYTE      lfClipPrecision;
;    BYTE      lfQuality;
;    BYTE      lfPitchAndFamily;
;    WCHAR     lfFaceName[LF_FACESIZE];
;} LOGFONTW
!ifndef stLOGFONT
!define stLOGFONT '(i, i, i, i, i, &i1, &i1, &i1, &i1, &i1, &i1, &i1, &i1, &w32) i'
!endif

;typedef struct tagNMHDR {
;  HWND     hwndFrom;
;  UINT_PTR idFrom;
;  UINT     code;
;} NMHDR;
!ifndef stNMHDR
!define stNMHDR '(i, i, i) i'
!endif

!ifndef NM_FIRST
!define NM_FIRST			0
!endif

!ifndef NM_CLICK
!define /math NM_CLICK		${NM_FIRST} - 2
!endif

!ifndef NM_RETURN
!define /math NM_RETURN		${NM_FIRST} - 4
!endif

; BOOL GetWindowRect(HWND hWnd, 
;					 LPRECT lpRect)
!define fnGetWindowRect \
		'User32::GetWindowRect(i, i) i'

; int MapWindowPoints(HWND hWndFrom, 
;					  HWND hWndTo, 
;					  LPPOINT lpPoints, 
;					  UINT cPoints)
!define fnMapWindowPoints \
		'User32::MapWindowPoints(i, i, i, i) i'

		
; SetWindowPos() uFlags
!define SWP_NOSIZE          0x0001
!define SWP_NOMOVE          0x0002
!define SWP_NOZORDER        0x0004
!define SWP_NOREDRAW        0x0008
!define SWP_NOACTIVATE      0x0010
!define SWP_FRAMECHANGED    0x0020  
!define SWP_SHOWWINDOW      0x0040
!define SWP_HIDEWINDOW      0x0080
!define SWP_NOCOPYBITS      0x0100
!define SWP_NOOWNERZORDER   0x0200  
!define SWP_NOSENDCHANGING  0x0400  
!define SWP_DRAWFRAME       ${SWP_FRAMECHANGED}
!define SWP_NOREPOSITION    ${SWP_NOOWNERZORDER}
!define SWP_DEFERERASE      0x2000
!define SWP_ASYNCWINDOWPOS  0x4000 

; BOOL SetWindowPos(HWND hWnd, 
;					HWND hWndInsertAfter, 
;					int X, 
;					int Y, 
;					int cx, 
;					int cy, 
;					UINT uFlags)
!define fnSetWindowPos \
		'User32::SetWindowPos(i, i, i, i, i, i, i) i'
		
		
; GetAncestor() gaFlags
!define GA_PARENT 1
		
; HWND GetAncestor(HWND hwnd,
;				   UINT gaFlags)
!define fnGetAncestor \
		'User32::GetAncestor(i, i) i'

; BOOL MapDialogRect(HWND hDlg,
;					 LPRECT lpRect)
!define fnMapDialogRect \
		'User32::MapDialogRect(i, i) i'

; GetDCEx() flags		
!define DCX_WINDOW			0x00000001
!define DCX_CACHE			0x00000002
!define DCX_NORESETATTRS	0x00000004

; HDC GetDCEx(HWND hWnd,
;			  HRGN hrgnClip,
;  			  DWORD flags)
!define fnGetDCEx \
		'User32::GetDCEx(i, i, i ) i'

; DrawText uFormat		
!define DT_CALCRECT			0x00000400
!define DT_LEFT				0x00000000
!define DT_TOP				0x00000000
!define DT_EDITCONTROL		0x00002000
!define DT_NOPREFIX			0x00000800
!define DT_SINGLELINE		0x00000020
!define DT_WORDBREAK		0x00000010
	
; int DrawText(HDC hDC,
;			   LPCTSTR lpchText,
;			   int nCount,
;			   LPRECT lpRect,
;  			   UINT uFormat)
!define fnDrawText \
		'User32::DrawText(i, t, i, i, i) i'

; int ReleaseDC(HWND hWnd,
;				HDC hDC)
!define fnReleaseDC \
		'User32::ReleaseDC(i, i) i'

; GetWindowLong()/SetWindowLong() nIndex
!define GWL_WNDPROC         -4
!define GWL_HINSTANCE       -6
!define GWL_HWNDPARENT      -8
!ifndef GWL_STYLE ; defined in nsDialogs
!define GWL_STYLE           -16  
!endif
!ifndef GWL_EXSTYLE ; defined in nsDialogs
!define GWL_EXSTYLE           -16  
!endif
!define GWL_USERDATA        -21
!define GWL_ID              -12

; LONG GetWindowLong(HWND hWnd,
;  					 int nIndex)
!define fnGetWindowLong \		
		'User32::GetWindowLong(i, i) i'

; LONG SetWindowLong(HWND hWnd,
;  					 int nIndex
;					 LONG dwNewLong)
!define fnSetWindowLong \		
		'User32::SetWindowLong(i, i, i) i'

; int GetWindowText(HWND hWnd,
;					LPTSTR lpString,
;					int nMaxCount)	
!define fnGetWindowText \		
		'User32::GetWindowText(i, t, i) i'
		
; BOOL SetWindowText(HWND hWnd,
;					 LPCTSTR lpString)
!define fnSetWindowText \		
		'User32::SetWindowText(i, t) i'

;HGDIOBJ SelectObject(HDC hdc,
;					  HGDIOBJ hgdiobj)
!define fnSelectObject \
		'GDI32::SelectObject(i, i) i'

;BOOL GetTextMetrics(HDC hdc,
;					 LPTEXTMETRIC lptm)
!define fnGetTextMetrics \
		'GDI32::GetTextMetricsW(i, i) i'

; GetSystemMetrics()
!define SM_CXSCREEN             0
!define SM_CYSCREEN             1
!define SM_CXVSCROLL            2
!define SM_CYHSCROLL            3
!define SM_CYCAPTION            4
!define SM_CXBORDER             5
!define SM_CYBORDER             6
!define SM_CXDLGFRAME           7
!define SM_CYDLGFRAME           8
!define SM_CYVTHUMB             9
!define SM_CXHTHUMB             10
!define SM_CXICON               11
!define SM_CYICON               12
!define SM_CXCURSOR             13
!define SM_CYCURSOR             14
!define SM_CYMENU               15
!define SM_CXFULLSCREEN         16
!define SM_CYFULLSCREEN         17
!define SM_CYKANJIWINDOW        18
!define SM_MOUSEPRESENT         19
!define SM_CYVSCROLL            20
!define SM_CXHSCROLL            21
!define SM_DEBUG                22
!define SM_SWAPBUTTON           23
!define SM_RESERVED1            24
!define SM_RESERVED2            25
!define SM_RESERVED3            26
!define SM_RESERVED4            27
!define SM_CXMIN                28
!define SM_CYMIN                29
!define SM_CXSIZE               30
!define SM_CYSIZE               31
!define SM_CXFRAME              32
!define SM_CYFRAME              33
!define SM_CXMINTRACK           34
!define SM_CYMINTRACK           35
!define SM_CXDOUBLECLK          36
!define SM_CYDOUBLECLK          37
!define SM_CXICONSPACING        38
!define SM_CYICONSPACING        39
!define SM_MENUDROPALIGNMENT    40
!define SM_PENWINDOWS           41
!define SM_DBCSENABLED          42
!define SM_CMOUSEBUTTONS        43
!define SM_CXFIXEDFRAME         ${SM_CXDLGFRAME} 
!define SM_CYFIXEDFRAME         ${SM_CYDLGFRAME} 
!define SM_CXSIZEFRAME          ${SM_CXFRAME}    
!define SM_CYSIZEFRAME          ${SM_CYFRAME}    
!define SM_SECURE               44
!define SM_CXEDGE               45
!define SM_CYEDGE               46
!define SM_CXMINSPACING         47
!define SM_CYMINSPACING         48
!define SM_CXSMICON             49
!define SM_CYSMICON             50
!define SM_CYSMCAPTION          51
!define SM_CXSMSIZE             52
!define SM_CYSMSIZE             53
!define SM_CXMENUSIZE           54
!define SM_CYMENUSIZE           55
!define SM_ARRANGE              56
!define SM_CXMINIMIZED          57
!define SM_CYMINIMIZED          58
!define SM_CXMAXTRACK           59
!define SM_CYMAXTRACK           60
!define SM_CXMAXIMIZED          61
!define SM_CYMAXIMIZED          62
!define SM_NETWORK              63
!define SM_CLEANBOOT            67
!define SM_CXDRAG               68
!define SM_CYDRAG               69
!define SM_SHOWSOUNDS           70
!define SM_CXMENUCHECK          71 
!define SM_CYMENUCHECK          72
!define SM_SLOWMACHINE          73
!define SM_MIDEASTENABLED       74
!define SM_MOUSEWHEELPRESENT    75
!define SM_XVIRTUALSCREEN       76
!define SM_YVIRTUALSCREEN       77
!define SM_CXVIRTUALSCREEN      78
!define SM_CYVIRTUALSCREEN      79
!define SM_CMONITORS            80
!define SM_SAMEDISPLAYFORMAT    81
!define SM_IMMENABLED           82
!define SM_CXFOCUSBORDER        83
;!define SM_TABLETPC             86
;!define SM_MEDIACENTER          87
;!define SM_STARTER              88
;!define SM_SERVERR2             89
!define SM_MOUSEHORIZONTALWHEELPRESENT    91
!define SM_CXPADDEDBORDER       92
!define SM_DIGITIZER            94
!define SM_MAXIMUMTOUCHES       95
!define SM_REMOTESESSION        0x1000
!define SM_SHUTTINGDOWN         0x2000
!define SM_REMOTECONTROL        0x2001
!define SM_CARETBLINKINGENABLED 0x2002
!define SM_CONVERTIBLESLATEMODE 0x2003
!define SM_SYSTEMDOCKED         0x2004

;int GetSystemMetrics(int nIndex)
!define fnGetSystemMetrics \
		'User32::GetSystemMetrics(i) i'

; Image types
!ifndef IMAGE_BITMAP
!define IMAGE_BITMAP        0
!endif
!ifndef IMAGE_ICON
!define IMAGE_ICON          1
!endif
!ifndef IMAGE_CURSOR
!define IMAGE_CURSOR        2
!endif
!ifndef IMAGE_ENHMETAFILE
!define IMAGE_ENHMETAFILE   3
!endif

; Load Image Flags
!ifndef LR_DEFAULTCOLOR
!define LR_DEFAULTCOLOR     0x00000000
!define LR_MONOCHROME       0x00000001
!define LR_COLOR            0x00000002
!define LR_COPYRETURNORG    0x00000004
!define LR_COPYDELETEORG    0x00000008
!define LR_LOADFROMFILE     0x00000010
!define LR_LOADTRANSPARENT  0x00000020
!define LR_DEFAULTSIZE      0x00000040
!define LR_VGACOLOR         0x00000080
!define LR_LOADMAP3DCOLORS  0x00001000
!define LR_CREATEDIBSECTION 0x00002000
!define LR_COPYFROMRESOURCE 0x00004000
!define LR_SHARED           0x00008000
!endif ; defined (LR_DEFAULTCOLOR)

; HANDLE LoadImage(HINSTANCE hinst,
;				   LPCTSTR lpszName,
;				   UINT uType,
;				   int cxDesired,
;				   int cyDesired,
;				   UINT fuLoad)
!define fnLoadImage \
		'User32::LoadImage(i, t, i, i, i, i) i'

;BOOL DeleteObject(HGDIOBJ hObject);
!define fnDeleteObject \
		'GDI32::DeleteObject(i) i'

;int GetObject(HGDIOBJ hgdiobj,
;			   int cbBuffer,
;			   LPVOID lpvObject);
!define fnGetObject \
		'GDI32::GetObject(i, i, i) i'

;BOOL GetIconInfo(HICON hIcon,
;				  PICONINFO piconinfo)
!define fnGetIconInfo \
		'User32::GetIconInfo(i, i) i'

;BOOL DestroyIcon(HICON hIcon)
!define fnDestroyIcon \
		'User32::DestroyIcon(i) i'

;BOOL DestroyWindow(HWND hWnd)
!define fnDestroyWindow \
		'User32::DestroyWindow(i) i'

;HWND WINAPI CreateWindowEx(DWORD dwExStyle,
;						    LPCTSTR lpClassName,
;							LPCTSTR lpWindowName,
;							DWORD dwStyle,
;							int x,
;							int y,
;							int nWidth,
;							int nHeight,
;							HWND hWndParent,
;							HMENU hMenu,
;							HINSTANCE hInstance,
;							LPVOID lpParam)
!define fnCreateWindowEx \
		'User32::CreateWindowEx(i, t, t, i, i, i, i, i, i, i, i, i) i'

!endif ; defined(NULLSOFT_NX_SYSTEM_NSIS_HEADER)