Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS Function with more than 1 parameters

Tags:

nsis

Can a NSIS Function have more than one parameter?

Why wont this code compile? If I cant have more than 1 param for a function what are my other options(disregarding using a macro)?

Compile error:

Function expects 1 parameters, got 4. Usage: Function function_name

Outfile "test.exe"
Caption ""
Name ""

# Compile Error Here: "Function expects 1 parameters, got 4. Usage: Function function_name"
Function MyFunction p1 p2 p3
    DetailPrint "$p1, $p2, $p3"
FunctionEnd

Section
    DetailPrint "Hello World"
SectionEnd
like image 470
sazr Avatar asked May 14 '12 00:05

sazr


1 Answers

You have to pass parameters in registers and/or on the stack:

Function onstack
pop $0
detailprint $0
FunctionEnd

Function reg0
detailprint $0
FunctionEnd

Section
push "Hello"
call onstack
strcpy $0 "World"
call reg0
SectionEnd
like image 64
Anders Avatar answered Oct 22 '22 17:10

Anders