Révision 2956

tmp/org.txm.setups/shared/win/txm.nsi (revision 2956)
1
Unicode True
2

  
1 3
!include MUI2.nsh
2 4

  
3 5
!include nsDialogs.nsh
......
11 13
;!define Version ""
12 14
!define Version "-TXMVERSION"
13 15

  
14

  
15 16
OutFile "../TXM_TXMDATEVERSION_Win64_installer.exe"
16 17

  
17 18
InstallDir "$PROGRAMFILES64\TXM${Version}"
tmp/org.txm.setups/nsis/Include/WinVer.nsh (revision 2956)
12 12
;     DetailPrint "Not running on NT. Installing ANSI application."
13 13
;   ${EndIf}
14 14
;
15
; IsServer checks if the installer is running on a server version of Windows (NT4, 2003, 2008, etc.)
15
; IsServerOS checks if the installer is running on a server version of Windows (2000, 2003, 2008, etc.)
16
; IsDomainController checks if the server is a domain controller
16 17
;
17 18
; AtLeastWin<version> checks if the installer is running on Windows version at least as specified.
18 19
; IsWin<version> checks if the installer is running on Windows version exactly as specified.
19 20
; AtMostWin<version> checks if the installer is running on Windows version at most as specified.
21
; AtLeastBuild <number> checks if the installer is running on a Windows version with a minimum build number.
22
; AtMostBuild <number> checks if the installer is running on a Windows version with a maximum build number.
23
; AtLeastWaaS <name> and AtMostWaaS <name> checks Windows 10 "friendly names" against the build number.
20 24
;
21 25
; <version> can be replaced with the following values:
22 26
;
......
34 38
;   2008R2
35 39
;   8
36 40
;   2012
41
;   8.1
42
;   2012R2
43
;   10
37 44
;
45
;   Note: Windows 8.1 and later will be detected as Windows 8 unless ManifestSupportedOS is set correctly!
46
;
38 47
; AtLeastServicePack checks if the installer is running on Windows service pack version at least as specified.
39 48
; IsServicePack checks if the installer is running on Windows service pack version exactly as specified.
40 49
; AtMostServicePack checks if the installer is running on Windows service version pack at most as specified.
......
73 82
;   check if running on the NT family.
74 83
;
75 84
;     ${If} ${AtLeastWin95}
76
;     ${And} ${AtMostWinME}
85
;     ${AndIf} ${AtMostWinME}
77 86
;       DetailPrint "Running 95, 98 or ME."
78 87
;       DetailPrint "Actually, maybe it's NT4?"
79 88
;       ${If} ${IsNT}
......
103 112

  
104 113
# masks for our variables
105 114

  
106
!define _WINVER_VERXBIT  0x00000001
107
!define _WINVER_MASKVMAJ 0x7F000000
108
!define _WINVER_MASKVMIN 0x00FF0000
115
!define _WINVER_VERXBIT  0x00000001 ; Used to boost $__WINVERV
116
!define _WINVER_MASKVMAJ 0x7F000000 ; $__WINVERV mask
117
!define _WINVER_MASKVMIN 0x00FF0000 ; $__WINVERV mask
118
!define _WINVER_NTMASK   0x7FFFFFFF ; $__WINVERV mask used by AtMost/AtLeast
119
!define _WINVER_NTBIT    0x80000000 ; $__WINVERV bit used by Is and $__WINVERSP bit used by IsNT
120
!define _WINVER_NTSRVBIT 0x40000000 ; $__WINVERSP bit for !VER_NT_WORKSTATION
121
!define _WINVER_NTDCBIT  0x20000000 ; $__WINVERSP bit for VER_NT_DOMAIN_CONTROLLER
122
!define _WINVER_MASKVBLD 0x0000FFFF ; $__WINVERSP mask for OS build number
123
!define _WINVER_MASKSP   0x000F0000 ; $__WINVERSP mask for OS service pack
109 124

  
110
!define _WINVER_NTBIT    0x80000000
111
!define _WINVER_NTMASK   0x7FFFFFFF
112
!define _WINVER_NTSRVBIT 0x40000000
113
!define _WINVER_MASKVBLD 0x0000FFFF
114
!define _WINVER_MASKSP   0x000F0000
115

  
116 125
# possible variable values for different versions
117 126

  
118 127
!define WINVER_95_NT     0x04000000 ;4.00.0950
......
122 131
;define WINVER_98SE      0x040a0000 ;4.10.2222
123 132
!define WINVER_ME_NT     0x045a0000 ;4.90.3000
124 133
!define WINVER_ME        0x045a0000 ;4.90.3000
125
;define WINVER_NT3d51               ;3.51.1057
134
;define WINVER_NT3.51               ;3.51.1057
126 135
!define WINVER_NT4_NT    0x84000000 ;4.00.1381
127 136
!define WINVER_NT4       0x04000000 ;4.00.1381
128 137
!define WINVER_2000_NT   0x85000000 ;5.00.2195
......
144 153
!define WINVER_8         0x06020000 ;6.02.9200
145 154
!define WINVER_2012_NT   0x86020001 ;6.02.9200
146 155
!define WINVER_2012      0x06020001 ;6.02.9200
156
!define WINVER_8.1_NT    0x86030000 ;6.03.9600
157
!define WINVER_8.1       0x06030000 ;6.03.9600
158
!define WINVER_2012R2_NT 0x86030001 ;6.03.9600
159
!define WINVER_2012R2    0x06030001 ;6.03.9600
160
!define WINVER_10_NT     0x8A000000 ;10.0.10240
161
!define WINVER_10        0x0A000000 ;10.0.10240
162
!define WINVER_2016_NT   0x8A000001 ;10.0.14393
163
!define WINVER_2016      0x0A000001 ;10.0.14393
147 164

  
148 165

  
149 166
# use this to make all nt > 9x
150 167

  
151 168
!ifdef WINVER_NT4_OVER_W95
152
  !define __WINVERTMP ${WINVER_NT4}
153
  !undef WINVER_NT4
154
  !define /math WINVER_NT4 ${__WINVERTMP} | ${_WINVER_VERXBIT}
155
  !undef __WINVERTMP
169
  !define /redef /math WINVER_NT4 ${WINVER_NT4} | ${_WINVER_VERXBIT}
156 170
!endif
157 171

  
158 172
# some definitions from header files
159 173

  
174
!define OSVERSIONINFOW_SIZE   276
175
!define OSVERSIONINFOEXW_SIZE 284
160 176
!define OSVERSIONINFOA_SIZE   148
161 177
!define OSVERSIONINFOEXA_SIZE 156
162
!define VER_PLATFORM_WIN32_NT 2
163
!define VER_NT_WORKSTATION    1
178
!define /ifndef VER_PLATFORM_WIN32_NT 2
179
!define /ifndef VER_NT_WORKSTATION       1
180
!define /ifndef VER_NT_DOMAIN_CONTROLLER 2
181
!define /ifndef VER_NT_SERVER            3
164 182

  
165 183
!define SM_TABLETPC    86
166 184
!define SM_MEDIACENTER 87
......
189 207
  !macro __WinVer_Call_GetVersionEx STRUCT_SIZE
190 208

  
191 209
    System::Call '*$0(i ${STRUCT_SIZE})'
192
    System::Call kernel32::GetVersionEx(ir0)i.r3
210
    System::Call kernel32::GetVersionEx(pr0)i.r3
193 211

  
194 212
  !macroend
195 213

  
......
211 229
  Push $3 ;bld
212 230
  Push $R0 ;temp
213 231

  
232
  # a plugin call will lock the Unicode mode, it is now safe to set the struct size
233
  !ifdef NSIS_UNICODE
234
  !define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOW_SIZE}
235
  !define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXW_SIZE}
236
  !else
237
  !define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOA_SIZE}
238
  !define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXA_SIZE}
239
  !endif
240

  
214 241
  # allocate memory
215
  System::Alloc ${OSVERSIONINFOEXA_SIZE}
216
  Pop $0
242
  System::Call '*(&i${OSVERSIONINFOEX_SIZE})p.r0'
217 243

  
218 244
  # use OSVERSIONINFOEX
219
  !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEXA_SIZE}
245
  !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEX_SIZE}
220 246

  
221 247
  IntCmp $3 0 "" _winver_ex _winver_ex
222 248
    # OSVERSIONINFOEX not allowed (Win9x or NT4 w/SP < 6), use OSVERSIONINFO
223
    !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOA_SIZE}
249
    !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFO_SIZE}
224 250
  _winver_ex:
225 251

  
226 252
  # get results from struct
......
243 269
    IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT}
244 270
    IntOp $__WINVERV  $__WINVERV  | ${_WINVER_NTBIT}
245 271
  _winver_notnt:
246

  
272
!ifndef NSIS_UNICODE
273
!if "${NSIS_PTR_SIZE}" <= 4
247 274
  # get service pack information
248 275
  IntCmp $0 ${VER_PLATFORM_WIN32_NT} _winver_nt "" _winver_nt  # win9x
249 276

  
......
271 298
    Goto _winver_sp_done
272 299

  
273 300
  _winver_nt: # nt
301
!endif #~ 32-bit
302
!endif #~ ANSI
303
    IntCmp $R0 ${OSVERSIONINFOEX_SIZE} "" _winver_sp_noex _winver_sp_noex
274 304

  
275
    IntCmp $R0 ${OSVERSIONINFOEXA_SIZE} "" _winver_sp_noex _winver_sp_noex
276

  
277 305
      # discard szCSDVersion
278 306
      Pop $0
279 307

  
......
282 310
      Pop $0
283 311

  
284 312
      # is server?
285
      IntCmp $0 ${VER_NT_WORKSTATION} _winver_noserver _winver_noserver ""
313
      IntCmp $0 ${VER_NT_WORKSTATION} _winver_nt_notsrv
286 314
        IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTSRVBIT}
287
      _winver_noserver:
315
        IntCmp $0 ${VER_NT_DOMAIN_CONTROLLER} "" _winver_nt_notdc _winver_nt_notdc
316
          IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTDCBIT}
317
        _winver_nt_notdc:
318
      _winver_nt_notsrv:
288 319

  
289 320
      # get wServicePackMajor
290 321
      Pop $0
......
295 326
    _winver_sp_noex: # OSVERSIONINFO, not OSVERSIONINFOEX
296 327

  
297 328
      ####  TODO
298
      ## For IsServer to support < NT4SP6, we need to check the registry
329
      ## For IsServerOS to support < NT4SP6, we need to check the registry
299 330
      ## here to see if we are a server and/or DC
300 331

  
301 332
      # get szCSDVersion
......
313 344
        StrCpy $0 0 # no service pack
314 345

  
315 346
!ifdef WINVER_NT4_OVER_W95
316
      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}
347
      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; change NT 4.0.reserved.0 to 4.0.reserved.1
317 348
!endif
318 349

  
319 350
  _winver_sp_done:
......
395 426
  !insertmacro __WinVer_DefineOSTest ${Test} 2008R2 '${Suffix}'
396 427
  !insertmacro __WinVer_DefineOSTest ${Test} 8      '${Suffix}'
397 428
  !insertmacro __WinVer_DefineOSTest ${Test} 2012   '${Suffix}'
429
  !insertmacro __WinVer_DefineOSTest ${Test} 8.1    '${Suffix}'
430
  !insertmacro __WinVer_DefineOSTest ${Test} 2012R2 '${Suffix}'
431
  !insertmacro __WinVer_DefineOSTest ${Test} 10     '${Suffix}'
432
  !insertmacro __WinVer_DefineOSTest ${Test} 2016   '${Suffix}'
398 433
!macroend
399 434

  
400 435
!insertmacro __WinVer_DefineOSTests AtLeast ""
......
403 438

  
404 439
# version feature LogicLib macros
405 440

  
406
!macro _IsNT _a _b _t _f
441
!macro __WinVer_LL_IsBitSet _v _b _t _f
407 442
  !insertmacro _LOGICLIB_TEMP
408 443
  ${CallArtificialFunction} __WinVer_InitVars
409
  IntOp $_LOGICLIB_TEMP $__WINVERSP & ${_WINVER_NTBIT}
444
  IntOp $_LOGICLIB_TEMP ${_v} & ${_b}
410 445
  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
411 446
!macroend
412
!define IsNT `"" IsNT ""`
413 447

  
414
!macro _IsServerOS _a _b _t _f
415
  !insertmacro _LOGICLIB_TEMP
416
  ${CallArtificialFunction} __WinVer_InitVars
417
  IntOp $_LOGICLIB_TEMP $__WINVERSP & ${_WINVER_NTSRVBIT}
418
  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
419
!macroend
420
!define IsServerOS `"" IsServerOS ""`
448
!define IsNT `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTBIT}`
449
!define IsServerOS `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTSRVBIT}`
450
!define IsDomainController `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTDCBIT}`
421 451

  
422 452
# service pack macros
423 453

  
......
481 511
!define WinVerGetMinor '!insertmacro __WinVer_GetVer $__WINVERV  16 ${_WINVER_MASKVMIN}'
482 512
!define WinVerGetBuild '!insertmacro __WinVer_GetVer $__WINVERSP "" ${_WINVER_MASKVBLD}'
483 513

  
484
# done
514
!macro _WinVer_BuildNumCheck op num _t _f
515
  !insertmacro _LOGICLIB_TEMP
516
  ${WinVerGetBuild} $_LOGICLIB_TEMP
517
  !insertmacro _${op} $_LOGICLIB_TEMP ${num} `${_t}` `${_f}`
518
!macroend
519
!define AtLeastBuild `U>= WinVer_BuildNumCheck `
520
!define AtMostBuild `U<= WinVer_BuildNumCheck `
485 521

  
522
# Windows as a Service macros
523

  
524
!macro WinVer_WaaS id build fu codename marketingname
525
  !if "${id}" == ${fu}
526
    !define WinVer_WaaS_Build ${build}
527
  !else if "${id}" == "${codename}"
528
    !define WinVer_WaaS_Build ${build}
529
  !else if "${id}" == "${marketingname}"
530
    !define WinVer_WaaS_Build ${build}
531
  !endif
532
!macroend
533

  
534
!macro _WinVer_WaaS op id _t _f
535
  !insertmacro WinVer_WaaS "${id}" 10240 1507 "Threshold"   "RTM" ; 10240.16384
536
  !insertmacro WinVer_WaaS "${id}" 10586 1511 "Threshold 2" "November Update" ; 10586.0?
537
  !insertmacro WinVer_WaaS "${id}" 14393 1607 "Redstone"    "Anniversary Update" ; 14393.10
538
  !insertmacro WinVer_WaaS "${id}" 15063 1703 "Redstone 2"  "Creators Update" ; 15063.13
539
  !insertmacro WinVer_WaaS "${id}" 16299 1709 "Redstone 3"  "Fall Creators Update" ; 16299.19
540
  !insertmacro WinVer_WaaS "${id}" 17134 1803 "Redstone 4"  "April 2018 Update" ; 17134.1
541
  !insertmacro WinVer_WaaS "${id}" 17763 1809 "Redstone 5"  "October 2018 Update" ; 17763.1
542
  !insertmacro WinVer_WaaS "${id}" 18362 1903 "19H1"        "May 2019 Update" ; 18362.116
543
  !insertmacro WinVer_WaaS "${id}" 18363 1909 "19H2"        "November 2019 Update" ; 18363.418
544
  !insertmacro WinVer_WaaS "${id}" 19041 2004 "20H1"        "May 2020 Update" ; 19041.264?
545
  !ifmacrodef WinVerExternal_WaaS_MapToBuild
546
    !insertmacro WinVerExternal_WaaS_MapToBuild ${op} "${id}" WinVer_WaaS_Build
547
  !endif
548
  !define /IfNDef WinVer_WaaS_Build 0
549
  !if "${WinVer_WaaS_Build}" <= 9600
550
    !error 'WinVer: Unknown WaaS name: ${id}'
551
  !endif
552
  !insertmacro _WinVer_BuildNumCheck ${op} ${WinVer_WaaS_Build} `${_t}` `${_f}`
553
  !undef WinVer_WaaS_Build
554
!macroend
555

  
556
!define AtLeastWaaS `U>= WinVer_WaaS `
557
!define AtMostWaaS `U<= WinVer_WaaS `
558

  
486 559
!endif # !___WINVER__NSH___
487 560

  
488 561
!verbose pop
tmp/org.txm.setups/nsis/Include/Util.nsh (revision 2956)
4 4
;
5 5
; Voodoo macros to make end-user usage easier. This may be documented someday.
6 6

  
7
!verbose push
8
!verbose 3
9

  
7
!verbose push 3
10 8
!ifndef ___UTIL__NSH___
11 9
!define ___UTIL__NSH___
12 10

  
13
# see WinVer.nsh and *Func.nsh for usage examples
14
!macro CallArtificialFunction NAME
15
  !ifndef __UNINSTALL__
16
    !define CallArtificialFunction_TYPE inst
17
  !else
18
    !define CallArtificialFunction_TYPE uninst
19
  !endif
20
  Call :.${NAME}${CallArtificialFunction_TYPE}
21
  !ifndef ${NAME}${CallArtificialFunction_TYPE}_DEFINED
22
    Goto ${NAME}${CallArtificialFunction_TYPE}_DONE
23
    !define ${NAME}${CallArtificialFunction_TYPE}_DEFINED
24
    .${NAME}${CallArtificialFunction_TYPE}:
11
# CallArtificialFunction, see WinVer.nsh and *Func.nsh for usage examples
12
!macro CallArtificialFunctionHelper TYPE NAME
13
  !verbose pop
14
  Call :.${NAME}${TYPE}
15
  !ifndef ${NAME}${TYPE}_DEFINED
16
    !verbose push 2
17
    Goto ${NAME}${TYPE}_DONE
18
    !define ${NAME}${TYPE}_DEFINED
19
    !verbose pop
20
    .${NAME}${TYPE}:
25 21
      !insertmacro ${NAME}
26
    Return
27
    ${NAME}${CallArtificialFunction_TYPE}_DONE:
22
      Return
23
    ${NAME}${TYPE}_DONE:
28 24
  !endif
29
  !undef CallArtificialFunction_TYPE
25
  !verbose push 2
30 26
!macroend
31
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
32 27

  
33
# for usage of artificial functions inside artificial functions
34
# macro recursion is prohibited
35
!macro CallArtificialFunction2 NAME
36
  !ifndef __UNINSTALL__
37
    !define CallArtificialFunction2_TYPE inst
28
!macro CallArtificialFunction NAME
29
  !verbose push 2
30
  !ifdef __UNINSTALL__
31
    !insertmacro CallArtificialFunctionHelper uninst ${NAME}
38 32
  !else
39
    !define CallArtificialFunction2_TYPE uninst
33
    !insertmacro CallArtificialFunctionHelper inst ${NAME}
40 34
  !endif
41
  Call :.${NAME}${CallArtificialFunction2_TYPE}
42
  !ifndef ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
43
    Goto ${NAME}${CallArtificialFunction2_TYPE}_DONE
44
    !define ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
45
    .${NAME}${CallArtificialFunction2_TYPE}:
46
      !insertmacro ${NAME}
47
    Return
48
    ${NAME}${CallArtificialFunction2_TYPE}_DONE:
49
  !endif
50
  !undef CallArtificialFunction2_TYPE
35
  !verbose pop
51 36
!macroend
52
!define CallArtificialFunction2 `!insertmacro CallArtificialFunction2`
37
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
53 38

  
54
!endif # !___UTIL__NSH___
39
!macro CallArtificialFunction2 NAME ; Retained for v2.4x..v3.0b0 compatibility
40
  ${CallArtificialFunction} ${NAME}
41
!macroend
42
!define CallArtificialFunction2 `!insertmacro CallArtificialFunction`
55 43

  
44

  
45
!define Int32Op '!insertmacro Int32Op '
46
!define Int64Op '!insertmacro Int64Op '
47
!define IntPtrOp '!insertmacro IntPtrOp '
48
!macro Int32Op r a o b
49
IntOp `${r}` `${a}` `${o}` ${b}
50
!macroend
51
!macro Int64Op r a o b
52
!echo "Int64Op ${r}=${a}${o}${b}"
53
!verbose push 2
54
System::Int64Op `${a}` `${o}` ${b}
55
Pop ${r}
56 56
!verbose pop
57
!macroend
58
!macro IntPtrOp r a o b
59
IntPtrOp `${r}` `${a}` `${o}` `${b}`
60
!macroend
61

  
62
!define Int32Cmp '!insertmacro Int32Cmp '
63
!define Int64Cmp '!insertmacro Int64Cmp '
64
!define IntPtrCmp '!insertmacro IntPtrCmp '
65
!macro Int32Cmp a b jeek jles jgtr
66
IntCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
67
!macroend
68
!macro Int64Cmp a b jeek jles jgtr
69
!if ${NSIS_PTR_SIZE} <= 4
70
!ifmacrondef _LOGICLIB_TEMP
71
!include LogicLib.nsh
72
!endif
73
!echo "Int64Cmp ${a}:${b} =${jeek}, <${jles}, >${jgtr}"
74
!verbose push 2
75
${IfThen} ${a} L= ${b} ${|} Goto ${jeek} ${|}
76
!insertmacro _L< ${a} ${b} `${jles}` `${jgtr}`
77
!verbose pop
78
!else
79
Int64Cmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
80
!endif
81
!macroend
82
!macro IntPtrCmp a b jeek jles jgtr
83
IntPtrCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
84
!macroend
85

  
86
!define Int32CmpU '!insertmacro Int32CmpU '
87
!define Int64CmpU '!insertmacro Int64CmpU '
88
!define IntPtrCmpU '!insertmacro IntPtrCmpU '
89
!macro Int32CmpU a b jeek jles jgtr
90
IntCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
91
!macroend
92
!macro Int64CmpUHelper
93
; This macro performs "$_LOGICLIB_TEMP = a < b ? -1 : a > b ? 1 : 0" but System::Int64Op does not support unsigned operations so we have to perform multiple steps
94
!ifmacrondef _LOGICLIB_TEMP
95
!include LogicLib.nsh
96
!endif
97
!insertmacro _LOGICLIB_TEMP
98
Exch $2 ; b
99
Exch
100
Exch $1 ; a
101
; if (a == b) return 0;
102
; if (a < 0)
103
; {
104
;   if (b >= 0) return 1
105
; }
106
; else
107
; {
108
;   if (b < 0) return -1
109
; }
110
; return a < b ? -1 : 1
111
System::Int64Op $1 ^ $2 ; Using xor so $_LOGICLIB_TEMP ends up as 0 when they are equal
112
Pop $_LOGICLIB_TEMP
113
StrCmp $_LOGICLIB_TEMP 0 ret ; NOTE: Must use StrCmp, IntCmp fails on "0x8000000000000001 Z> 1"
114
System::Int64Op $1 < 0
115
Pop $_LOGICLIB_TEMP
116
StrCmp $_LOGICLIB_TEMP 0 checkNegOther
117
System::Int64Op $2 < 0 ; System::Int64Op does not support the >= operator so we invert the operation
118
Pop $_LOGICLIB_TEMP
119
StrCmp $_LOGICLIB_TEMP 0 retPos finalCmp
120
retPos:
121
StrCpy $_LOGICLIB_TEMP "1"
122
Goto ret
123
checkNegOther:
124
System::Int64Op $2 < 0
125
Pop $_LOGICLIB_TEMP
126
StrCmp $_LOGICLIB_TEMP 0 finalCmp retNeg
127
retNeg:
128
StrCpy $_LOGICLIB_TEMP "-1"
129
Goto ret
130
finalCmp:
131
System::Int64Op $1 < $2
132
Pop $_LOGICLIB_TEMP
133
StrCmp $_LOGICLIB_TEMP 0 retPos retNeg
134
ret:
135
Pop $1
136
Pop $2
137
!macroend
138
!macro Int64CmpU a b jeek jles jgtr
139
!if ${NSIS_PTR_SIZE} <= 4
140
!echo "Int64CmpU ${a}:${b} =${jeek}, <${jles}, >${jgtr}"
141
!verbose push 2
142
Push `${a}`
143
Push `${b}`
144
!insertmacro CallArtificialFunction Int64CmpUHelper
145
IntCmp $_LOGICLIB_TEMP 0 `${jeek}` `${jles}` `${jgtr}`
146
!verbose pop
147
!else
148
Int64CmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
149
!endif
150
!macroend
151
!macro IntPtrCmpU a b jeek jles jgtr
152
IntPtrCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
153
!macroend
154

  
155

  
156
!define MakeARPInstallDate "!insertmacro MakeARPInstallDate "
157
!macro MakeARPInstallDate _outvar
158
System::Call 'KERNEL32::GetDateFormat(i0x409,i0,p0,t"yyyyMMdd",t.s,i${NSIS_MAX_STRLEN})'
159
Pop ${_outvar}
160
!macroend
161

  
162

  
163
!define /IfNDef SPI_GETHIGHCONTRAST 0x42
164
!define /IfNDef HCF_HIGHCONTRASTON 0x01
165
!define /IfNDef /math SYSSIZEOF_HIGHCONTRAST 8 + ${NSIS_PTR_SIZE}
166
!define IsHighContrastModeActive '"" IsHighContrastModeActive ""'
167
!macro _IsHighContrastModeActive _lhs _rhs _t _f
168
!ifmacrondef _LOGICLIB_TEMP
169
!include LogicLib.nsh
170
!endif
171
!insertmacro _LOGICLIB_TEMP
172
Push $1
173
System::Call '*(i${SYSSIZEOF_HIGHCONTRAST},i0,p)p.r1'
174
System::Call 'USER32::SystemParametersInfo(i${SPI_GETHIGHCONTRAST},i${SYSSIZEOF_HIGHCONTRAST},pr1,i0)'
175
System::Call '*$1(i,i.s)'
176
Pop $_LOGICLIB_TEMP
177
System::Free $1
178
Pop $1
179
!insertmacro _& $_LOGICLIB_TEMP ${HCF_HIGHCONTRASTON} `${_t}` `${_f}`
180
!macroend
181

  
182

  
183
!endif # !___UTIL__NSH___
184
!verbose pop
tmp/org.txm.setups/nsis/Include/LangFile.nsh (revision 2956)
2 2

  
3 3
LangFile.nsh
4 4

  
5
Header file to create langauge files that can be
5
Header file to create language files that can be
6 6
included with a single command.
7 7

  
8
Copyright 2008-2015 Joost Verburg
8
Copyright 2008-2020 Joost Verburg, Anders Kjersem
9 9

  
10 10
* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT
11
  can be called from the script to include a language
12
  file.
11
  can be called from the script to include a language file.
13 12

  
14 13
  - LANGFILE_INCLUDE takes the language file name as parameter.
15 14
  - LANGFILE_INCLUDE_WITHDEFAULT takes as additional second
16
    parameter the default language file to load missing strings
17
    from.
15
    parameter, the default language file to load missing strings from.
18 16

  
19
* A language file start with:
20
  !insertmacro LANGFILE_EXT "English"
21
  using the same name as the standard NSIS language file.
22

  
23 17
* Language strings in the language file have the format:
24 18
  ${LangFileString} LANGSTRING_NAME "Text"
25 19

  
20
* There are two types of language header files:
21

  
22
  - NSIS multi-lang support; these must start with the LANGFILE macro and 
23
    provide strings for features like MUI and MultiUser. If you are adding 
24
    support for a new language to NSIS you should make a copy of English.nsh 
25
    and translate this .nsh along with the .nlf.
26
  - Custom installer strings; these must start with the LANGFILE_EXT macro and 
27
    contain translated versions of 
28
    custom strings used in a particular installer.
29
    This is useful if you want to put the translations for each language in 
30
    their own separate file.
31

  
32
* Example:
33

  
34
  ; Setup.nsi
35
  !include "MUI.nsh"
36
  !insertmacro MUI_PAGE_INSTFILES
37
  !insertmacro MUI_LANGUAGE "Danish"
38
  !insertmacro LANGFILE_INCLUDE "DanishExtra.nsh"
39
  !insertmacro MUI_LANGUAGE "Swedish"
40
  !insertmacro LANGFILE_INCLUDE "SwedishExtra.nsh"
41
  Section
42
  MessageBox MB_OK "$(myCustomString)"
43
  SectionEnd
44

  
45
  ; SwedishExtra.nsh
46
  !insertmacro LANGFILE_EXT Swedish
47
  ${LangFileString} myCustomString "Bork bork"
48

  
26 49
*/
27 50

  
28 51
!ifndef LANGFILE_INCLUDED
......
30 53

  
31 54
!macro LANGFILE_INCLUDE FILENAME
32 55

  
33
  ;Called from script: include a langauge file
56
  ;Called from script: include a language file
34 57

  
35 58
  !ifdef LangFileString
36 59
    !undef LangFileString
......
43 66
  !undef LANGFILE_SETNAMES
44 67

  
45 68
  ;Create language strings
46

  
47
  !undef LangFileString
48
  !define LangFileString "!insertmacro LANGFILE_LANGSTRING"
69
  !define /redef LangFileString "!insertmacro LANGFILE_LANGSTRING"
49 70
  !include "${FILENAME}"
50 71

  
51 72
!macroend
52 73

  
53 74
!macro LANGFILE_INCLUDE_WITHDEFAULT FILENAME FILENAME_DEFAULT
54 75

  
55
  ;Called from script: include a langauge file
76
  ;Called from script: include a language file
56 77
  ;Obtains missing strings from a default file
57 78

  
58 79
  !ifdef LangFileString
......
66 87
  !undef LANGFILE_SETNAMES
67 88

  
68 89
  ;Include default language for missing strings
90
  !define LANGFILE_PRIV_INCLUDEISFALLBACK "${FILENAME_DEFAULT}"
69 91
  !include "${FILENAME_DEFAULT}"
70
  
92
  !undef LANGFILE_PRIV_INCLUDEISFALLBACK
93

  
71 94
  ;Create language strings
72
  !undef LangFileString
73
  !define LangFileString "!insertmacro LANGFILE_LANGSTRING"
95
  !define /redef LangFileString "!insertmacro LANGFILE_LANGSTRING"
74 96
  !include "${FILENAME_DEFAULT}"
75 97

  
76 98
!macroend
77 99

  
78
!macro LANGFILE IDNAME NAME
100
!macro LANGFILE NLFID ENGNAME NATIVENAME NATIVEASCIINAME
79 101

  
80 102
  ;Start of standard NSIS language file
81 103

  
104
  ; NLFID: Must match the name of the .nlf file
105
  ; ENGNAME: English name of language, "=" if it is the same as NLFID
106
  ; NATIVENAME: Native name of language. (In Unicode)
107
  ; NATIVEASCIINAME: Native name of language using only ASCII, "=" if it is the same as NATIVENAME
108

  
109
  ; Example: LANGFILE "Swedish" = "Svenska" = (This is the same as LANGFILE "Swedish" "Swedish" "Svenska" "Svenska")
110
  ; For more examples, see French.nsh, Greek.nsh and PortugueseBR.nsh
111

  
82 112
  !ifdef LANGFILE_SETNAMES
83 113

  
84 114
    !ifdef LANGFILE_IDNAME
85 115
      !undef LANGFILE_IDNAME
86 116
    !endif
87 117

  
88
    !define LANGFILE_IDNAME "${IDNAME}"
118
    !define LANGFILE_IDNAME "${NLFID}"
89 119

  
90
    !ifndef "LANGFILE_${IDNAME}_NAME"
91
      !define "LANGFILE_${IDNAME}_NAME" "${NAME}"
120
    ; ModernUI or the .nsi can change LANGFILE_LANGDLL_FMT if desired
121
    !ifndef LANGFILE_LANGDLL_FMT
122
      !ifndef NSIS_UNICODE
123
        !define LANGFILE_LANGDLL_FMT "%ENGNAME% / %NATIVEASCIINAME%"
124
      !endif
125
      !define /ifndef LANGFILE_LANGDLL_FMT "%NATIVENAME%"
92 126
    !endif
93 127

  
128
    !ifndef "LANGFILE_${NLFID}_NAME"
129
      !if "${ENGNAME}" == "="
130
        !define /redef ENGNAME "${NLFID}"
131
      !endif
132
      !if "${NATIVEASCIINAME}" == "="
133
        !define /redef NATIVEASCIINAME "${NATIVENAME}"
134
      !endif
135

  
136
      !define "LANGFILE_${NLFID}_ENGLISHNAME" "${ENGNAME}"
137
      !ifdef NSIS_UNICODE
138
        !define "LANGFILE_${NLFID}_NAME" "${NATIVENAME}"
139
      !else
140
        !define "LANGFILE_${NLFID}_NAME" "${NATIVEASCIINAME}"
141
      !endif
142

  
143
      !searchreplace LANGFILE_${NLFID}_LANGDLL "${LANGFILE_LANGDLL_FMT}" %NATIVEASCIINAME% "${NATIVEASCIINAME}"
144
      !searchreplace LANGFILE_${NLFID}_LANGDLL "${LANGFILE_${NLFID}_LANGDLL}" %NATIVENAME% "${NATIVENAME}"
145
      !searchreplace LANGFILE_${NLFID}_LANGDLL "${LANGFILE_${NLFID}_LANGDLL}" %ENGNAME% "${ENGNAME}"
146

  
147
    !endif
148

  
94 149
  !endif
95 150

  
96 151
!macroend
......
117 172

  
118 173
  !ifndef ${NAME}
119 174
    !define "${NAME}" "${VALUE}"
175
    !ifdef LANGFILE_PRIV_INCLUDEISFALLBACK
176
      !warning 'LangString "${NAME}" for language ${LANGFILE_IDNAME} is missing, using fallback from "${LANGFILE_PRIV_INCLUDEISFALLBACK}"'
177
    !endif
120 178
  !endif
121 179

  
122 180
!macroend
tmp/org.txm.setups/nsis/Include/x64.nsh (revision 2956)
4 4
;
5 5
; A few simple macros to handle installations on x64 machines.
6 6
;
7
; RunningX64 checks if the installer is running on x64.
7
; RunningX64 checks if the installer is running on a 64-bit OS.
8
; IsWow64 checks if the installer is a 32-bit application running on a 64-bit OS.
8 9
;
9 10
;   ${If} ${RunningX64}
10
;     MessageBox MB_OK "running on x64"
11
;     MessageBox MB_OK "Running on 64-bit Windows"
11 12
;   ${EndIf}
12 13
;
14
; IsNative* checks the OS native CPU architecture.
15
;
16
;   ${If} ${IsNativeAMD64}
17
;     ; Install AMD64 64-bit driver/library
18
;   ${ElseIf} ${IsNativeARM64}
19
;     ; Install ARM64 64-bit driver/library
20
;   ${ElseIf} ${IsNativeIA32}
21
;     ; Install i386 32-bit driver/library
22
;   ${Else}
23
;     Abort "Unsupported CPU architecture!"
24
;   ${EndIf}
25
;
26
;   ${If} ${IsNativeAMD64}
27
;       File "amd64\myapp.exe"
28
;   ${ElseIf} ${IsNativeIA32}
29
;   ${OrIf} ${IsWow64}
30
;       File "x86\myapp.exe"
31
;   ${Else}
32
;       Abort "Unsupported CPU architecture!"
33
;   ${EndIf}
34
;
13 35
; DisableX64FSRedirection disables file system redirection.
14 36
; EnableX64FSRedirection enables file system redirection.
15 37
;
16 38
;   SetOutPath $SYSDIR
17 39
;   ${DisableX64FSRedirection}
18
;   File some.dll # extracts to C:\Windows\System32
40
;   File something.bin # extracts to C:\Windows\System32
19 41
;   ${EnableX64FSRedirection}
20
;   File some.dll # extracts to C:\Windows\SysWOW64
42
;   File something.bin # extracts to C:\Windows\SysWOW64
21 43
;
22 44

  
23 45
!ifndef ___X64__NSH___
......
25 47

  
26 48
!include LogicLib.nsh
27 49

  
28
!macro _RunningX64 _a _b _t _f
50

  
51
!define IsWow64 `"" IsWow64 ""`
52
!macro _IsWow64 _a _b _t _f
29 53
  !insertmacro _LOGICLIB_TEMP
30
  System::Call kernel32::GetCurrentProcess()i.s
31
  System::Call kernel32::IsWow64Process(is,*i.s)
54
  System::Call kernel32::GetCurrentProcess()p.s
55
  System::Call kernel32::IsWow64Process2(ps,*i0s,*i) ; [Win10.1511+] 0 if not WOW64
56
  Push |
57
  System::Call kernel32::IsWow64Process(p-1,*i0s) ; [WinXP+] FALSE for a 32-bit application on ARM64!
58
  System::Int64Op
32 59
  Pop $_LOGICLIB_TEMP
33 60
  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
34 61
!macroend
35 62

  
63

  
36 64
!define RunningX64 `"" RunningX64 ""`
65
!macro _RunningX64 _a _b _t _f 
66
  !if ${NSIS_PTR_SIZE} > 4
67
    !insertmacro LogicLib_JumpToBranch `${_t}` `${_f}`
68
  !else
69
    !insertmacro _IsWow64 `${_a}` `${_b}` `${_t}` `${_f}`
70
  !endif
71
!macroend
37 72

  
38
!macro DisableX64FSRedirection
39 73

  
40
  System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
74
!define GetNativeMachineArchitecture "!insertmacro GetNativeMachineArchitecture "
75
!macro GetNativeMachineArchitecture outvar
76
  !define GetNativeMachineArchitecture_lbl lbl_GNMA_${__COUNTER__}
77
  System::Call kernel32::GetCurrentProcess()p.s
78
  System::Call kernel32::IsWow64Process2(ps,*i,*i0s)
79
  Pop ${outvar}
80
  IntCmp ${outvar} 0 "" ${GetNativeMachineArchitecture_lbl}_done ${GetNativeMachineArchitecture_lbl}_done
81
    !if "${NSIS_PTR_SIZE}" <= 4
82
    !if "${NSIS_CHAR_SIZE}" <= 1
83
    System::Call 'USER32::CharNextW(w"")p.s'
84
    Pop ${outvar}
85
    IntPtrCmpU ${outvar} 0 "" ${GetNativeMachineArchitecture_lbl}_oldnt ${GetNativeMachineArchitecture_lbl}_oldnt
86
      StrCpy ${outvar} 332 ; Always IMAGE_FILE_MACHINE_I386 on Win9x
87
      Goto ${GetNativeMachineArchitecture_lbl}_done
88
    ${GetNativeMachineArchitecture_lbl}_oldnt:
89
    !endif
90
    !endif
91
    System::Call '*0x7FFE002E(&i2.s)'
92
    Pop ${outvar}
93
  ${GetNativeMachineArchitecture_lbl}_done:
94
  !undef GetNativeMachineArchitecture_lbl
95
!macroend
41 96

  
97
!macro _IsNativeMachineArchitecture _ignore _arc _t _f
98
  !insertmacro _LOGICLIB_TEMP
99
  ${GetNativeMachineArchitecture} $_LOGICLIB_TEMP
100
  !insertmacro _= $_LOGICLIB_TEMP ${_arc} `${_t}` `${_f}`
42 101
!macroend
43 102

  
103
!define IsNativeMachineArchitecture `"" IsNativeMachineArchitecture `
104
!define IsNativeIA32 '${IsNativeMachineArchitecture} 332' ; Intel x86
105
!define IsNativeAMD64 '${IsNativeMachineArchitecture} 34404' ; x86-64/x64
106
!define IsNativeARM64 '${IsNativeMachineArchitecture} 43620'
107

  
108

  
44 109
!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
110
!macro DisableX64FSRedirection
111
  System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
112
!macroend
45 113

  
114
!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
46 115
!macro EnableX64FSRedirection
47

  
48 116
  System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
49

  
50 117
!macroend
51 118

  
52
!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
53 119

  
54 120
!endif # !___X64__NSH___
tmp/org.txm.setups/nsis/Include/InstallOptions.nsh (revision 2956)
125 125

  
126 126
  InitPluginsDir
127 127
  File "/oname=$PLUGINSDIR\${FILE}" "${FILE}"
128
!ifdef NSIS_UNICODE
129
  InstallOptions::make_unicode "$PLUGINSDIR\${FILE}"
130
!endif
128 131
  !insertmacro INSTALLOPTIONS_WRITE "${FILE}" "Settings" "RTL" "$(^RTL)"
129 132

  
130
  !verbose pop
131

  
132 133
!macroend
133 134

  
134 135
!macro INSTALLOPTIONS_EXTRACT_AS FILE FILENAME
135 136

  
136 137
  InitPluginsDir
137 138
  File "/oname=$PLUGINSDIR\${FILENAME}" "${FILE}"
139
!ifdef NSIS_UNICODE
140
  InstallOptions::make_unicode "$PLUGINSDIR\${FILENAME}"
141
!endif
138 142
  !insertmacro INSTALLOPTIONS_WRITE "${FILENAME}" "Settings" "RTL" "$(^RTL)"
139 143

  
140 144
!macroend
tmp/org.txm.setups/nsis/Include/nsDialogs.nsh (revision 2956)
6 6
*/
7 7

  
8 8
!ifndef NSDIALOGS_INCLUDED
9
!verbose push 2
9 10
!define NSDIALOGS_INCLUDED
10
!verbose push
11 11
!verbose 3
12 12

  
13 13
!include LogicLib.nsh
14 14
!include WinMessages.nsh
15 15

  
16
!define WS_EX_DLGMODALFRAME  0x00000001
17
!define WS_EX_NOPARENTNOTIFY 0x00000004
18
!define WS_EX_TOPMOST        0x00000008
19
!define WS_EX_ACCEPTFILES    0x00000010
20
!define WS_EX_TRANSPARENT    0x00000020
21
!define WS_EX_MDICHILD       0x00000040
22
!define WS_EX_TOOLWINDOW     0x00000080
23
!define WS_EX_WINDOWEDGE     0x00000100
24
!define WS_EX_CLIENTEDGE     0x00000200
25
!define WS_EX_CONTEXTHELP    0x00000400
26
!define WS_EX_RIGHT          0x00001000
27
!define WS_EX_LEFT           0x00000000
28
!define WS_EX_RTLREADING     0x00002000
29
!define WS_EX_LTRREADING     0x00000000
30
!define WS_EX_LEFTSCROLLBAR  0x00004000
31
!define WS_EX_RIGHTSCROLLBAR 0x00000000
32
!define WS_EX_CONTROLPARENT  0x00010000
33
!define WS_EX_STATICEDGE     0x00020000
34
!define WS_EX_APPWINDOW      0x00040000
16
!define /ifndef WS_EX_DLGMODALFRAME  0x00000001
17
!define /ifndef WS_EX_NOPARENTNOTIFY 0x00000004
18
!define /ifndef WS_EX_TOPMOST        0x00000008
19
!define /ifndef WS_EX_ACCEPTFILES    0x00000010
20
!define /ifndef WS_EX_TRANSPARENT    0x00000020
21
!define /ifndef WS_EX_MDICHILD       0x00000040
22
!define /ifndef WS_EX_TOOLWINDOW     0x00000080
23
!define /ifndef WS_EX_WINDOWEDGE     0x00000100
24
!define /ifndef WS_EX_CLIENTEDGE     0x00000200
25
!define /ifndef WS_EX_CONTEXTHELP    0x00000400
26
!define /ifndef WS_EX_RIGHT          0x00001000
27
!define /ifndef WS_EX_LEFT           0x00000000
28
!define /ifndef WS_EX_RTLREADING     0x00002000
29
!define /ifndef WS_EX_LTRREADING     0x00000000
30
!define /ifndef WS_EX_LEFTSCROLLBAR  0x00004000
31
!define /ifndef WS_EX_RIGHTSCROLLBAR 0x00000000
32
!define /ifndef WS_EX_CONTROLPARENT  0x00010000
33
!define /ifndef WS_EX_STATICEDGE     0x00020000
34
!define /ifndef WS_EX_APPWINDOW      0x00040000
35 35

  
36
!define WS_CHILD             0x40000000
37
!define WS_VISIBLE           0x10000000
38
!define WS_DISABLED          0x08000000
39
!define WS_CLIPSIBLINGS      0x04000000
40
!define WS_CLIPCHILDREN      0x02000000
41
!define WS_MAXIMIZE          0x01000000
42
!define WS_VSCROLL           0x00200000
43
!define WS_HSCROLL           0x00100000
44
!define WS_GROUP             0x00020000
45
!define WS_TABSTOP           0x00010000
36
!define /ifndef WS_CHILD             0x40000000
37
!define /ifndef WS_VISIBLE           0x10000000
38
!define /ifndef WS_DISABLED          0x08000000
39
!define /ifndef WS_CLIPSIBLINGS      0x04000000
40
!define /ifndef WS_CLIPCHILDREN      0x02000000
41
!define /ifndef WS_MAXIMIZE          0x01000000
42
!define /ifndef WS_VSCROLL           0x00200000
43
!define /ifndef WS_HSCROLL           0x00100000
44
!define /ifndef WS_GROUP             0x00020000
45
!define /ifndef WS_TABSTOP           0x00010000
46 46

  
47 47
!define ES_LEFT              0x00000000
48 48
!define ES_CENTER            0x00000001
......
58 58
!define ES_READONLY          0x00000800
59 59
!define ES_WANTRETURN        0x00001000
60 60
!define ES_NUMBER            0x00002000
61
!define ES_SAVESEL           0x00008000
61 62

  
62 63
!define SS_LEFT              0x00000000
63 64
!define SS_CENTER            0x00000001
......
152 153
!define LBS_NOSEL             0x4000
153 154
!define LBS_COMBOBOX          0x8000
154 155

  
155
!define LR_DEFAULTCOLOR     0x0000
156
!define LR_MONOCHROME       0x0001
157
!define LR_COLOR            0x0002
158
!define LR_COPYRETURNORG    0x0004
159
!define LR_COPYDELETEORG    0x0008
160
!define LR_LOADFROMFILE     0x0010
161
!define LR_LOADTRANSPARENT  0x0020
162
!define LR_DEFAULTSIZE      0x0040
163
!define LR_VGACOLOR         0x0080
164
!define LR_LOADMAP3DCOLORS  0x1000
165
!define LR_CREATEDIBSECTION 0x2000
166
!define LR_COPYFROMRESOURCE 0x4000
167
!define LR_SHARED           0x8000
156
!define ACS_CENTER      0x0001
157
!define ACS_TRANSPARENT 0x0002 ;  The parent of the animation control must not have the WS_CLIPCHILDREN style
158
!define ACS_AUTOPLAY    0x0004
159
!define ACS_TIMER       0x0008 ; < CC6
168 160

  
169
!define IMAGE_BITMAP        0
170
!define IMAGE_ICON          1
171
!define IMAGE_CURSOR        2
172
!define IMAGE_ENHMETAFILE   3
161
!define TBS_AUTOTICKS        0x0001
162
!define TBS_VERT             0x0002
163
!define TBS_HORZ             0x0000
164
!define TBS_TOP              0x0004
165
!define TBS_BOTTOM           0x0000
166
!define TBS_LEFT             0x0004
167
!define TBS_RIGHT            0x0000
168
!define TBS_BOTH             0x0008
169
!define TBS_NOTICKS          0x0010
170
!define TBS_ENABLESELRANGE   0x0020
171
!define TBS_FIXEDLENGTH      0x0040
172
!define TBS_NOTHUMB          0x0080
173
!define TBS_TOOLTIPS         0x0100 ; IE3
174
!define TBS_REVERSED         0x0200 ; IE5
175
!define TBS_DOWNISLEFT       0x0400 ; _WIN32_IE >= 0x0501
176
!define TBS_NOTIFYBEFOREMOVE 0x0800 ; IE6?
177
!define TBS_TRANSPARENTBKGND 0x1000 ; Vista
173 178

  
174
!define GWL_STYLE           -16
175
!define GWL_EXSTYLE         -20
179
!define UDS_WRAP        0x0001
180
!define UDS_SETBUDDYINT 0x0002
181
!define UDS_ALIGNRIGHT  0x0004
182
!define UDS_ALIGNLEFT   0x0008
183
!define UDS_AUTOBUDDY   0x0010
184
!define UDS_ARROWKEYS   0x0020
185
!define UDS_HORZ        0x0040
186
!define UDS_NOTHOUSANDS 0x0080
187
!define UDS_HOTTRACK    0x0100 ; 98+
176 188

  
189
!define MCS_DAYSTATE        0x0001
190
!define MCS_MULTISELECT     0x0002
191
!define MCS_WEEKNUMBERS     0x0004
192
!define MCS_NOTODAYCIRCLE   0x0008
193
!define MCS_NOTODAY         0x0010 ; IE4+?
194
!define MCS_NOTRAILINGDATES  0x0040 ; Vista+
195
!define MCS_SHORTDAYSOFWEEK  0x0080 ; Vista+
196
!define MCS_NOSELCHANGEONNAV 0x0100 ; Vista+
197

  
198
!define DTS_UPDOWN          0x01
199
!define DTS_SHOWNONE        0x02
200
!define DTS_SHORTDATEFORMAT 0x00
201
!define DTS_LONGDATEFORMAT  0x04
202
!define DTS_SHORTDATECENTURYFORMAT 0x0C
203
!define DTS_TIMEFORMAT      0x09
204
!define DTS_APPCANPARSE     0x10
205
!define DTS_RIGHTALIGN      0x20
206

  
207
!define /ifndef LR_DEFAULTCOLOR     0x0000
208
!define /ifndef LR_MONOCHROME       0x0001
209
!define /ifndef LR_COLOR            0x0002
210
!define /ifndef LR_COPYRETURNORG    0x0004
211
!define /ifndef LR_COPYDELETEORG    0x0008
212
!define /ifndef LR_LOADFROMFILE     0x0010
213
!define /ifndef LR_LOADTRANSPARENT  0x0020
214
!define /ifndef LR_DEFAULTSIZE      0x0040
215
!define /ifndef LR_VGACOLOR         0x0080
216
!define /ifndef LR_LOADMAP3DCOLORS  0x1000
217
!define /ifndef LR_CREATEDIBSECTION 0x2000
218
!define /ifndef LR_COPYFROMRESOURCE 0x4000
219
!define /ifndef LR_SHARED           0x8000
220

  
221
!define /ifndef IMAGE_BITMAP        0
222
!define /ifndef IMAGE_ICON          1
223
!define /ifndef IMAGE_CURSOR        2
224
!define /ifndef IMAGE_ENHMETAFILE   3
225

  
226
!define /ifndef GWL_STYLE           -16
227
!define /ifndef GWL_EXSTYLE         -20
228

  
229
#define /ifndef ICC_LISTVIEW_CLASSES 0x0001 ; SysListView32 and SysHeader32
230
#define /ifndef ICC_TREEVIEW_CLASSES 0x0002 ; SysTabControl32 and tooltips_class32
231
#define /ifndef ICC_BAR_CLASSES      0x0004 ; ToolbarWindow32, msctls_statusbar32, msctls_trackbar32 and tooltips_class32
232
#define /ifndef ICC_TAB_CLASSES      0x0008 ; SysTabControl32 and tooltips_class32
233
#define /ifndef ICC_UPDOWN_CLASS     0x0010 ; msctls_updown32
234
#define /ifndef ICC_PROGRESS_CLASS   0x0020 ; msctls_progress32
235
#define /ifndef ICC_HOTKEY_CLASS     0x0040 ; msctls_hotkey32
236
#define /ifndef ICC_ANIMATE_CLASS    0x0080 ; SysAnimate32
237
#define /ifndef ICC_WIN95_CLASSES    0x00FF
238
!define /ifndef ICC_DATE_CLASSES     0x0100 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) SysDateTimePick32, SysMonthCal32 and CC6.10+(Vista+) DropDown
239
!define /ifndef ICC_USEREX_CLASSES   0x0200 ; CC4.??+ (NT4+/IE3.?+/Win95 OSR2) ComboBoxEx32
240
!define /ifndef ICC_COOL_CLASSES     0x0400 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) ReBarWindow32
241
!define /ifndef ICC_INTERNET_CLASSES 0x0800 ; CC4.71+ (IE4+) SysIPAddress32
242
!define /ifndef ICC_PAGESCROLLER_CLASS 0x1000 ; CC4.71+ (IE4+) SysPager
243
!define /ifndef ICC_NATIVEFNTCTL_CLASS 0x2000 ; CC4.71+ (IE4+) NativeFontCtl
244
!define /ifndef ICC_STANDARD_CLASSES 0x4000 ; WinXP+ Button, Static, Edit, ListBox, ComboBox, ComboLBox, ScrollBar and ReaderModeCtl
245
!define /ifndef ICC_LINK_CLASS       0x8000 ; WinXP+ SysLink
246

  
247

  
177 248
!define DEFAULT_STYLES ${WS_CHILD}|${WS_VISIBLE}|${WS_CLIPSIBLINGS}
178 249

  
179 250
!define __NSD_HLine_CLASS STATIC
......
224 295
!define __NSD_Text_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
225 296
!define __NSD_Text_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
226 297

  
298
!define __NSD_MLText_CLASS EDIT
299
!define __NSD_MLText_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${WS_HSCROLL}|${WS_VSCROLL}
300
!define __NSD_MLText_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
301

  
227 302
!define __NSD_Password_CLASS EDIT
228 303
!define __NSD_Password_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_PASSWORD}
229 304
!define __NSD_Password_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
......
240 315
!define __NSD_DirRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}
241 316
!define __NSD_DirRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
242 317

  
318
!define __NSD_RichEdit_CLASS_10  "RICHEDIT"    ; 1.0 (Riched32.dll) Win95/NT4
319
!define __NSD_RichEdit_CLASS_20A "RICHEDIT20A" ; 2.0 (Riched20.dll) Win98/NT4 (NSIS makes sure this is registered even on Windows 95)
320
!define __NSD_RichEdit_CLASS_20W "RICHEDIT20W"
321
!define __NSD_RichEdit_CLASS_41W "RICHEDIT50W" ; 4.1 (MsftEdit.DLL) WinXP.SP1
322
!ifdef NSIS_UNICODE
323
!define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20W}
324
!else
325
!define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20A}
326
!endif
327
!define __NSD_RichEdit_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${ES_SAVESEL}|${WS_HSCROLL}|${WS_VSCROLL}
328
!define __NSD_RichEdit_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
329

  
243 330
!define __NSD_ComboBox_CLASS COMBOBOX
244 331
!define __NSD_ComboBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWN}
245 332
!define __NSD_ComboBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
......
252 339
!define __NSD_ListBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}
253 340
!define __NSD_ListBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
254 341

  
342
!define __NSD_SortedListBox_CLASS LISTBOX
343
!define __NSD_SortedListBox_STYLE ${__NSD_ListBox_STYLE}|${LBS_SORT}
344
!define __NSD_SortedListBox_EXSTYLE ${__NSD_ListBox_EXSTYLE}
345

  
255 346
!define __NSD_ProgressBar_CLASS msctls_progress32
256 347
!define __NSD_ProgressBar_STYLE ${DEFAULT_STYLES}
257 348
!define __NSD_ProgressBar_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
258 349

  
350
!define __NSD_Animation_CLASS SysAnimate32
351
!define __NSD_Animation_STYLE ${DEFAULT_STYLES}|${ACS_TRANSPARENT}|${ACS_AUTOPLAY}
352
!define __NSD_Animation_EXSTYLE 0
353

  
354
!define __NSD_HTrackBar_CLASS msctls_trackbar32
355
!define __NSD_HTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_HORZ}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}
356
!define __NSD_HTrackBar_EXSTYLE 0
357

  
358
!define __NSD_VTrackBar_CLASS msctls_trackbar32
359
!define __NSD_VTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_VERT}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}
360
!define __NSD_VTrackBar_EXSTYLE 0
361

  
362
!define __NSD_UpDown_CLASS msctls_updown32
363
!define __NSD_UpDown_STYLE ${DEFAULT_STYLES}|${UDS_SETBUDDYINT}|${UDS_ARROWKEYS}|${UDS_NOTHOUSANDS}|${UDS_ALIGNRIGHT}
364
!define __NSD_UpDown_EXSTYLE 0
365

  
366
!define __NSD_AutoUpDown_CLASS msctls_updown32
367
!define __NSD_AutoUpDown_STYLE ${__NSD_UpDown_STYLE}|${UDS_AUTOBUDDY}
368
!define __NSD_AutoUpDown_EXSTYLE ${__NSD_UpDown_EXSTYLE}
369

  
370
!define __NSD_HotKey_CLASS msctls_hotkey32
371
!define __NSD_HotKey_STYLE ${DEFAULT_STYLES}
372
!define __NSD_HotKey_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
373

  
374
!define __NSD_Calendar_CLASS SysMonthCal32
375
!define __NSD_Calendar_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
376
!define __NSD_Calendar_EXSTYLE 0
377

  
378
!define __NSD_DatePicker_CLASS SysDateTimePick32
379
!define __NSD_DatePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
380
!define __NSD_DatePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
381

  
382
!define __NSD_TimePicker_CLASS SysDateTimePick32
383
!define __NSD_TimePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${DTS_TIMEFORMAT}
384
!define __NSD_TimePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
385

  
386
!define __NSD_IPAddress_CLASS SysIPAddress32 ; IE4+/CC4.71+
387
!define __NSD_IPAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
388
!define __NSD_IPAddress_EXSTYLE 0
389

  
390
!define __NSD_NetAddress_CLASS msctls_netaddress ; Vista+
391
!define __NSD_NetAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}
392
!define __NSD_NetAddress_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
393

  
394

  
259 395
!macro __NSD_DefineControl NAME
260

  
261 396
	!define NSD_Create${NAME} "nsDialogs::CreateControl ${__NSD_${Name}_CLASS} ${__NSD_${Name}_STYLE} ${__NSD_${Name}_EXSTYLE}"
262

  
263 397
!macroend
264

  
265 398
!insertmacro __NSD_DefineControl HLine
266 399
!insertmacro __NSD_DefineControl VLine
267 400
!insertmacro __NSD_DefineControl Label
......
274 407
!insertmacro __NSD_DefineControl CheckBox
275 408
!insertmacro __NSD_DefineControl RadioButton
276 409
!insertmacro __NSD_DefineControl Text
410
!insertmacro __NSD_DefineControl MLText
277 411
!insertmacro __NSD_DefineControl Password
278 412
!insertmacro __NSD_DefineControl Number
279 413
!insertmacro __NSD_DefineControl FileRequest
280 414
!insertmacro __NSD_DefineControl DirRequest
415
!insertmacro __NSD_DefineControl RichEdit
281 416
!insertmacro __NSD_DefineControl ComboBox
282 417
!insertmacro __NSD_DefineControl DropList
283 418
!insertmacro __NSD_DefineControl ListBox
419
!insertmacro __NSD_DefineControl SortedListBox
284 420
!insertmacro __NSD_DefineControl ProgressBar
421
!insertmacro __NSD_DefineControl Animation
422
!insertmacro __NSD_DefineControl HTrackBar
423
!insertmacro __NSD_DefineControl VTrackBar
424
!insertmacro __NSD_DefineControl UpDown
425
!insertmacro __NSD_DefineControl AutoUpDown
426
!insertmacro __NSD_DefineControl HotKey
427
!insertmacro __NSD_DefineControl Calendar
428
!insertmacro __NSD_DefineControl DatePicker
429
!insertmacro __NSD_DefineControl TimePicker
430
!insertmacro __NSD_DefineControl IPAddress
431
!insertmacro __NSD_DefineControl NetAddress
285 432

  
433

  
286 434
!macro __NSD_OnControlEvent EVENT HWND FUNCTION
287

  
288 435
	Push $0
289 436
	Push $1
290 437

  
......
295 442

  
296 443
	Pop $1
297 444
	Pop $0
298

  
299 445
!macroend
300 446

  
301 447
!macro __NSD_DefineControlCallback EVENT
302

  
303
	!define NSD_On${EVENT} `!insertmacro __NSD_OnControlEvent ${EVENT}`
304

  
448
	!define NSD_On${EVENT} `!insertmacro __NSD_OnControlEvent ${EVENT} `
305 449
!macroend
306 450

  
307 451
!macro __NSD_OnDialogEvent EVENT FUNCTION
308

  
309 452
	Push $0
310 453

  
311 454
	GetFunctionAddress $0 "${FUNCTION}"
312 455
	nsDialogs::On${EVENT} $0
313 456

  
314 457
	Pop $0
315

  
316 458
!macroend
317 459

  
318 460
!macro __NSD_DefineDialogCallback EVENT
319

  
320
	!define NSD_On${EVENT} `!insertmacro __NSD_OnDialogEvent ${EVENT}`
321

  
461
	!define NSD_On${EVENT} `!insertmacro __NSD_OnDialogEvent ${EVENT} `
322 462
!macroend
323

  
324 463
!insertmacro __NSD_DefineControlCallback Click
325 464
!insertmacro __NSD_DefineControlCallback Change
326 465
!insertmacro __NSD_DefineControlCallback Notify
327 466
!insertmacro __NSD_DefineDialogCallback Back
328 467

  
468
!define NSD_Return "!insertmacro NSD_Return "
469
!macro NSD_Return val
470
StrCpy $_OUTDIR ${val}
471
SetSilent silent
472
Return
473
!macroend
474

  
475

  
476
!define __NSD_MkCtlCmd "!insertmacro __NSD_MkCtlCmd "
477
!macro __NSD_MkCtlCmd msg wp lp hCtl
478
SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
479
!macroend
480
!define __NSD_MkCtlCmd_WP "!insertmacro __NSD_MkCtlCmd_WP "
481
!macro __NSD_MkCtlCmd_WP msg lp hCtl wp
482
SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
483
!macroend
484
!define __NSD_MkCtlCmd_LP "!insertmacro __NSD_MkCtlCmd_LP "
485
!macro __NSD_MkCtlCmd_LP msg wp hCtl lp
486
SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
487
!macroend
488
!define __NSD_MkCtlCmd_WPLP "!insertmacro __NSD_MkCtlCmd_WPLP "
489
!macro __NSD_MkCtlCmd_WPLP msg hCtl wp lp
490
SendMessage ${hCtl} ${${msg}} ${wp} ${lp}
491
!macroend
492
!define __NSD_MkCtlCmd_RV "!insertmacro __NSD_MkCtlCmd_RV "
493
!macro __NSD_MkCtlCmd_RV msg wp lp hCtl VAR
494
SendMessage ${hCtl} ${${msg}} ${wp} ${lp} ${VAR}
495
!macroend
496

  
497

  
498
!define NSD_InitCommonControlsEx "!insertmacro __NSD_InitCommonControlsEx "
499
!macro __NSD_InitCommonControlsEx ICC
500
!pragma warning push
501
!pragma warning disable 7070 ; Invalid number
502
!if ${ICC} <> 0
503
!define /ReDef /IntFmt NSD_InitCommonControlsEx_TEMP "0x%X" ${ICC}
504
System::Call 'COMCTL32::InitCommonControlsEx(*l${NSD_InitCommonControlsEx_TEMP}00000008)'
505
!undef NSD_InitCommonControlsEx_TEMP
506
!else
507
System::Int64Op ${ICC} << 32
508
System::Int64Op 8 | 
509
System::Call 'COMCTL32::InitCommonControlsEx(*ls)' ; INITCOMMONCONTROLSEX as UINT64
510
!endif
511
!pragma warning pop
512
!macroend
513
!define NSD_InitCommonControl_IPAddress `${NSD_InitCommonControlsEx} ${ICC_INTERNET_CLASSES}`
514
!define NSD_InitCommonControl_NetAddress `System::Call SHELL32::InitNetworkAddressControl()i`
515
!define NSD_InitCommonControl_SysLink `${NSD_InitCommonControlsEx} ${ICC_LINK_CLASS}`
516

  
517

  
518
!define NSD_CreateTimer `!insertmacro _NSD_CreateTimer `
329 519
!macro _NSD_CreateTimer FUNCTION INTERVAL
330

  
331 520
	Push $0
332 521

  
333 522
	GetFunctionAddress $0 "${FUNCTION}"
334 523
	nsDialogs::CreateTimer $0 "${INTERVAL}"
335 524

  
336 525
	Pop $0
337

  
338 526
!macroend
339 527

  
340
!define NSD_CreateTimer `!insertmacro _NSD_CreateTimer`
341 528

  
529
!define NSD_KillTimer `!insertmacro _NSD_KillTimer `
342 530
!macro _NSD_KillTimer FUNCTION
343

  
344 531
	Push $0
345 532

  
346 533
	GetFunctionAddress $0 "${FUNCTION}"
347 534
	nsDialogs::KillTimer $0
348 535

  
349 536
	Pop $0
537
!macroend
350 538

  
539

  
540
!define NSD_AddStyle "!insertmacro _NSD_GWLAddFlags ${GWL_STYLE} "
541
!define NSD_AddExStyle "!insertmacro _NSD_GWLAddFlags ${GWL_EXSTYLE} "
542
!macro _NSD_GWLAddFlags GWL HWND DATA
543
	System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
544
	System::Int64Op "${DATA}" |
545
	System::Call "user32::SetWindowLong(p${HWND},p${GWL},ps)"
351 546
!macroend
352 547

  
353
!define NSD_KillTimer `!insertmacro _NSD_KillTimer`
548
!define NSD_RemoveStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_STYLE} " 
549
!define NSD_RemoveExStyle "!insertmacro _NSD_GWLRemoveFlags ${GWL_EXSTYLE} "
550
!macro _NSD_GWLRemoveFlags GWL HWND DATA
551
System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
552
System::Int64Op "${DATA}" ~ & ; Perform ~ and prepare the stack for &
553
System::Int64Op ; Perform &
554
System::Call "user32::SetWindowLong(p${HWND},i${GWL},ps)"
555
!macroend 
354 556

  
355
!macro _NSD_AddStyle CONTROL STYLE
557
!define NSD_GetStyle "!insertmacro _NSD_GWLGetFlags ${GWL_STYLE} "
558
!define NSD_GetExStyle "!insertmacro _NSD_GWLGetFlags ${GWL_EXSTYLE} "
559
!macro _NSD_GWLGetFlags GWL HWND RET
560
System::Call "user32::GetWindowLong(p${HWND},i${GWL})p.s"
561
Pop ${RET}
562
!macroend
356 563

  
357
	Push $0
564
!macro __NSD_GetStyleBit GWL BIT HWND RET
565
!insertmacro _NSD_GWLGetFlags ${GWL} ${HWND} ${RET}
566
IntOp ${RET} ${RET} & ${BIT}
567
!macroend
358 568

  
359
	System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_STYLE}) i .r0"
360
	System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_STYLE}, i $0|${STYLE})"
361 569

  
362
	Pop $0
570
!define NSD_SetFocus `!insertmacro __NSD_SetFocus `
571
!macro __NSD_SetFocus HWND
572
	System::Call "user32::SetFocus(p${HWND})"
573
!macroend
363 574

  
575

  
576
!define NSD_GetText "!insertmacro __NSD_GetText "
577
!macro __NSD_GetText CONTROL VAR
578
	System::Call user32::GetWindowText(p${CONTROL},t.s,i${NSIS_MAX_STRLEN})
579
	Pop ${VAR}
364 580
!macroend
365 581

  
366
!define NSD_AddStyle "!insertmacro _NSD_AddStyle"
367 582

  
368
!macro _NSD_AddExStyle CONTROL EXSTYLE
583
!define NSD_SetText "!insertmacro __NSD_SetText "
584
!macro __NSD_SetText CONTROL TEXT
585
	SendMessage ${CONTROL} ${WM_SETTEXT} 0 `STR:${TEXT}`
586
!macroend
369 587

  
370
	Push $0
371 588

  
372
	System::Call "user32::GetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}) i .r0"
373
	System::Call "user32::SetWindowLong(i ${CONTROL}, i ${GWL_EXSTYLE}, i $0|${EXSTYLE})"
589
### Edit ###
374 590

  
375
	Pop $0
591
!define NSD_Edit_GetTextLimit `${__NSD_MkCtlCmd_RV} EM_GETLIMITTEXT 0 0 `
592
!define NSD_Edit_SetTextLimit `${__NSD_MkCtlCmd_WP} EM_SETLIMITTEXT 0 `
593
!define NSD_Edit_SetPasswordChar `${__NSD_MkCtlCmd_WP} EM_SETPASSWORDCHAR 0 `
594
!define NSD_Edit_GetReadOnly `!insertmacro __NSD_GetStyleBit ${GWL_STYLE} ${ES_READONLY} ` ; Non-zero if read-only
595
!define NSD_Edit_SetReadOnly `${__NSD_MkCtlCmd_WP} EM_SETREADONLY 0 ` ; Toggles the ES_READONLY style
596
!define NSD_Edit_GetModify `${__NSD_MkCtlCmd_RV} EM_GETMODIFY 0 0 `
597
!define NSD_Edit_SetModify `${__NSD_MkCtlCmd_WP} EM_SETMODIFY 0 `
598
!define NSD_Edit_EmptyUndoBuffer `${__NSD_MkCtlCmd} EM_EMPTYUNDOBUFFER 0 0 `
599
!define NSD_Edit_CanUndo `${__NSD_MkCtlCmd_RV} EM_CANUNDO 0 0 `
600
!define NSD_Edit_ScrollCaret `${__NSD_MkCtlCmd} EM_SCROLLCARET 0 0 `
601
!define NSD_Edit_LineScroll `${__NSD_MkCtlCmd_WPLP} EM_LINESCROLL `
602
!define NSD_Edit_SetSel `${__NSD_MkCtlCmd_WPLP} EM_SETSEL ` ; WP:Start LP:End
376 603

  
604
!define NSD_Edit_SetCueBannerText "!insertmacro __NSD_Edit_SetCueBannerText " ; CC6+
605
!macro __NSD_Edit_SetCueBannerText CONTROL SHOWWHENFOCUSED TEXT
606
!if ${NSIS_CHAR_SIZE} > 1
607
	SendMessage ${CONTROL} ${EM_SETCUEBANNER} ${SHOWWHENFOCUSED} `STR:${TEXT}`
608
!else
609
	System::Call 'USER32::SendMessage(p${CONTROL},i${EM_SETCUEBANNER},p${SHOWWHENFOCUSED},ws)' `${TEXT}` ; Must be PWSTR
610
!endif
377 611
!macroend
378 612

  
379
!define NSD_AddExStyle "!insertmacro _NSD_AddExStyle"
613
!define NSD_Edit_GetLineCount `${__NSD_MkCtlCmd_RV} EM_GETLINECOUNT 0 0 `
614
!define NSD_Edit_GetLine "!insertmacro __NSD_Edit_GetLine "
615
!macro __NSD_Edit_GetLine CONTROL LINEINDEX OUTPUT
616
	System::Call '*(&i2 ${NSIS_MAX_STRLEN},&t${NSIS_MAX_STRLEN})p.s'
617
	System::Call 'USER32::SendMessage(p${CONTROL},i${EM_GETLINE},p${LINEINDEX},pss)'
618
	System::Call 'KERNEL32::lstrcpyn(t.s,pss,i${NSIS_MAX_STRLEN})'
619
	Pop ${OUTPUT}
620
	System::Free
621
!macroend
380 622

  
381
!macro __NSD_GetText CONTROL VAR
623
!define NSD_SetTextLimit `${NSD_Edit_SetTextLimit} ` ; Legacy alias
382 624

  
383
	System::Call user32::GetWindowText(i${CONTROL},t.s,i${NSIS_MAX_STRLEN})
384
	Pop ${VAR}
385 625

  
386
!macroend
626
### RichEdit ###
387 627

  
388
!define NSD_GetText `!insertmacro __NSD_GetText`
628
!define NSD_RichEd_SetTextLimit `${__NSD_MkCtlCmd_LP} EM_EXLIMITTEXT 0 `
629
!define NSD_RichEd_GetEventMask `${__NSD_MkCtlCmd_RV} EM_GETEVENTMASK 0 0 `
630
!define NSD_RichEd_SetEventMask `${__NSD_MkCtlCmd_LP} EM_SETEVENTMASK 0 ` ; LP:ENM_*
631
!define NSD_RichEd_SetSystemBackgroundColor `${__NSD_MkCtlCmd} EM_SETBKGNDCOLOR 1 0 ` ; COLOR_WINDOW
632
!define NSD_RichEd_SetCustomBackgroundColor `${__NSD_MkCtlCmd_LP} EM_SETBKGNDCOLOR 0 ` ; LP:COLORREF
633
!define NSD_RichEd_SetHideSelection `${__NSD_MkCtlCmd_WP} EM_HIDESELECTION 0 ` ; WP(BOOL):HideSelWithoutFocus (Toggles ES_NOHIDESEL & TXTBIT_HIDESELECTION)
389 634

  
390
!macro __NSD_SetText CONTROL TEXT
391 635

  
392
	SendMessage ${CONTROL} ${WM_SETTEXT} 0 `STR:${TEXT}`
636
### CheckBox ###
393 637

  
638
!define NSD_GetState `!insertmacro __NSD_GetState `
639
!macro __NSD_GetState CONTROL VAR
640
	SendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}
394 641
!macroend
395 642

  
396
!define NSD_SetText `!insertmacro __NSD_SetText`
397 643

  
398
!macro _NSD_SetTextLimit CONTROL LIMIT
644
!define NSD_SetState `!insertmacro __NSD_SetState `
645
!macro __NSD_SetState CONTROL STATE
646
	SendMessage ${CONTROL} ${BM_SETCHECK} ${STATE} 0
647
!macroend
399 648

  
400
	SendMessage ${CONTROL} ${EM_SETLIMITTEXT} ${LIMIT} 0
649
!define NSD_Check `!insertmacro __NSD_Check `
650
!macro __NSD_Check CONTROL
651
	${NSD_SetState} ${CONTROL} ${BST_CHECKED}
652
!macroend
401 653

  
654

  
655
!define NSD_Uncheck `!insertmacro __NSD_Uncheck `
656
!macro __NSD_Uncheck CONTROL
657
	${NSD_SetState} ${CONTROL} ${BST_UNCHECKED}
402 658
!macroend
403 659

  
404
!define NSD_SetTextLimit "!insertmacro _NSD_SetTextLimit"
660
!define NSD_GetChecked `!insertmacro __NSD_GetState `
661
!define NSD_SetChecked `!insertmacro __NSD_SetState `
405 662

  
406
!macro __NSD_GetState CONTROL VAR
407 663

  
408
	SendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}
664
### ComboBox ###
409 665

  
666
!define NSD_CB_AddString "!insertmacro _NSD_CB_AddString "
667
!macro _NSD_CB_AddString CONTROL STRING
668
	SendMessage ${CONTROL} ${CB_ADDSTRING} 0 `STR:${STRING}`
410 669
!macroend
411 670

  
412
!define NSD_GetState `!insertmacro __NSD_GetState`
413 671

  
414
!macro __NSD_SetState CONTROL STATE
672
!define NSD_CB_InsertString "!insertmacro _NSD_CB_InsertString "
673
!macro _NSD_CB_InsertString CONTROL INDEX STRING
674
SendMessage ${CONTROL} ${CB_INSERTSTRING} ${INDEX} `STR:${STRING}`
675
!macroend
415 676

  
416
	SendMessage ${CONTROL} ${BM_SETCHECK} ${STATE} 0
677
!define NSD_CB_PrependString "!insertmacro _NSD_CB_PrependString "
678
!macro _NSD_CB_PrependString CONTROL STRING
679
SendMessage ${CONTROL} ${CB_INSERTSTRING} 0 `STR:${STRING}`
680
!macroend
417 681

  
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff