SportsQs
30th April 2007 10:44 UTC
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
Backland
30th April 2007 13:14 UTC
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)
Comm@nder21
30th April 2007 15:07 UTC
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.
SportsQs
2nd May 2007 17:28 UTC
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
kichik
3rd May 2007 18:40 UTC
The System plug-in can handle callbacks. There is an example in the documentation.