Archive: DetailPrint or similar from plugin c code ?


DetailPrint or similar from plugin c code ?
Hi,

Is it possible to do a printf or DetailPrint or something else, that does the same as DetailPrint but from the plugin code ?

My plugin does a lot of things i'd like to log in the main NSIS installer window.

Best regards,
TJ


you have to add the string to the listview yourself, nsexec.c already has a function that does it


Hi,
Must be me, but where can i find the source of dll nsexec ?
Its not included in the default installation of NSIS ?

Can you pass an example ?

Thanks !


It's easy. Use the LVITEM structure and the ListView_ macros which are all defined on MSDN.

The NSIS source is a different download on the Wiki.

Stu


I think I understand what you were saying so I downloaded the nsExec source, copied the function LogMessage and added the code to my plugin...

The exported function in the plugin starts with :

extern "C" __declspec(dllexport) void CommitDir( HWND hwndParent, int string_size, char *variables, stack_t **stacktop )
{
EXDLL_INIT();

g_hwndList = NULL;
if (g_hwndParent)
g_hwndList = FindWindowEx(FindWindowEx(g_hwndParent,NULL,"#32770",NULL),NULL,"SysListView32",NULL);

when i do : LogMessage("DLL Scanner hgsdfgdsgdsgdsfg.", true ); i see nothing in the listview.

and if i do :

myfile.open ("c:\\commitlog.txt");

if (g_hwndParent)
myfile << "Parent ok..." << std::endl;
else
myfile << "Parent failed..." << std::endl;

if (g_hwndList)
myfile << "List ok..." << std::endl;
else
myfile << "List failed..." << std::endl;

myfile.close();

in the plugin code,
i can see that the parent is valid, but the listview is not found. Why is this ?

Dit i completely misunderstand what you meant ?

thanks !


Got it working now.

Thanks for all ideas!