Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Callback Function? (http://forums.winamp.com/showthread.php?t=270386)

SportsQs 30th April 2007 09:44

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 12:14

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 14:07

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 16:28

Quote:

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 17:40

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


All times are GMT. The time now is 04:20.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.