Archive: NSIS Message Box Title, can be changed?


NSIS Message Box Title, can be changed?
  I am wondering can I modify the title of the message box title? And can I use my own icon instead of the icons provided by NSIS.

Thanks!


you have a little more options using the messagebox plugin (seems it was deleted from the wiki), but iirc it didn't allow changing the icon. another solution would be looking at nsWindows, which allows you to create custom pages at a size of your liking.


the removed messagebox plug-in did allow for the icon to be customised (it basically exposed everything the MessageBox(..) api exposed but was removed as i cannot support / re-develop something i lost the code to 6+ years ago - plus the compile didn't work correctly on most machines where DEP is enabled. hence the removal.

nswindows or trying to use the system plug-in (which wasn't as adapt at doing such things when i made my removed plug-in) is the recommended option i'd go with if trying to create something like a messagebox.

-daz


Try like this, for a simple solution:

!macro MsgBox out text title flags
System::Call "user32::MessageBox(i $HWNDPARENT, t '${text}', t '${title}', i ${flags}) i.s"
Pop ${out}
!macroend

Section "MsgBoxTest"
!insertmacro MsgBox $0 "Hello world! This is just a test. Continue?" "Awesome title" 0x20|0x3
MessageBox MB_OK "Return Code: $0"
SectionEnd

Do You know maybe how to change the button's text on the dialog box? For instance from 'Yes' to 'Whatever'? Please let me know.


Not possible with the "native" Windows dialog boxes (details).

There are certain flags to control which buttons will be shown, but no way to freely define the text.

You'd have to create your own window and manually add the buttons, I fear...


wouldn't nsWindows be an option to create a dialogbox-like window?

-daz


Thanks for the response. What I need to do is to display a simple menu at the beginning of the installation process. This menu would contain three options:
1) Show manual
2) Install
3) Exit
I thought to use the MessageBox but I can't customize the buttons' captions. How it can be done in different way? Please share your ideas.


Instead of a pop-up window (message box), why not simply use a custom installer page as first page?

See nsDialogs manual for details:
http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html


I'm reading this tutorial right now. Is there any way to hide the bar at the bottom of the window?


Nope, as it's not part of the "inner" dialog, where the nsDialogs page is being displayed.

You can disable the buttons at the bottom of the installer dialog while your custom page is being shown though.


For the next button you would use this code to disable:


GetDlgItem $0 $HWNDPARENT 1

EnableWindow$0 0
>