0
votes

Is it possible to create a define inside define in NSIS?

for example

!define WORLD 'world' !define HELLO 'Hello ${World}' detailPrint ${HELLO}

Those lines of code don't work... Is there another way to make this happen?

1
of course, this is not working, I want to know if there is something similiar - Ron Gross

1 Answers

2
votes
  1. DetailPrint expects a single parameter, while expanding ${HELLO} will result in 2 words "Hello world", resulting in the message

    detailPrint expects 1 parameters, got 2.

    Surround the constant with single, double or back quotes.

  2. DetailPrint can only be used inside a Section, if you tried exactly what you posted as a script, it should have tell you

    Error: command detailPrint not valid outside Section or Function

The following minimal script works as you expect:

outfile "helloworld.exe"

!define WORLD 'world'
!define HELLO 'Hello ${World}'

Section
    detailPrint "${HELLO}"
SectionEnd