Archive: Abort from onGUIInit?


Abort from onGUIInit?
[using 2.0b0]

calling "Abort" from the .onGUIInit function appears to have no effect.

is this a bug, or does Abort have some "special" meaning from .onGUIInit ?

thanks
-brian


What effect would you except?

You quit the installer, use Quit. But it's better to use .onInit for that.


The behavior i would expect is the same as in .onInit: abort the installer.

Our installer needs to check if a previous version is installed,
and if so, give the user a message box and then uninstall the previous version before installing the current version.

In nsis 1.98, I was doing this in .onInit. The observed behavior was: first the background screen would come up, then the message box, the user hits OK and we do the uninstall silently, it takes 10-15 seconds which is fine for us, we don't need a progress bar or anything, the hourglass icon is fine.

In NSIS 2.0, with the same code, all the .onInit stuff happens *before* the background screen comes up, and there is not even an hourglass icon while the previous version is being removed. The effect is that, for those 10-15 seconds it appears as if the installer is not running at all.

Putting this logic in .onGUIInit instead of .onInit seemed to solve the problem, in fact the behavior is identical to what it was using .onInit in 1.98 -- except that i can't abort the installation if the user clicks "no" in my messagebox.

Alternative approaches are possible, but i don't understand why you would want to have this one callback function from which it is impossible to programmatically abort the installation.

-brian


Like Joost said, Quit works. I will make it so Abort will work too and I will also make it quit instantly and not even show the window as it does now (soon in CVS).


Done.


Thanks!