I wrote a simple install script with no custom pages and no custom .ini files.
This is the problem: immediately after all the files have been copied by the INSTFILES page, the "Finish" button becomes available but it takes another 3-4 seconds before the FINISHPAGE appears. This is troublesome because the users may click the Finish button before having a chance to choose whether they want to run the application or not by (un)checking a checkbox I put in the finish page. I also put a secondary checkbox in the finish page that lets the users decide if they want a desktop shortcut or not.
I tried messing with these two lines of code putting them here and there but with no results:
ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
Here is some code inside my install script:
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Create a shortcut"
!define MUI_FINISHPAGE_RUN_FUNCTION "lnkdesktop"
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Run ${PRODUCT_NAME}"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION "runfile"
Function "runfile"
Exec "$INSTDIR\${PRODUCT_EXECUTABLE}"
FunctionEnd
Function "lnkdesktop"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" "" "$INSTDIR\${PRODUCT_EXECUTABLE}" 0
FunctionEnd
!insertmacro MUI_PAGE_FINISH