/usr/share/doc/nsis/Examples/rtest.nsi is in nsis-doc 2.51-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | ; rtest.nsi
;
; This script tests some advanced NSIS functions.
;--------------------------------
Name "rtest"
OutFile "rtest.exe"
ComponentText "Select tests!"
ShowInstDetails show
RequestExecutionLevel user
;--------------------------------
Section "Test 1"
StrCpy $R0 "a"
GetFunctionAddress $R1 test1
Call $R1
StrCmp $R0 "a182345678" success
DetailPrint "Test 1 failed (output: $R0)"
Goto end
success:
DetailPrint "Test 1 succeeded (output: $R0)"
end:
SectionEnd
Function test1
GetLabelAddress $9 skip
IntOp $9 $9 - 1
StrCpy $R0 $R01
Call $9
StrCpy $R0 $R02
StrCpy $R0 $R03
StrCpy $R0 $R04
StrCpy $R0 $R05
StrCpy $R0 $R06
StrCpy $R0 $R07
StrCpy $R0 $R08
skip:
FunctionEnd
;--------------------------------
Section "Test 2"
StrCpy $R0 "0"
StrCpy $R1 "11"
Call test2
StrCmp $R1 "11,10,9,8,7,6,5,4,3,2,1" success
DetailPrint "Test 2 failed (output: $R1)"
Goto end
success:
DetailPrint "Test 2 succeeded (output: $R1)"
end:
SectionEnd
Function test2
IntOp $R0 $R0 + 1
IntCmp $R0 10 done
Push $R0
GetFunctionAddress $R2 test2
Call $R2
Pop $R0
done:
StrCpy $R1 "$R1,$R0"
FunctionEnd
|