Source

nsis64 / Examples / WordFuncTest.nsi

Full commit
gol...@212acab6-… 205abbe 
































































































































































































































































































































































































































































































































































































































  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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
;_____________________________________________________________________________
;
;                          Word Functions Test
;_____________________________________________________________________________
;
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)

Name "Word Functions Test"
OutFile "WordFuncTest.exe"
Caption "$(^Name)"
ShowInstDetails show
XPStyle on
RequestExecutionLevel user

Var FUNCTION
Var OUT

!include "WordFunc.nsh"

;############### INSTALL ###############

!define StackVerificationStart `!insertmacro StackVerificationStart`
!macro StackVerificationStart _FUNCTION
	StrCpy $FUNCTION ${_FUNCTION}
	Call StackVerificationStart
!macroend

!define StackVerificationEnd `!insertmacro StackVerificationEnd`
!macro StackVerificationEnd
	Call StackVerificationEnd
!macroend

Function StackVerificationStart
	StrCpy $0 !0
	StrCpy $1 !1
	StrCpy $2 !2
	StrCpy $3 !3
	StrCpy $4 !4
	StrCpy $5 !5
	StrCpy $6 !6
	StrCpy $7 !7
	StrCpy $8 !8
	StrCpy $9 !9
	StrCpy $R0 !R0
	StrCpy $R1 !R1
	StrCpy $R2 !R2
	StrCpy $R3 !R3
	StrCpy $R4 !R4
	StrCpy $R5 !R5
	StrCpy $R6 !R6
	StrCpy $R7 !R7
	StrCpy $R8 !R8
	StrCpy $R9 !R9
FunctionEnd

Function StackVerificationEnd
	IfErrors +3
	DetailPrint 'PASSED $FUNCTION no errors'
	goto +2
	DetailPrint 'FAILED   $FUNCTION error'

	StrCmp $0 '!0' 0 error
	StrCmp $1 '!1' 0 error
	StrCmp $2 '!2' 0 error
	StrCmp $3 '!3' 0 error
	StrCmp $4 '!4' 0 error
	StrCmp $5 '!5' 0 error
	StrCmp $6 '!6' 0 error
	StrCmp $7 '!7' 0 error
	StrCmp $8 '!8' 0 error
	StrCmp $9 '!9' 0 error
	StrCmp $R0 '!R0' 0 error
	StrCmp $R1 '!R1' 0 error
	StrCmp $R2 '!R2' 0 error
	StrCmp $R3 '!R3' 0 error
	StrCmp $R4 '!R4' 0 error
	StrCmp $R5 '!R5' 0 error
	StrCmp $R6 '!R6' 0 error
	StrCmp $R7 '!R7' 0 error
	StrCmp $R8 '!R8' 0 error
	StrCmp $R9 '!R9' 0 error
	DetailPrint 'PASSED $FUNCTION stack'
	goto end

	error:
	DetailPrint 'FAILED   $FUNCTION stack'
;	MessageBox MB_OKCANCEL '$$0={$0}$\n$$1={$1}$\n$$2={$2}$\n$$3={$3}$\n$$4={$4}$\n$$5={$5}$\n$$6={$6}$\n$$7={$7}$\n$$8={$8}$\n$$9={$9}$\n$$R0={$R0}$\n$$R1={$R1}$\n$$R2={$R2}$\n$$R3={$R3}$\n$$R4={$R4}$\n$$R5={$R5}$\n$$R6={$R6}$\n$$R7={$R7}$\n$$R8={$R8}$\n$$R9={$R9}' IDOK +2
;	quit

	end:
FunctionEnd



Section WordFind
	${StackVerificationStart} WordFind

	${WordFind} '||io.sys|||Program Files|||WINDOWS' '||' '-02' $OUT
	StrCmp $OUT '|Program Files' 0 error

	${WordFind} '||io.sys||||Program Files||||WINDOWS' '||' '-2' $OUT
	StrCmp $OUT 'Program Files' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '-2}' $OUT
	StrCmp $OUT '|logo.sys|||WINDOWS' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '#' $OUT
	StrCmp $OUT '3' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '*' $OUT
	StrCmp $OUT '2' 0 error

	${WordFind} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT
	StrCmp $OUT '2' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2}}' $OUT
	StrCmp $OUT '|||WINDOWS' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2{}' $OUT
	StrCmp $OUT 'C:\io.sys|||WINDOWS' 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||WINDOWS' '||' '+2*}' $OUT
	StrCmp $OUT '|logo.sys|||WINDOWS' 0 error

	${WordFind} 'C:\\Program Files\\NSIS\\NSIS.chm' '\' '-2{*' $OUT
	StrCmp $OUT 'C:\\Program Files\\NSIS' 0 error

	${WordFind} 'C:\io.sys|||Program Files|||WINDOWS|||' '||' '-1' $OUT
	StrCmp $OUT '|' 0 error

	${WordFind} '||C:\io.sys|||logo.sys|||WINDOWS||' '||' '-1}' $OUT
	StrCmp $OUT '' 0 error

	${WordFind} '||C:\io.sys|||logo.sys|||WINDOWS||' '||' '+1{' $OUT
	StrCmp $OUT '' 0 error

	${WordFind} 'C:\io.sys|||logo.sys' '_' 'E+1' $OUT
	IfErrors 0 error
	StrCmp $OUT 1 0 error

	${WordFind} 'C:\io.sys|||logo.sys|||' '\' 'E+3' $OUT
	IfErrors 0 error
	StrCmp $OUT 2 0 error

	${WordFind} 'C:\io.sys|||logo.sys' '\' 'E1' $OUT
	IfErrors 0 error
	StrCmp $OUT 3 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordFindS
	${StackVerificationStart} WordFindS

	${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|PROGRAM FILES' $OUT
	StrCmp $OUT 'C:\io.sys|||Program Files|||WINDOWS' 0 error

	${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT
	StrCmp $OUT '2' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordFind2X
	${StackVerificationStart} WordFind2X

	${WordFind2X} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
	StrCmp $OUT 'logo.sys' 0 error

	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1' $OUT
	StrCmp $OUT 'logo' 0 error

	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{{' $OUT
	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:' 0 error

	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{}' $OUT
	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:sys' 0 error

	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '-1{*' $OUT
	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:\logo.' 0 error

	${WordFind2X} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/logo' $OUT
	StrCmp $OUT '2' 0 error

	${WordFind2X} '||a||b||c' '||' '||' 'E+1' $OUT
	StrCmp $OUT 'a' 0 error

	${WordFind2X} '[io.sys];[C:\logo.sys]' '\' '];' 'E+1' $OUT
	IfErrors 0 error
	StrCmp $OUT 1 0 error

	${WordFind2X} '[io.sys];[C:\logo.sys]' '[' '];' 'E+2' $OUT
	IfErrors 0 error
	StrCmp $OUT 2 0 error

	${WordFind2X} '[io.sys];[C:\logo.sys]' '\' '];' 'E2' $OUT
	IfErrors 0 error
	StrCmp $OUT 3 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordFind2XS
	${StackVerificationStart} WordFind2XS

	${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/LOGO' $OUT
	StrCmp $OUT 'C:\WINDOWS C:\io.sys C:\logo.sys' 0 error

	${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/logo' $OUT
	StrCmp $OUT '2' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordFind3X
	${StackVerificationStart} WordFind3X

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
	StrCmp $OUT '1.AAB' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1' $OUT
	StrCmp $OUT '2.BAA' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{{' $OUT
	StrCmp $OUT '[1.AAB];' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{}' $OUT
	StrCmp $OUT '[1.AAB];[3.BBB];' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{*' $OUT
	StrCmp $OUT '[1.AAB];[2.BAA];' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT
	StrCmp $OUT '2' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'XX' '];' 'E+1' $OUT
	IfErrors 0 error
	StrCmp $OUT '1' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E+3' $OUT
	IfErrors 0 error
	StrCmp $OUT '2' 0 error

	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E3' $OUT
	IfErrors 0 error
	StrCmp $OUT '3' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordFind3XS
	${StackVerificationStart} WordFind3XS

	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.baa' $OUT
	StrCmp $OUT '[1.AAB];[2.BAA];[3.BBB];' 0 error

	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT
	StrCmp $OUT '2' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordReplace
	${StackVerificationStart} WordReplace

	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.bmp C:\WINDOWS' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' '' '+' $OUT
	StrCmp $OUT 'C:\io. C:\logo. C:\WINDOWS' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'C:\io.sys' '' '+' $OUT
	StrCmp $OUT ' C:\logo.sys C:\WINDOWS' 0 error

	${WordReplace} 'C:\io.sys      C:\logo.sys   C:\WINDOWS' ' ' ' ' '+1*' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys   C:\WINDOWS' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sysSYSsys C:\WINDOWS' 'sys' 'bmp' '+*' $OUT
	StrCmp $OUT 'C:\io.bmp C:\logo.bmp C:\WINDOWS' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{' $OUT
	StrCmp $OUT '||C:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '}' $OUT
	StrCmp $OUT 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWS|||' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}' $OUT
	StrCmp $OUT '||C:\io.sys C:\logo.sys C:\WINDOWS|||' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{*' $OUT
	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '}*' $OUT
	StrCmp $OUT 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWS|' 0 error

	${WordReplace} 'SYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT
	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWS|' 0 error

	${WordReplace} 'sysSYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT
	StrCmp $OUT '|C:\io.sys C:\logo.sys C:\WINDOWS|' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sys' '#sys' '|sys|' 'E+1' $OUT
	IfErrors 0 error
	StrCmp $OUT '1' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sys' '.sys' '|sys|' 'E+3' $OUT
	IfErrors 0 error
	StrCmp $OUT '2' 0 error

	${WordReplace} 'C:\io.sys C:\logo.sys' '.sys' '|sys|' 'E3' $OUT
	IfErrors 0 error
	StrCmp $OUT '3' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordReplaceS
	${StackVerificationStart} WordReplaceS

	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error

	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'sys' 'bmp' '+2' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.bmp C:\WINDOWS' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordAdd
	${StackVerificationStart} WordAdd

	${WordAdd} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error

	${WordAdd} 'C:\io.sys C:\logo.sys C:\WINDOWS' ' ' '-C:\WINDOWS C:\config.sys C:\IO.SYS' $OUT
	StrCmp $OUT 'C:\logo.sys' 0 error

	${WordAdd} 'C:\io.sys' ' ' '+C:\WINDOWS C:\config.sys C:\IO.SYS' $OUT
	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error

	${WordAdd} 'C:\io.sys C:\logo.sys C:\WINDOWS' ' ' '-C:\WINDOWS' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error

	${WordAdd} 'C:\io.sys C:\logo.sys' ' ' '+C:\logo.sys' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error

	${WordAdd} 'C:\io.sys C:\logo.sys' ' ' 'E-' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys' 0 error
	IfErrors error

	${WordAdd} 'C:\io.sys C:\logo.sys' '' 'E-C:\logo.sys' $OUT
	IfErrors 0 error
	StrCmp $OUT '1' 0 error

	${WordAdd} 'C:\io.sys C:\logo.sys' '' 'EC:\logo.sys' $OUT
	IfErrors 0 error
	StrCmp $OUT '3' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordAddS
	${StackVerificationStart} WordAddS

	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\windows C:\config.sys' $OUT
	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\windows C:\config.sys' 0 error

	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
	StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordInsert
	${StackVerificationStart} WordInsert

	${WordInsert} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
	StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error

	${WordInsert} 'C:\io.sys' ' ' 'C:\WINDOWS' '+2' $OUT
	StrCmp $OUT 'C:\io.sys C:\WINDOWS' 0 error

	${WordInsert} '' ' ' 'C:\WINDOWS' '+1' $OUT
	StrCmp $OUT 'C:\WINDOWS ' 0 error

	${WordInsert} 'C:\io.sys C:\logo.sys' '' 'C:\logo.sys' 'E+1' $OUT
	IfErrors 0 error
	StrCmp $OUT '1' 0 error

	${WordInsert} 'C:\io.sys C:\logo.sys' ' ' 'C:\logo.sys' 'E+4' $OUT
	IfErrors 0 error
	StrCmp $OUT '2' 0 error

	${WordInsert} 'C:\io.sys C:\logo.sys' '' 'C:\logo.sys' 'E1' $OUT
	IfErrors 0 error
	StrCmp $OUT '3' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WordInsertS
	${StackVerificationStart} WordInsertS

	${WordInsertS} 'C:\io.sys x C:\logo.sys' ' X ' 'C:\NTLDR' '+2' $OUT
	StrCmp $OUT 'C:\io.sys x C:\logo.sys X C:\NTLDR' 0 error

	${WordInsertS} 'C:\io.sys x C:\logo.sys' ' x ' 'C:\NTLDR' '+2' $OUT
	StrCmp $OUT 'C:\io.sys x C:\NTLDR x C:\logo.sys' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section StrFilter
	${StackVerificationStart} StrFilter

	${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
	IfErrors error
	StrCmp $OUT '123ABC 456DEF 7890|%#' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '-' 'ef' '' $OUT
	IfErrors error
	StrCmp $OUT '123abc 456dEF 7890|%#' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '2' '|%' '' $OUT
	IfErrors error
	StrCmp $OUT 'abcDEF|%' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT
	IfErrors error
	StrCmp $OUT '123a 6F 78|%#' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT
	IfErrors error
	StrCmp $OUT '123AbC4567890' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT
	IfErrors error
	StrCmp $OUT '123AbC4567890' 0 error

	${StrFilter} '123abc 456DEF 7890|%#' '123' 'b' 'def' $OUT
	IfErrors 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section StrFilterS
	${StackVerificationStart} StrFilterS

	${StrFilterS} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT
	IfErrors error
	StrCmp $OUT '123a 6 78|%#' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section VersionCompare
	${StackVerificationStart} VersionCompare

	${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
	StrCmp $OUT '1' 0 error

	${VersionCompare} '1.1.1.1' '1.1.1.10' $OUT
	StrCmp $OUT '2' 0 error

	${VersionCompare} '91.1.1.1' '101.1.1.9' $OUT
	StrCmp $OUT '2' 0 error

	${VersionCompare} '1.1.1.1' '1.1.1.1' $OUT
	StrCmp $OUT '0' 0 error

	${VersionCompare} '1.1.1.9' '1.1.1.10' $OUT
	StrCmp $OUT '2' 0 error

	${VersionCompare} '1.1.1.0' '1.1.1' $OUT
	StrCmp $OUT '0' 0 error

	${VersionCompare} '1.1.0.0' '1.1' $OUT
	StrCmp $OUT '0' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section VersionConvert
	${StackVerificationStart} VersionConvert

	${VersionConvert} '9.0a' '' $OUT
	StrCmp $OUT '9.0.01' 0 error

	${VersionConvert} '9.0c' '' $OUT
	StrCmp $OUT '9.0.03' 0 error

	${VersionConvert} '0.15c-9m' '' $OUT
	StrCmp $OUT '0.15.03.9.13' 0 error

	${VersionConvert} '0.15c+' 'abcdefghijklmnopqrstuvwxyz+' $OUT
	StrCmp $OUT '0.15.0327' 0 error

	${VersionConvert} '0.0xa12.x.ax|.|.|x|a|.3|a.4.||5.|' '' $OUT
	StrCmp $OUT '0.0.2401.12.24.0124.24.01.3.01.4.5' 0 error

	goto +2
	error:
	SetErrors

	${StackVerificationEnd}
SectionEnd


Section WriteUninstaller
	goto +2
	WriteUninstaller '$EXEDIR\un.WordFuncTest.exe'
SectionEnd



;############### UNINSTALL ###############

Section un.Uninstall
	${WordFind} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
	${WordFindS} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
	${WordFind2X} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
	${WordFind2XS} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
	${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
	${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
	${WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
	${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
	${WordAdd} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
	${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
	${WordInsert} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
	${WordInsertS} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
	${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
	${StrFilterS} '123abc 456DEF 7890|%#' '+' '' '' $OUT
	${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
	${VersionConvert} '9.0a' '' $OUT
SectionEnd