Announcement

Collapse
No announcement yet.

NSIS Message Box Title, can be changed?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!

  • #2
    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.
    NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

    Comment


    • #3
      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
      WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

      Comment


      • #4
        Try like this, for a simple solution:

        code:
        !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

        My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
        My source of inspiration: http://youtu.be/lCwY4_0W1YI

        Comment


        • #5
          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.

          Comment


          • #6
            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...
            My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
            My source of inspiration: http://youtu.be/lCwY4_0W1YI

            Comment


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

              -daz
              WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

              Comment


              • #8
                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.

                Comment


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

                  See nsDialogs manual for details:
                  My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
                  My source of inspiration: http://youtu.be/lCwY4_0W1YI

                  Comment


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

                    Comment


                    • #11
                      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:

                      PHP Code:
                      GetDlgItem $0 $HWNDPARENT 1
                      EnableWindow 
                      $0 0 
                      My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
                      My source of inspiration: http://youtu.be/lCwY4_0W1YI

                      Comment

                      Working...
                      X
                      😀
                      🥰
                      🤢
                      😎
                      😡
                      👍
                      👎