Custom Messagebox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ripper17
    Junior Member
    • May 2006
    • 6

    Custom Messagebox

    Hi all,

    since the messagebox plug-in has been removed (see this thread) (and didn't work on 64-bit systems anyway):
    Is there a 'new' way to make a custom messagebox?

    What I'm trying to do is: display a messagebox With buttons "Default" "Custom Installation" and "Cancel" during the MUI_PAGE_INSTFILES.

    What's happening is: I'm checking JAVA if the user selected one specific section in my installer, if it's not installed, I'll install it (yes, JAVA is included in my installer) but want to ask the user if (s)he wants to do a silent (=Default) installation of JAVA, or a customized one.

    I've got the same situation later with MySQL, where the options are "Default", "Default, but change root PW" and "Custom".

    Does anybody know of a good way to do this during MUI_PAGE_INSTFILES or will I have to create another two custom pages in my installer with radio-buttons?

    Best

    Martin
  • Yathosho
    Forum King
    • Jan 2002
    • 3376

    #2
    i never had any problems using the messagebox plugin on 64-bit systems. however, if you prefer not to use it, you could fake some messageboxes using nswindows.
    NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

    Comment

    • MSG
      Major Dude
      • Oct 2006
      • 1892

      #3
      You're missing a trailing 1 in your link.
      Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.

      Comment

      • ripper17
        Junior Member
        • May 2006
        • 6

        #4
        OK, I should have been more precise: The messagebox plug-in is not working in Windows Server 2008R2 64-bit, because the DLL has non-resolved dependencies (i.e. try to open the plugin DLL with DependencyWalker). The result is, that the messagebox is not displayed.

        Thanks for pointing out nsWindows - but unfortunately it does not work as I had expected: I'm creating a nsWindow inside of a section, which (of course) means that the nsWindow will be opened during the install-files page. Unfortunately the window closes immediately when the Instfiles page is done. I would like to have it stop the Instfiles progress and wait until the user clicks one of the buttons. Am I missing something? Is there documentation for this plugin?

        Comment

        • T.Slappy
          Major Dude
          • Jan 2006
          • 571

          #5
          Pausing installation progress is a little tricky, check this thread to grasp some ideas: http://nsis.sourceforge.net/InstFile...ring_InstFiles

          If your plugin has sources you can easily remove dependencies bby rebuilding it with static libs.
          Or you can supply dependencies (.dll) with your installer.
          Cool looking installers with custom design: www.graphical-installer.com
          Create Setup Pages easily: www.install-designer.com
          Build installers in Visual Studio 2005-2022: www.visual-installer.com
          or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

          Comment

          • DrO
            • Sep 2003
            • 27868

            #6
            Originally Posted by ripper17 View Post
            The messagebox plug-in is not working in Windows Server 2008R2 64-bit, because the DLL has non-resolved dependencies (i.e. try to open the plugin DLL with DependencyWalker).
            Dependency Walker always shows non-resolved dependencies though you might be using the 64-bit version which gives even more missing results i've found. However that wouldn't be the cause of it not working - on 64-bit platforms due to how the messagebox plug-in was compiled, it's just not DEP compatible which most 64-bit Windows versions will refuse to allow it to be properly used. That is due to some slightly over aggressive compiler optimisations which turned out to cause DEP issues ~3years after the last version of the plug-in was made. Not that that helps much now but wanted to clarify that as a final reason for why the plug-in was pulled.

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

            Comment

            • Yathosho
              Forum King
              • Jan 2002
              • 3376

              #7
              it's a big joke anyway that there was even a need for an extra plugin to accomplish this. the messagebox command should've supported custom buttons years ago, especially since it has become common practise to avoid buttons labeled ok/cancel or yes/no to ensure better user interaction.


              Semantically, the Yes/No buttons are roughly equivalent to the Ok/Cancel buttons, but in general what would you recommend to use? Should I always use Yes/No or always use Ok/Cancel? Or does it depe...


              but apart from that, it always should have been clear there would be demand for custom buttons.
              NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

              Comment

              • DrO
                • Sep 2003
                • 27868

                #8
                and that is why you're meant to create a dialog window rather than re-purposing an OS api which was meant for a specific need only. that's all a messagebox is at it's most basic way of thinking, a specific dialog window. or even better you provide a more sensible means of reporting an error.

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

                Comment

                • Yathosho
                  Forum King
                  • Jan 2002
                  • 3376

                  #9
                  Originally Posted by DrO View Post
                  and that is why you're meant to create a dialog window
                  not that i need this, but out of general interest: what does this mean, using nsWindows? there's no other way provided by the OS?

                  as i said, i'm not in need for that myself, but i always find it unfortunate when i have to blow up my installer size with extra plugins (and yes, i'm aware that for most people an extra 5kb means nothing)

                  i just think that such a basic feature should be core functionality, but well, with the current state of nsis that would probably mean that users have to wait years to get such a new feature (if there'll ever be a new version)
                  NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

                  Comment

                  • Anders
                    Moderator
                    • Jun 2002
                    • 5644

                    #10
                    The MessageBox instruction just uses the MessageBox API in Windows...

                    You could also try http://nsis.sourceforge.net/DlgHost_plug-in
                    IntOp $PostCount $PostCount + 1

                    Comment

                    • Yathosho
                      Forum King
                      • Jan 2002
                      • 3376

                      #11
                      same problem as nsWindows though, wouldn't work onInit iirc
                      NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

                      Comment

                      • Anders
                        Moderator
                        • Jun 2002
                        • 5644

                        #12
                        Well, you are not really supposed to display UI in .oninit, use .onguiint or the show callback of your first page.
                        IntOp $PostCount $PostCount + 1

                        Comment

                        Working...
                        X