Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 17th June 2011, 07:12   #1
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
Plugin not working properly when compiled with makensis (console compiler)

Hi.

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

PHP Code:
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:
PHP Code:
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.
parasoul is offline   Reply With Quote
Old 17th June 2011, 08:33   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Everything is fine with this:
PHP Code:
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 :
PHP Code:
Function .onInit
messagebox
::show MB_ICONEXCLAMATION "HiTitle" "" "HiMessage" IDOK
FunctionEnd

Section
SectionEnd 
Try to insert InitPluginsDir before first call to your plugin.

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 17th June 2011, 09:43   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Old 17th June 2011, 12:20   #4
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Quote:
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?

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 17th June 2011, 13:04   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
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
DrO is offline   Reply With Quote
Old 17th June 2011, 15:20   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,169
Quote:
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)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th June 2011, 18:51   #7
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
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...
PHP Code:
System::Call 'user32::MessageBox(i $HWNDPARENT, t "dude", t "man", i 32) v r0' 
thanks everyone ^>^
parasoul is offline   Reply With Quote
Old 17th June 2011, 19:26   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,169
i not v if you want the actual return value

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th June 2011, 02:17   #9
parasoul
Senior Member
 
Join Date: Aug 2007
Posts: 117
thanks for letting me know that but no the return is trivial to me
parasoul is offline   Reply With Quote
Reply
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