Old 20th December 2006, 23:46   #1
soundken
Junior Member
 
Join Date: Dec 2006
Posts: 9
Finish page runs the executable multiple times

I have the following code for the finish page:

; Finish page
!define MUI_PAGE_CUSTOMFUNCTION_PRE checkForAbort
!define MUI_PAGE_CUSTOMFUNCTION_SHOW postStage
!define MUI_FINISHPAGE_RUN "$INSTDIR\MyApp.exe"
!insertmacro MUI_PAGE_FINISH

If by accident you click twice on the next button on the components page, when you get to the Finish page, it executes MyApp.exe but still shows the Finish page. When you click on Finish it runs MyApp.exe a second time.

I've been able to get 3 MyApp.exe's running at the same time while still seeing the Finish page.

This seems like a bug in NSIS, is there a way to prevent this?

And MyApp already detects that another copy is running and shuts down, but I have to show a dialog box to the user that says another copy is running. So I get multiple dialog boxes open.

Thanks.
soundken is offline   Reply With Quote
Old 21st December 2006, 08:29   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Re: Finish page runs the executable multiple times

What is the purpose of that "!define MUI_PAGE_CUSTOMFUNCTION_SHOW postStage" ?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st December 2006, 16:57   #3
soundken
Junior Member
 
Join Date: Dec 2006
Posts: 9
It does an InetLoad::load /SILENT /POST of a message to log that the user got to the finish page. Just because you mentioned it, I got rid of the define and I didn't get the duplicate run problem. So I changed to the LEAVE function and it seems to be working OK now.
soundken is offline   Reply With Quote
Old 21st December 2006, 17:34   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Well done!
That's why I've asked about. The custom function show halts the dialog thus should have strange behaviour if it's not used for a few specific reasons.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine 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