Skip to content
⌘ NSIS Forum Archive

Plugin not working properly when compiled with makensis (console compiler)

9 posts

parasoul#

Plugin not working properly when compiled with makensis (console compiler)

Hi.

I have the following simple script trying to utilize the messagebox plugin:

Function .onInit
messagebox::show MB_ICONEXCLAMATION "HiTitle" "" "HiMessage" IDOK
FunctionEnd
Section
SectionEnd 
Now, when I compile with the GUI version (makensisw) it works perfectly.

however, when I compile with the console version (makensis) instead of showing a messagebox, it creates two files in it's currentdirectory: one being "HiTitle" and "HiMessage" (the title and message of the messagebox I'm trying to create)...

now I've been reading through the output of the console and it is infact recognizing the messagebox plugin and seemingly including it in the build, as shown here:
Function: ".onInit"
File: "messagebox.dll"->"$PLUGINSDIR\messagebox.dll" 6144 bytes
Plugin Command: show MB_ICONEXCLAMATION HiTitle  HiMessage IDOK
FunctionEnd 
Do you have any idea of how I can solve this problem?

Thanks for the time.
T.Slappy#
Everything is fine with this:
Function: ".onInit"
File: "messagebox.dll"->"$PLUGINSDIR\messagebox.dll" 6144 bytes
Plugin Command: show MB_ICONEXCLAMATION HiTitle  HiMessage IDOK
FunctionEnd 
It is a log from makensis as it parses plugin, every plugin is parsed this way.

But I can see a possible problem in you code :
Function .onInit
messagebox::show MB_ICONEXCLAMATION "HiTitle" "" "HiMessage" IDOK
FunctionEnd
Section
SectionEnd 
Try to insert InitPluginsDir before first call to your plugin.
MSG#
Calling a plugin automatically inits the pluginsdir. There's no need to call it manually. The initpluginsdir command was added for people who want to use the dir *before* any plugins are called.
T.Slappy#
Originally Posted by MSG View Post
Calling a plugin automatically inits the pluginsdir. There's no need to call it manually. The initpluginsdir command was added for people who want to use the dir *before* any plugins are called.
I disagree with you - I prefer to call it manually.

parasoul can you share your plugin with us?
DrO#
its most likely http://nsis.sourceforge.net/MessageBox_plug-in which is being used and really that plug-in shouldn't be used as i've no source code for it anymore and its just not supported.

and i agree with MSG, there's no point to do what the the installer is already doing for you but is your installer so you can do what you like really.

-daz
Anders#
Originally Posted by T.Slappy View Post
I disagree with you - I prefer to call it manually.
Initpluginsdir is for when you need the directory like MSG says. (Back in the day you had to extract the plugin yourself and call it with a NSIS instruction)
parasoul#
yes this is the plugin I'm trying to use. and I also believe that this plugin is the problem because I'm not having issues with any other plugin...

I've decided to simply use the system plugin to solve this problem...
System::Call 'user32::MessageBox(i $HWNDPARENT, t "dude", t "man", i 32) v r0' 
thanks everyone ^>^