Archive: Custom Messagebox


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


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.


You're missing a trailing 1 in your link.
http://forums.winamp.com/showthread.php?t=304431


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?


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.


Originally posted by ripper17
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

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.

http://ignorethecode.net/blog/2008/10/31/nobody-reads/
http://ux.stackexchange.com/a/9960

but apart from that, it always should have been clear there would be demand for custom buttons.


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


Originally posted by DrO
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)

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

You could also try http://nsis.sourceforge.net/DlgHost_plug-in


same problem as nsWindows though, wouldn't work onInit iirc


Well, you are not really supposed to display UI in .oninit, use .onguiint or the show callback of your first page.