parasoul
17th June 2011 07:12 UTC
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:
".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
17th June 2011 08:33 UTC
Everything is fine with this:
".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 :
onInit
messagebox
::show MB_ICONEXCLAMATION "HiTitle" "" "HiMessage" IDOK
FunctionEnd
Section
SectionEnd
>
Try to insert
InitPluginsDir before first call to your plugin.
MSG
17th June 2011 09:43 UTC
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
17th June 2011 12:20 UTC
Originally posted by 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.
I disagree with you - I prefer to call it manually.
parasoul can you share your plugin with us?
DrO
17th June 2011 13:04 UTC
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
17th June 2011 15:20 UTC
Originally posted by T.Slappy
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
17th June 2011 18:51 UTC
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 ^>^
Anders
17th June 2011 19:26 UTC
i not v if you want the actual return value
parasoul
18th June 2011 02:17 UTC
thanks for letting me know that but no the return is trivial to me