2002-08-02 10:01:35 +00:00
|
|
|
#include <windows.h>
|
2009-02-04 14:08:31 +00:00
|
|
|
#include <nsis/pluginapi.h> // nsis plugin
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
HINSTANCE g_hInstance;
|
2002-09-21 18:27:58 +00:00
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
HWND g_hwndParent;
|
|
|
|
|
2010-03-24 17:22:56 +00:00
|
|
|
// To work with Unicode version of NSIS, please use TCHAR-type
|
|
|
|
// functions for accessing the variables and the stack.
|
|
|
|
|
2002-08-02 10:01:35 +00:00
|
|
|
void __declspec(dllexport) myFunction(HWND hwndParent, int string_size,
|
2010-03-24 17:22:56 +00:00
|
|
|
TCHAR *variables, stack_t **stacktop,
|
2004-10-23 17:43:08 +00:00
|
|
|
extra_parameters *extra)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
|
|
|
g_hwndParent=hwndParent;
|
2002-09-21 18:27:58 +00:00
|
|
|
|
|
|
|
EXDLL_INIT();
|
|
|
|
|
|
|
|
|
|
|
|
// note if you want parameters from the stack, pop them off in order.
|
|
|
|
// i.e. if you are called via exdll::myFunction file.dat poop.dat
|
|
|
|
// calling popstring() the first time would give you file.dat,
|
|
|
|
// and the second time would give you poop.dat.
|
|
|
|
// you should empty the stack of your parameters, and ONLY your
|
|
|
|
// parameters.
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
// do your stuff here
|
|
|
|
{
|
2010-03-24 17:22:56 +00:00
|
|
|
TCHAR buf[1024];
|
|
|
|
wsprintf(buf,_T("$0=%s\n"),getuservariable(INST_0));
|
2002-08-02 10:01:35 +00:00
|
|
|
MessageBox(g_hwndParent,buf,0,MB_OK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-11-12 20:24:53 +00:00
|
|
|
BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
|
2002-08-02 10:01:35 +00:00
|
|
|
{
|
|
|
|
g_hInstance=hInst;
|
|
|
|
return TRUE;
|
|
|
|
}
|