1
votes

In an NSIS installer, I'm interested in displaying a MessageBox with a custom title. I currently have:

MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST "%SOME_STRING%"

In this call, there's no definition of MessageBox title, which then becomes a default string, saying <Installer Name> Setup. I would like to remove the 'Setup' part, or provide a string of my own.

Thank you.

1

1 Answers

3
votes

You can use the Caption attribute to set the caption Caption "Whatever" but that changes it globally.

NSIS does not have native support for a custom MessageBox caption but you can call the Windows API directly:

Section
!define MB_OK 0x00000000
!define MB_ICONINFORMATION 0x00000040
System::Call 'USER32::MessageBox(i $hwndparent, t "The message", t "The caption", i ${MB_OK}|${MB_ICONINFORMATION})i'
SectionEnd

You can lookup the other MB_* flags on MSDN...