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.