Archive: Callback Function?


Callback Function?
Hi,
I have a dll that is called from NSIS, in order to prepare the syatem for upgrade (is an EPOS application). I want to the instal to support a callback function, so that if the 'Prepare' fails, I can alert the user and abort the installation. The DLL is written in delphi (don't ask!), and the prepeare function has the following signature:

function Prepare(CallbackMethod : TCallbackMethod) : Boolean


How do I pass the callback function to my dll to respond to callbacks?

Thanks in advance
Peter


You can consider writing a C++ NSIS plugin that acts as a wrapper around your Delphi dll

Also, you can write a Plugin for NSIS in Delphi as well (if it makes things any easier)


callback functions are not used for such things.

therefore, you use return values.

you just execute the function using the system.dll plugin for nsis and then check the return value of your function.


Originally posted by Comm@nder21
callback functions are not used for such things.

therefore, you use return values.

you just execute the function using the system.dll plugin for nsis and then check the return value of your function.
Hi Comm@nder21,
If only it was that simple, unfortulately the dll function call is required to asynchronously callback with it's current state based on the operation it is currently performing. Just checking the return value is not enough, as I need to inform the user of the current state of the install. I'll be passing back things such as 'Install Started', 'Backing Up Database', 'Contacting devices' etc... and a load more.
So I need to call mydll::Prepare() with a NSIS function as a parameter which will then display the messages to the user as they are recieved.

Peter

The System plug-in can handle callbacks. There is an example in the documentation.