Archive: Aborting install due to error


Aborting install due to error
I'm trying to call Abort during the section execution and the install files UI (MUI) goes into an aborted state, and the installation progress halts, but the Next button doesn't light back up.

I'd like for the user to be able to click Next and then get the finish screen with its labels changed to indicate a failed installation.

What's up with that Next button and what's the best way to handle this?


You should be able to re-enable the Next button using this code:


GetDlgItem $R0 $HWNDPARENT 1 ; 1 = Next button
EnableWindow $R0 1 ; 1 = enable


As for why it gets disabled - dunno. Would seem odd as that would mean an aborted installation is stuck on that page with nowhere to go? :>

Originally posted by Animaether
You should be able to re-enable the Next button using this code:

GetDlgItem $R0 $HWNDPARENT 1 ; 1 = Next button
EnableWindow $R0 1 ; 1 = enable


As for why it gets disabled - dunno. Would seem odd as that would mean an aborted installation is stuck on that page with nowhere to go? :>
I've tried calling this immediately before the call to Abort and it doesn't seem to do anything.

I think you'd want to call it -before- Abort, because anything after Abort gets ignored anyway;
"Cancels the install, stops execution of script, and displays user_message in the status display."

So hence.. no idea really what would happen if you enable that button, abort, and try to click it ;)

I'd check into "MUI_CUSTOMFUNCTION_ABORT function" and see if you can handle the abort more cleanly there.


Re-read, I WAS calling that code before Abort. :)

I've tried MUI_CUSTOMFUNCTION_ABORT and this isn't called when the Abort call is made, it is only called when the user clicks Cancel at any point in the installation.

Any other ideas?

TIA


hrm. funky.

I tossed the code into a "!define MUI_PAGE_CUSTOMFUNCTION_LEAVE blabla", ending with an MB_OK messagebox. The button enables.. but as soon as I click on the messagebox OK, the button disables again %)

So much for my thinking it should be simple.

Whatever you need to be doing with the Abort, perhaps it's better done another way -without- using Abort? ( presuming NSIS automatically does things when Abort is called that you don't want happening )


Well, actually, Abort does do some things that I *do* desire, like changing the UI text in the installfiles screen to indicate that a problem occurred and that the installation was aborted.

Also, without the Abort call (like when I tried to just skip the rest of the steps in the component section), the installer details will always show Complete as the last step in the install. This is misleading because it kind of indicates that the install was suceessful.

Ideally, I want this:

Error occurs -->
Installfiles UI updated with abort indicators -->
User clicks Next button -->
Finish screen is displayed with alternate failure text


I've been poking and for some reason it just looks like calling Abort kills things and most of the Install page reverts to defaults even after you change things. I, for one, am at a loss. I could suggest displaying a custom page inbetween if there is an error that shows that there was an error installing, but I suspect you want the DetailsList in view.

Anybody else have any ideas? I'm confounded and surprised that the Install page is behaving the way it is.


I'm a bit miffed as well.

Anyone have any suggestions here?


You can use either of these two:

http://forums.winamp.com/showthread....t=finish+abort
http://forums.winamp.com/showthread....t=finish+abort

You can also search the forum for the original threads leading to these. They contain some information about this topic, if I remember correctly.