NSIS Plugin documentation
Hello,
I am trying to build an NSIS plugin but there is not much documentation on how to proceed. Nevertheless, I've found Jim Parks example and started from there: http://nsis.svn.sourceforge.net/view...n=&view=markup.
With Eclipse CDT, I succeded to build my dll using as source files: MySourceFile.c, pluginapi.c and as include files: api.h, nsis_tchar.h and pluginapi.h.
From EclipsesNSIS, I am able to access the exported functions of the dll.
First weird thing is that when I decide to upgrade my dll with a new function, build it and copy back the dll in the NSIS plugins directory, when I restart EclipseNSIS, the autocompletion will not detect the new functions added, though, when compiling the nsi script, it will detect it.
Second thing is that I am not able to push and pop the stack correctly, here follows my plugin code:
#include <windows.h>
#include <string.h>
#include "pluginapi.h" // nsis plugin
HINSTANCE g_hInstance;
HWND g_hwndParent;
void __declspec(dllexport) test(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{
g_hwndParent=hwndParent;
EXDLL_INIT();
{
const TCHAR* result = "Yes";
pushstring(result);
}
}
void __declspec(dllexport) test2(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{
g_hwndParent=hwndParent;
EXDLL_INIT();
{
const TCHAR* result = "Yes";
pushstring(result);
}
}
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) {
g_hInstance = hInst;
return TRUE;
}