How I can do printf-like stuff in a self made plugin? I have heard of fprintf(g_output, ... but I don't know where g_output is declared.
Announcement
Collapse
No announcement yet.
printf in NSIS plugin
Collapse
X
-
Where do you want to write output to? If it's to the installer log window you have to send the LVM_INSERTITEM message to the list view control. Normally a plug-in will use pushstring() to push its output or return value to the stack for the caller.
Edit: You can also call a callback function while your plug-in executes. You still use the stack to pass messages though.
Stu
Comment
-
-
An extra word on the request:
I am using the Advanced Logging Build from the Special Builds and have set 'LogSet on'. From the NSIS file, I use 'LogText "foobar"' to log to the install.log file in the installation folder.
I would like to log to this file from within our own C plugin as well.
Regarding previous post:
Return value is easy to do but I would like to do logging while executing the plugin function.
Can you explain how to call this callback from the C code?
Comment
-
-
Originally Posted by Dafr View PostCan you explain how to call this callback from the C code?"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
Comment
-
-
Ok, I managed to do logging from the plugin dll.
in the dll:
in the nsi:code:
int funcAddr = popint();
pushstring("Logging from plugin DDL");
extra->ExecuteCodeSegment(funcAddr - 1, 0);
Thank you.code:
GetFunctionAddress $R0 LogText
Push $R0
MyPlugin::MyFunction
Comment
-
-
Just something to note, this:
Push $R0
MyPlugin::MyFunction
MyPlugin::MyFunction "$R0""Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
Comment
-
Comment