Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS | Message Box | Displaying Text and Variable

I am new to NSIS and I wanted to show a message with a text and a variable value (mainly for debugging purpose). Please let me know if this can be achieved by the following method

Example: MessageBox MB_OK "Application Name" $VersionNumber

If this method is not correct please suggest an alternative.

like image 843
Sree Ranjani Avatar asked Nov 27 '25 11:11

Sree Ranjani


1 Answers

The MessageBox string needs quotes (", ' or `) if it contains spaces.

!define COPYYEAR 2018

Var VersionNumber

Section
StrCpy $VersionNumber "1.2.3.4" ; You will probably read this from somewhere, not hardcode it
MessageBox MB_OK "Application Name $VersionNumber"
MessageBox MB_OK NoSpacesNoQuotesRequired$VersionNumber
MessageBox MB_OK|MB_ICONINFORMATION "Copyright (R) ${COPYYEAR}"
SectionEnd
like image 76
Anders Avatar answered Dec 01 '25 19:12

Anders