I wanted to know how to call a function from C++ executable using NSIS.
I am using the below method but it is not calling the function.
!include LogicLib.nsh
Section
SetOutPath $INSTDIR
File E:\TestNullSoft\Test1.exe
File E:\TestNullSoft\Test2.dll
System::Call 'KERNEL32::AddDllDirectory(w "$INSTDIR")'
Pop $1 ;
${If} $0 = 0
MessageBox MB_OK "Function is NOT CALLED" IDOK
${EndIf}
SectionEnd
AddDllDirectory function is declared in the C++ project like as shown below:
You cannot call functions in .EXE files, only .DLL files.
Specifically, System::Call
will call LoadLibrary
and GetProcAddress
and LoadLibrary
cannot load a .EXE.