Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS How to split strings over multiple lines?

Tags:

nsis

Seems like a simple one, but I have a large command line help string and would like to break it up so it's easier to read/maintain.

How can I do this in NSIS? The normal

"xxx" \
"xxxx"

style method of doing this doesn't seem to work.

Example code I want to neaten up:

MessageBox MB_OK "Unattended Silent Installs:$\r$\n/S$\t$\t=$\tSilent install using install.ini (if present)$\r$\n/W=1$\t$\t=$\t\Writes out all user settings to install.ini$\r$\n/WRITESETTINGS=1$\t$\t=$\tWrites out all user settings to install.ini (longer form)$\r$\n/?$\t$\t=$\tThis help page.$\r$\n$\r$\n"

like image 840
Jesse Avatar asked May 18 '11 07:05

Jesse


1 Answers

The \ is inside the quotes:

MessageBox MB_OK "Unattended Silent Installs:$\r$\n\
    /S$\t$\t=$\tSilent install using install.ini (if present)$\r$\n\
    /W=1$\t$\t=$\t\Writes out all user settings to install.ini$\r$\n\
    /WRITESETTINGS=1$\t$\t=$\tWrites out all user settings to install.ini (longer form)$\r$\n\
    /?$\t$\t=$\tThis help page.$\r$\n\
    $\r$\n"

Alternatively you can use defines:

!define msg1 "foo$\r$\n"
!define msg2 "bar$\r$\n"
MessageBox MB_OK "${msg1}${msg2}"
like image 137
Anders Avatar answered Sep 21 '22 07:09

Anders