cgfrosty
30th July 2013 18:56 UTC
hide MUI_FINISHPAGE_RUN checkbox if condition triggered in runtime
Hello,
We need to hide MUI_FINISHPAGE_RUN checkbox if we don`t have internet connection.
We check internet connection in installation section now.
Could you help us how to hide check box if no internet connection at computer?
At this time connected = 0, not connected = 1
If hide oc checkbox is too diffucult then disable and uncheck will be not bad choice :)
Thank you very much!
Alex
demiller9
30th July 2013 19:20 UTC
I've done that with code like this:
!define MUI_FINISHPAGE_REBOOTLATER_DEFAULT
!define MUI_PAGE_CUSTOMFUNCTION_PRE FinishPage.Pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPage.Show
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION FinishPage.RunSW
!insertmacro MUI_PAGE_FINISH
...
Function FinishPage.Show
${If} $SWInstalled = 1
# good install
${If} $AnotherCheck == "specialvalue"
# check the 'Run' button and hide it
SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0
ShowWindow $mui.FinishPage.Run 0
${EndIf}
${Else}
# failed install
#custom message
SendMessage $mui.FinishPage.Text ${WM_SETTEXT} 0 "STR:A problem occurred and $(^NameDA) has not been installed on your computer. Please review the messages on the previous screen and retry the installation if necessary.$\r$\n$\r$\nClick Finish to close this wizard."
SetRebootFlag false
# uncheck 'run software'
SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_UNCHECKED} 0
# hide the checkbox
ShowWindow $mui.FinishPage.Run 0
${EndIf}
FunctionEnd