Source

nsis64 / SCons / config.py

Full commit
  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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
Import('defenv')

### Configuration options

cfg = Variables()

cfg.Add(
  (
    'NSIS_MAX_STRLEN',
    'defines the maximum string length for internal variables and stack entries. 1024 should be plenty, but if you are doing crazy registry stuff, you might want to bump it up. Generally it adds about 16-32x the memory, so setting this to 4096 from 1024 will add around 64k of memory usage (not really a big deal, but not usually needed).',
    1024
  )
)

cfg.Add(
  (
    'NSIS_MAX_INST_TYPES',
    'defines the maximum install types. Note that this should not exceed 32, ever.',
    32
  )
)

cfg.Add(
  (
    'NSIS_DEFAULT_LANG',
    'defines the default language id NSIS will use if nothing else is defined in the script. Default value is 1033 which is English.',
    1033
  )
)

cfg.Add(
  (
    'NSIS_VARS_SECTION',
    'defines the name of the PE section containing the runtime variables',
    '.ndata'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_UNINSTALL_SUPPORT',
    "enables the uninstaller support. Turn it off if your installers don't need uninstallers. Adds less than 1kb.",
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_LICENSEPAGE',
    'enables support for the installer to present a license page.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_COMPONENTPAGE',
    'enables support for the installer to present a page where you can select what sections are installed. with this disabled, all sections are installed by default',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE',
    'enables an alternative components page behavior. Checkboxes will only be toggled when clicking on the checkbox itself and not on its label. .onMouseOverSection will only be called when the user selects the component and not when moving the mouse pointer over it.',
    'no'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_SILENT_SUPPORT',
    'enables support for making installers that are completely silent.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_VISIBLE_SUPPORT',
    'enables support for making installers that are visible.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_ENHANCEDUI_SUPPORT',
    'enables support for CreateFont, SetCtlColors (used by some UIs), SetBrandingImage, .onGUIInit, etc.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_COMPRESSION_SUPPORT',
    'enables support for making installers that use compression (recommended).',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_COMPRESS_BZIP2_SMALLMODE',
    "if defined, bzip2's decompressor uses bzip2's alternative decompression method that uses less runtime memory, at the expense of speed (and executable size). not recommended.",
    'no'
  )
)

cfg.Add(
  (
    'NSIS_COMPRESS_BZIP2_LEVEL',
    'bzip2 compression window size. 1-9 is valid. 9 uses the most memory, but typically compresses best (recommended). 1 uses the least memory, but typically compresses the worst.',
    9
  )
)


cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_CRC_SUPPORT',
    'enables support for installer verification. HIGHLY recommended.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_CRC_ANAL',
    'makes the CRC verification extremely careful, meaning extra bytes on the end of file, or the first 512 bytes changing, will give error. Enable this if you are paranoid, otherwise leaving it off seems safe (and is less prone to reporting virii). If you will be digitally signing your installers, leave this off.',
    'no'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_LOG',
    'enables the logging facility. turning this on (by uncommenting it) adds about 4kb, but can be useful in debugging your installers.',
    'no'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_LOG_ODS',
    'makes the logging facility use OutputDebugString instead of a file.',
    'no'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_LOG_STDOUT',
    'makes the logging facility use stdout instead of a file.',
    'no'
  )
)

cfg.Add(
	BoolVariable(
		'NSIS_CONFIG_LOG_TIMESTAMP',
		'adds a timestamp to each log line.',
		'no'
	)
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_BGBG',
    'enables support for the blue (well, whatever color you want) gradient background window.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_CODECALLBACKS',
    'enables support for installer code callbacks. recommended, as it uses a minimum of space and allows for neat functionality.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_MOVEONREBOOT',
    'enables support for uninstallers that automatically delete themselves from the temp directory, as well as the reboot moving/deleting modes of Delete and Rename. Adds about 512 gay bytes..',
    'yes'
  )
)

### Instruction enabling configuration

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_ACTIVEXREG',
    'enables activeX plug-in registration and deregistration, as well as CallInstDLL',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_INTOPTS',
    'enables support for IntCmp, IntCmpU, IntOp, and IntFmt.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_STROPTS',
    'enables support for StrCmp, StrCpy, and StrLen, as well as Get*Local.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_STACK',
    'enables support for the stack (Push, Pop, Exch)',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_FILEFUNCTIONS',
    'enables support for FileOpen,FileClose, FileSeek, FileRead, and FileWrite.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_FINDFIRST',
    'enables support for FindFirst, FindNext, and FindClose.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_CREATESHORTCUT',
    'enables support for CreateShortCut.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_INIFILES',
    'enables support for ReadINIStr and WriteINIStr.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_REGISTRYFUNCTIONS',
    'enables support for ReadRegStr, ReadRegDWORD, WriteRegStr, etc etc etc.',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_COPYFILES',
    'enables support for CopyFiles',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_REBOOT',
    'enables support for Reboot, IfRebootFlag, SetRebootFlag',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_FNUTIL',
    'enables support for GetFullPathName, GetTempFileName, and SearchPath',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_EXECUTE',
    'enables support for Exec and ExecWait',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_SHELLEXECUTE',
    'enables support for ExecShell',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_GETDLLVERSION',
    'enables support for GetDLLVersion',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_GETFILETIME',
    'enables support for GetFileTime',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_HWNDS',
    'enables support for FindWindow, SendMessage, and IsWindow',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_ENVIRONMENT',
    'enables support for ReadEnvStr and ExpandEnvStrings',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_RMDIR',
    'enables support for RMDir',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_FILE',
    'enables support for File (extracting files)',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_DELETE',
    'enables support for Delete (delete files)',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_RENAME',
    'enables support for Rename (rename files)',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_MESSAGEBOX',
    'enables support for MessageBox',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_VERSION_INFO',
    'enables support for version information in the installer',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_FIX_DEFINES_IN_STRINGS',
    'fixes defines inside defines and handles chars $ perfectly',
    'no'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_SUPPORT_STANDARD_PREDEFINES',
    'enables standard predefines - __FILE__, __LINE__, __DATE__, __TIME__ and __TIMESTAMP__',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_LOCKWINDOW_SUPPORT',
    'enables the LockWindow command',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_PLUGIN_SUPPORT',
    'enables installer plug-ins support',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_FIX_COMMENT_HANDLING',
    'fixes comment handling',
    'yes'
  )
)

cfg.Add(
  BoolVariable(
    'NSIS_CONFIG_CONST_DATA_PATH',
    'determines if plugins, includes, stubs etc. are located in a constant path set at build-time',
    defenv['PLATFORM'] != 'win32'
  )
)

### Generate help

Help(cfg.GenerateHelpText(defenv))

### Apply configuration

env = Environment()
cfg.Update(env)

def AddValuedDefine(define):
  defenv.Append(NSIS_CPPDEFINES = [(define, env[define])])

def AddBoolDefine(define):
  if env[define]:
    defenv.Append(NSIS_CPPDEFINES = [define])

def AddStringDefine(define):
  defenv.Append(NSIS_CPPDEFINES = [(define, '"%s"' % env[define])])

AddValuedDefine('NSIS_MAX_STRLEN')
AddValuedDefine('NSIS_MAX_INST_TYPES')
AddValuedDefine('NSIS_DEFAULT_LANG')

AddBoolDefine('NSIS_CONFIG_UNINSTALL_SUPPORT')
AddBoolDefine('NSIS_CONFIG_LICENSEPAGE')
AddBoolDefine('NSIS_CONFIG_COMPONENTPAGE')
AddBoolDefine('NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE')
AddBoolDefine('NSIS_CONFIG_SILENT_SUPPORT')
AddBoolDefine('NSIS_CONFIG_VISIBLE_SUPPORT')
AddBoolDefine('NSIS_CONFIG_ENHANCEDUI_SUPPORT')
AddBoolDefine('NSIS_CONFIG_COMPRESSION_SUPPORT')
AddBoolDefine('NSIS_COMPRESS_BZIP2_SMALLMODE')

AddValuedDefine('NSIS_COMPRESS_BZIP2_LEVEL')

AddBoolDefine('NSIS_CONFIG_CRC_SUPPORT')
AddBoolDefine('NSIS_CONFIG_CRC_ANAL')
AddBoolDefine('NSIS_CONFIG_LOG')
AddBoolDefine('NSIS_CONFIG_LOG_ODS')
AddBoolDefine('NSIS_CONFIG_LOG_STDOUT')
AddBoolDefine('NSIS_CONFIG_LOG_TIMESTAMP')
AddBoolDefine('NSIS_SUPPORT_BGBG')
AddBoolDefine('NSIS_SUPPORT_CODECALLBACKS')
AddBoolDefine('NSIS_SUPPORT_MOVEONREBOOT')
AddBoolDefine('NSIS_SUPPORT_ACTIVEXREG')
AddBoolDefine('NSIS_SUPPORT_INTOPTS')
AddBoolDefine('NSIS_SUPPORT_STROPTS')
AddBoolDefine('NSIS_SUPPORT_STACK')
AddBoolDefine('NSIS_SUPPORT_FILEFUNCTIONS')
AddBoolDefine('NSIS_SUPPORT_FINDFIRST')
AddBoolDefine('NSIS_SUPPORT_CREATESHORTCUT')
AddBoolDefine('NSIS_SUPPORT_INIFILES')
AddBoolDefine('NSIS_SUPPORT_REGISTRYFUNCTIONS')
AddBoolDefine('NSIS_SUPPORT_COPYFILES')
AddBoolDefine('NSIS_SUPPORT_REBOOT')
AddBoolDefine('NSIS_SUPPORT_FNUTIL')
AddBoolDefine('NSIS_SUPPORT_EXECUTE')
AddBoolDefine('NSIS_SUPPORT_SHELLEXECUTE')
AddBoolDefine('NSIS_SUPPORT_GETDLLVERSION')
AddBoolDefine('NSIS_SUPPORT_GETFILETIME')
AddBoolDefine('NSIS_SUPPORT_HWNDS')
AddBoolDefine('NSIS_SUPPORT_ENVIRONMENT')
AddBoolDefine('NSIS_SUPPORT_RMDIR')
AddBoolDefine('NSIS_SUPPORT_FILE')
AddBoolDefine('NSIS_SUPPORT_DELETE')
AddBoolDefine('NSIS_SUPPORT_RENAME')
AddBoolDefine('NSIS_SUPPORT_MESSAGEBOX')
AddBoolDefine('NSIS_SUPPORT_VERSION_INFO')
AddBoolDefine('NSIS_FIX_DEFINES_IN_STRINGS')
AddBoolDefine('NSIS_SUPPORT_STANDARD_PREDEFINES')
AddBoolDefine('NSIS_LOCKWINDOW_SUPPORT')
AddBoolDefine('NSIS_CONFIG_PLUGIN_SUPPORT')
AddBoolDefine('NSIS_FIX_COMMENT_HANDLING')
AddBoolDefine('NSIS_CONFIG_CONST_DATA_PATH')

AddStringDefine('NSIS_VARS_SECTION')