Old 14th September 2006, 05:02   #1
basilisk561
Junior Member
 
Join Date: Sep 2006
Posts: 9
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?
basilisk561 is offline   Reply With Quote
Old 14th September 2006, 08:40   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
You should be able to re-enable the Next button using this code:
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? :>
Animaether is offline   Reply With Quote
Old 14th September 2006, 12:22   #3
basilisk561
Junior Member
 
Join Date: Sep 2006
Posts: 9
Quote:
Originally posted by Animaether
You should be able to re-enable the Next button using this code:
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.
basilisk561 is offline   Reply With Quote
Old 14th September 2006, 12:38   #4
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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.
Animaether is offline   Reply With Quote
Old 14th September 2006, 12:47   #5
basilisk561
Junior Member
 
Join Date: Sep 2006
Posts: 9
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
basilisk561 is offline   Reply With Quote
Old 14th September 2006, 16:55   #6
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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 )
Animaether is offline   Reply With Quote
Old 14th September 2006, 17:43   #7
basilisk561
Junior Member
 
Join Date: Sep 2006
Posts: 9
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
basilisk561 is offline   Reply With Quote
Old 15th September 2006, 07:26   #8
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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.
Animaether is offline   Reply With Quote
Old 15th September 2006, 13:22   #9
basilisk561
Junior Member
 
Join Date: Sep 2006
Posts: 9
I'm a bit miffed as well.

Anyone have any suggestions here?
basilisk561 is offline   Reply With Quote
Old 15th September 2006, 13:56   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump