Old 13th January 2006, 00:32   #81
DrO
 
Join Date: Sep 2003
Posts: 27,873
strange, not sure why it wouldn't have worked assuming the icon was fully added and then saved to the dll. as long as it works now then that's the main thing

-daz
DrO is offline  
Old 19th June 2006, 17:10   #82
goldy1064
Senior Member
 
Join Date: Jun 2005
Posts: 211
I'm using LogicLib and I need a custom messagebox nested within some logic. However, this causes the stack to be unable to be in a clean state. I was wondering when their would be a fixed implemented for this? Reading back on this thread I saw that a /end switch was being tested.

Thanks!

EDIT: Also, with my testing, I've noticed that whenever I quit the installer, it seems to give a memory read violation whenever it tries to unload the messagebox dll.

Last edited by goldy1064; 19th June 2006 at 17:47.
goldy1064 is offline  
Old 24th July 2006, 10:58   #83
Yurik
Senior Member
 
Join Date: Oct 2004
Posts: 103
Solution with extra buttons

Hi,
Am I right that there is no solution for extra buttons still except for manually clearing stack? This is not elegant solution as the stack could keep some values from outer procedure calls.

Computer Forensics Investigations, Internet Security and Parental Control, - http://belkasoft.com
Yurik is offline  
Old 30th August 2006, 12:51   #84
lilisbbc
Junior Member
 
Join Date: Jun 2006
Posts: 6
Hi,

I have just tested the messagebox plugin v.098 beta 3 and I found another small bug inside.
I am using Modern UI, and just after the Welcome page, and before the License page agreement shows, I insert a function to display a simple messagebox with a specific title and only a "OK" button (with the plugin).
When clicking, on "Next" (in the Welcome page), then this pops up the messagebox correctly. Then, when I click back (to return to the welcome page), and then "Next" again, this pops up the same messagebox with my "OK" button but also an additional "1" button !!!
Repeating the process another time, will display the messagebox with "2" if I have clicked on "1", etc...

Below is the essential part of the code:

!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowLicenseInfo
!insertmacro MUI_PAGE_LICENSE "myLicense.txt"
.
.
.
Function ShowLicenseInfo
messagebox::show MB_TOPMOST "my specific title" \
"" "\
PLEASE NOTE: this is some additional information" \
IDOK
FunctionEnd

Is there something I have done wrong ? Or is it a problem from the plugin ?
Attached Images
File Type: jpg bugmsgbox.jpg (19.6 KB, 435 views)
lilisbbc is offline  
Old 30th August 2006, 13:52   #85
lilisbbc
Junior Member
 
Join Date: Jun 2006
Posts: 6
Quote:
Originally posted by lilisbbc
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowLicenseInfo
!insertmacro MUI_PAGE_LICENSE "myLicense.txt"
.
.
.
Function ShowLicenseInfo
messagebox::show MB_TOPMOST "my specific title" \
"" "\
PLEASE NOTE: this is some additional information" \
IDOK
FunctionEnd

Is there something I have done wrong ? Or is it a problem from the plugin ? [/B]
Okay, after some investigations, it appears that simply adding Pop $0 at the end of the function solves the problem.
Don't really know why, but well, as long as it works...
Thanks Dr0 for the plugin ! :-)
lilisbbc is offline  
Old 30th August 2006, 15:35   #86
goldy1064
Senior Member
 
Join Date: Jun 2005
Posts: 211
The reason that happens is that this plugin requires that the stack be empty. The first four elements on the stack will be used as the messagebox buttons.
goldy1064 is offline  
Old 25th September 2006, 15:28   #87
icebox13
Junior Member
 
Join Date: Jul 2006
Posts: 4
Does anyone have any idea why a message box with this plugin might not work in certain instances? As the developer of our installer, I have not experienced any issues with it, nor have others who've tested it, but one tester has. I'm using the messagebox::show in 3 separate places, and for him, when he clicks on the button in the custom pages to display these message boxes, nothing happens. I've created this simple script, which duplicates the problem on his machine, but works fine for others and myself. He can see the "normal" message box, but not the MB via the plugin. Any thoughts?
Attached Files
File Type: zip mbox-test.zip (985 Bytes, 438 views)
icebox13 is offline  
Old 25th September 2006, 16:58   #88
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
One thing in that script is that you've got InitPluginsDir after MUI_INSTALLOPTIONS_EXTRACT and it should be before.
What happens if you put a normal MessageBox before the plugin MessageBox. Does that get displayed?

-Stu
Afrow UK is offline  
Old 25th September 2006, 18:26   #89
icebox13
Junior Member
 
Join Date: Jul 2006
Posts: 4
I updated the InitPluginsDir, and that didn't seem to make a difference (though I will update that in my real code anyway, thanks for pointing it out). I also inserted a normal message box to confirm that we're getting to that place in the code, and it appears. The very next line, the messagebox::show, still doesn't work on his (still does on mine).

On a side note, we're both using our standard company issue workstations with Windows XP Pro SP2.
icebox13 is offline  
Old 25th September 2006, 18:28   #90
icebox13
Junior Member
 
Join Date: Jul 2006
Posts: 4
Sorry, meant to update attachment with your suggestions:
Attached Files
File Type: zip mbox-test.zip (1,000 Bytes, 515 views)
icebox13 is offline  
Old 26th September 2006, 17:08   #91
icebox13
Junior Member
 
Join Date: Jul 2006
Posts: 4
Any ideas for us to try? Has anyone else ran into this before?
icebox13 is offline  
Old 26th September 2006, 17:13   #92
DrO
 
Join Date: Sep 2003
Posts: 27,873
at the moment no since i don't have the source code on my machine here (i think my attempt at a new version was on the machine at work) so i'll have to track that down tomorrow and see what i can make up to test the thing out). i will add that it appears to work fine for me (though i can't test on an XP install until later). not too sure why it'd fail to display as such if it's working on all other installs (unless the test machine where it fails has something else installed on it which could be breaking the OS hacks)

-daz
DrO is offline  
Old 2nd October 2006, 15:44   #93
loquis
Junior Member
 
Join Date: Oct 2006
Posts: 2
Found an odd issue with messagebox.

If I have message text with a ':' in it, sometimes the text after the ':' isnt shown, sometimes it is.

Any idea why this might be?
loquis is offline  
Old 3rd December 2006, 19:17   #94
flizebogen
Senior Member
 
Join Date: Jan 2002
Location: Berlin
Posts: 171
I've tested the latest version (v.0.98 beta 3) of your plugin.

messagebox::show MB_DEFBUTTON2|MB_TOPMOST "title" "" "Body" "Button1" IDNO

If i see this messagebox and press Escape a sound is played and the messagebox disappears.

messagebox::show MB_DEFBUTTON2|MB_TOPMOST "title" "" "Body" "Button1" "Button2"

If i press Escape on a messagebox without standard buttons the process uses 99 procent cpu resources and stops responding.

Any ideas?

- flizebogen
flizebogen is offline  
Old 3rd December 2006, 19:24   #95
DrO
 
Join Date: Sep 2003
Posts: 27,873
i tried looking into that issue but there's a quirk with the overrides i do and the OS. i can't remember if i managed to resolve the issue or not since it was something i was trying to work on during my lunch breaks at work and i don't have that code to hand. from what i remember if there's no proper close button (with the [x] in the top right being greyed out) will cause the lock up

-daz
DrO is offline  
Old 24th April 2007, 19:49   #96
flizebogen
Senior Member
 
Join Date: Jan 2002
Location: Berlin
Posts: 171
I added a Close button. Like you said this prevented the crash.

Unfortunately i have an other problem:

Below is the output of the example from the latest version. If i execute it on a terminal server within a rdp session. No problems on a workstation.

The Plugin return not the number of the chosen button, it don't display at all and gives this faulty output

Any ideas?

C:\DOKUME~1\ab\LOKALE~1\Temp\3\nsu10.tmp\messagebox.dll
messagebox call 1 returned... MB_DEFBUTTON4|MB_TOPMOST
C:\DOKUME~1\ab\LOKALE~1\Temp\3\nsu10.tmp\messagebox.dll
messagebox call 2 returned... MB_SETFOREGROUND|MB_ICONHAND|MB_DEFBUTTON3
C:\DOKUME~1\ab\LOKALE~1\Temp\3\nsu10.tmp\messagebox.dll
messagebox call 3 returned... MB_ICONHAND|MB_DEFBUTTON2
C:\DOKUME~1\ab\LOKALE~1\Temp\3\nsu10.tmp\messagebox.dll
messagebox call 4 returned... MB_ICONEXCLAMATION|MB_ICONHAND|MB_TOPMOST|MB_DEFBUTTON2|MB_RIGHT
C:\DOKUME~1\ab\LOKALE~1\Temp\3\nsu10.tmp\messagebox.dll
Completed
flizebogen is offline  
Old 20th July 2007, 01:10   #97
zbd
Member
 
Join Date: Oct 2006
Location: Sydney, Australia
Posts: 76
This is a great plugin.

I cant seem to work out why, but every time i try to show a custom messagebox, it adds an extra button on to the end that says, "success"

I can't seem to make it not show.
Any ideas?

Nevermind, worked it out, had to Pop $0 before it
Cheers
zbd is offline  
Old 10th September 2007, 11:52   #98
talonx
Guest
 
Posts: n/a
Great work!!!
I'm using it in a current project of mine. Pressing the escape button when the message box is shown (2 custom buttons in my case) hangs the installer, with the CPU going to 60%...a known issue?

Thanks in advance,
Hrish
 
Old 23rd October 2008, 16:41   #99
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
It's a pity that messagebox plugin is no longer developed, because it's great. I encountered only one bug but it's a nasty one: messagebox crashes (it freezes, actually) when Esc is pressed. Seems that it goes into some infinite loop (cpu load is 99%).
aerDNA is offline  
Old 23rd October 2008, 16:44   #100
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Just realized that the previous reply said the same thing.
aerDNA is offline  
Old 22nd December 2008, 15:01   #101
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
Hey guys,

I'm pretty new to all NSIS-stuff, but I truly enjoy the capabilities of the system!

Anyway, let's get straight to the point:
1. Awesome plugin, but:
2. Could you, DrO, enable support for .ico-files?

Since I'm only using a single icon for kinda "Xmas welcome-screen", I'd prefer to not generate a DLL, but instead use such an .ico-file.

Thanks in advance,
Martin..
eagle3386 is offline  
Old 22nd December 2008, 17:01   #102
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Here's how I do it:

> You need Resource Hacker (http://www.angusj.com/resourcehacker/).


> Put the .ico in the folder where your script is and create a cmd file, e.g. header.cmd. Here's what you should put in it:

@echo off
rem 'Inject' the icons into the header with ResHacker:
"%ProgramFiles%\Resource Hacker\ResHacker.exe" -add "%TEMP%\exehead.tmp", "%TEMP%\exehead.tmp", "%~dps0IconName.ico", icongroup,104,1033
rem If you want to compress the header with upx:
"%ProgramFiles%\UPX\upx.exe" --best "%TEMP%\exehead.tmp"

Icon group 104 will contain icons from your ico file. Add more lines for more icon groups.


> Put this at the end of your script:

!packhdr "$%TEMP%\exehead.tmp" "header.cmd"


> And finally, the MessageBox example:

Messagebox::show MB_TOPMOST "Caption" "0,104" "Text" "Button 1" "Button 2" "Button 3" "Button 4"
# it uses the 1st icon from icongroup 104

PostEnd:
aerDNA is offline  
Old 22nd December 2008, 17:41   #103
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
First of all, thank you very much for your guide.

Unfortunately, the sad thing about this solution is the fact that Resource Hacker doesn't work under Vista (at least not x64, which is the one I run)..
eagle3386 is offline  
Old 22nd December 2008, 21:25   #104
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
You could try XN Resource Editor or eXeScope as alternatives. I don't know if they'll work on Vista x64 but even if they do, the problem is they don't support command line operation, at least not to my knowledge. eXeScope documentation says it supports some kind of batch processing based on log files but I haven't tried the program. But if you do find a resource editor that works on your system, what you can do is:

> Instead of that header.cmd, create two new ones:

header1.cmd:
copy "%TEMP%\exehead.tmp" C:\tmphead.tmp

header2.cmd:
copy C:\tmphead.tmp "%TEMP%\exehead.tmp" /Y

> Compile the script with:
!packhdr "$%TEMP%\exehead.tmp" "header1.cmd"

> Edit C:\tmphead.tmp with a resource editor

> Compile again with header2.cmd"


Or settle for a regular messagebox and use MB_USERICON...

PostEnd:
aerDNA is offline  
Old 22nd December 2008, 22:33   #105
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
Quote:
Originally posted by aerDNA
(...)
Useful suggestions
(...)

Or settle for a regular messagebox and use MB_USERICON...
Uh! That MB_USERICON shows the same like I did (as a workaround) while waiting for an answer from you (which means I set the app's icon to a different one):
code:
MessageBox::show styles "Ho! Ho! Ho!" "0,103" " Merry Xmas$\r$\n to all you geeks! " IDOK

Though, following your way I can't set my own message box-title..

And I used "0,103" instead of your suggested "0,104" (AFAIR the Wiki told me that "3") - maybe you could explain this to me?
eagle3386 is offline  
Old 23rd December 2008, 09:03   #106
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Quote:
Or settle for a regular messagebox and use MB_USERICON...
Being sleepy makes me slip. You don't have to settle for a regular mb, you can also use the installer icon with the plugin, exactly the way you did. Icon group 103 always contains the installer icon. 104 was the one I suggested to create for adding an extra, which is unnecessary if you're willing to use the same icon for the installer and the messagebox.
Btw, there's a way to change the title even when using the regular mb. But you don't need that now, or do you?

PostEnd:
aerDNA is offline  
Old 23rd December 2008, 10:53   #107
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
Quote:
Originally posted by aerDNA
Being sleepy makes me slip. You don't have to settle for a regular mb, you can also use the installer icon with the plugin, exactly the way you did.
This sounds somewhat familiar for me..

Quote:
Originally posted by aerDNA
Icon group 103 always contains the installer icon. 104 was the one I suggested to create for adding an extra, which is unnecessary if you're willing to use the same icon for the installer and the messagebox.
Thanks for clarifying this for me!

Quote:
Originally posted by aerDNA
Btw, there's a way to change the title even when using the regular mb. But you don't need that now, or do you?
I always want to learn more, so if you like, please go on!
eagle3386 is offline  
Old 23rd December 2008, 13:13   #108
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Here, I've made a script that shows how to change a single MB's caption. My method may not be very elegant but it works, and it allows you to create an animated title. This doesn't really belong to this thread any more, I hope the moderators don't mind...

code:

OutFile "XMAS.exe"
;Icon "xmas.ico"
XPStyle On

!include "WinMessages.nsh"
!define InstCaption "Merry XMAS Wisher 1.0 beta"
!define MBCaption1 " Merry XMAS, human!"
!define MBCaption2 " Live long and prosper!"
Caption "${InstCaption}"

Function .onInit
# If you don't want the blinking caption on the taskbar as well, use .onGUIInit

InitPluginsDir
WriteUninstaller $PLUGINSDIR\MBCaption.exe
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "This MessageBox has a normal title."
Exec "$PLUGINSDIR\MBCaption.exe"
MessageBox MB_OK|MB_USERICON|MB_TOPMOST "But this one has a festive title!"
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "This is the normal title again."
Abort

FunctionEnd

Section "Blank"
SectionEnd


Function un.onInit

FindWindow $0 "" "${InstCaption}" "" ""
IsWindow $0 0 -1

CaptionLoop:
SendMessage $0 ${WM_SETTEXT} "0" "STR:${MBCaption1}"
Sleep 800
SendMessage $0 ${WM_SETTEXT} "0" "STR:"
Sleep 400
SendMessage $0 ${WM_SETTEXT} "0" "STR:${MBCaption2}"
Sleep 800
SendMessage $0 ${WM_SETTEXT} "0" "STR:"
Sleep 400
FindWindow $1 "" "${InstCaption}" "" ""
IsWindow $1 0 CaptionLoop

Abort
FunctionEnd

Section "un.Blank"
SectionEnd


PostEnd:
aerDNA is offline  
Old 23rd December 2008, 17:28   #109
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
Thank you very much!
And merry Xmas to you and your family!
eagle3386 is offline  
Old 24th January 2009, 17:13   #110
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Appendix:
The above script is missing one thing: RequestExecutionLevel User. Without it, MBCaption.exe should (re)trigger UAC (Utterly Annoying Component ).
And as I said, the method is not very elegant. When you don't really need a flashing caption, the proper way to go would be to create a custom MB through Win API. E.g.:
code:
!include "${NSISDIR}\Examples\System\System.nsh"
!define STYLE ${MB_OK}|${MB_ICONINFORMATION}|${MB_TOPMOST}
System::Call 'User32::MessageBox(i $HWNDPARENT, t "The text", t "A caption", i ${STYLE}) i.'


To use a custom icon (including the installer icon), you need MessageBoxIndirect, but it accepts only module handles. Handles returned by LoadImage don't work, that must be why MessageBox plugin can't support ico files.

PostEnd:
aerDNA is offline  
Old 24th January 2009, 17:43   #111
eagle3386
Member
 
eagle3386's Avatar
 
Join Date: Dec 2002
Location: » Earth » Europe » Germany » Saxony » Ore Mountains
Posts: 64
Send a message via ICQ to eagle3386
Again, thanks a lot for pointing this out!
eagle3386 is offline  
Old 30th January 2009, 14:17   #112
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
Has anyone ever converted the messagebox plugin into Unicode? If not I would be interested in trying to do so if the source is available somewhere.
scully13 is offline  
Old 30th January 2009, 16:48   #113
DrO
 
Join Date: Sep 2003
Posts: 27,873
nope it's not been done since the source was lost. i did begin to reimplement it but my winamp commitments have killed that from happening. but maybe one day i'll get around to it...

-daz
DrO is offline  
Old 18th June 2011, 00:13   #114
DrO
 
Join Date: Sep 2003
Posts: 27,873
have just removed the downloads for this and the wiki page relating to the plug-in has been removed.

i'm never going to get around to re-creating it to make it compatible with current OSes since it's been almost 6 years and i've never found the time.

is also better to remove it to prevent other users trying to use it and then wonder why they have issues - doesn't help it was compiled in a manner which turns out to not be DEP compatible *doh*



-daz
DrO is offline  
Closed Thread
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump