Archive: Finish page runs the executable multiple times


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.


Re: Finish page runs the executable multiple times
What is the purpose of that "!define MUI_PAGE_CUSTOMFUNCTION_SHOW postStage" ?


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.


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.