简体   繁体   中英

NSIS question : Can I disable the “Finish” button in “MUI_PAGE_FINISH” page when the “.onInstSuccess” function not finish?

I use NSIS to package my application, and I need to install some third party software, like.Net re-distribution, run-time engine in ".onInstSuccess" function. But after install finish, the "MUI_PAGE_FINISH" page will display and start to call ".onInstSuccess" function. If user click the finish button in "MUI_PAGE_FINISH" page when ".onInstSuccess" function still running, that will be not fully install third party software. Can I disable the finish button and re-enable it after ".onInstSuccess" function finished? enter image description here

You should only install things in Section s, When the InstFiles page is done. your install should be fully functional. Make sure you are using ExecWait and the correct command line parameters (silent/wait etc.) when installing redistributable libraries.

.onInstSuccess is called after the last page and you are not really supposed to interact with the UI nor perform operations that take a long time.

!include MUI2.nsh
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English

Function .onInstSuccess
GetDlgItem $0 $hWndParent 1
EnableWindow $0 0
Messagebox mb_ok "Performing a long operation here even though you are not supposed to..."
EnableWindow $0 1
FunctionEnd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM