winman2004
12th October 2013 12:24 UTC
Run application compulsorily after install
In my setup i have finish page done by using !insertmacro MUI_PAGE_FINISH . I have also used !define MUI_FINISHPAGE_RUN "$INSTDIR\setup.exe" which run the application if the user selects the checkbox in finish page. I think it is the default behaviour of finish page. But i want the application to run compulsorily after install if a certain command line is passed.otherwise it should work normal as before. So how it can be done?
aerDNA
12th October 2013 16:11 UTC
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPage_Show
!insertmacro MUI_PAGE_FINISH
Function FinishPage_Show
StrCmp $Something "Something" 0 +2
ShowWindow $mui.FinishPage.Run ${SW_HIDE}
FunctionEnd
If you use MUI_FINISHPAGE_RUN_NOTCHECKED, you also need:
SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} ""
winman2004
15th October 2013 05:54 UTC
Originally posted by aerDNA
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishPage_Show
!insertmacro MUI_PAGE_FINISH
Function FinishPage_Show
StrCmp $Something "Something" 0 +2
ShowWindow $mui.FinishPage.Run ${SW_HIDE}
FunctionEnd
If you use MUI_FINISHPAGE_RUN_NOTCHECKED, you also need:
SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} ""
I included ShowWindow $mui.FinishPage.Run ${SW_HIDE} in FinishPage_Show show function but it didnt work. It is working as before. what else i need to change?
I need the checkbox to be ticked and user cannot change it if a particular command line was passed.
aerDNA
15th October 2013 11:51 UTC
If it didn't work, it probably means you are using MUI1 (MUI.nsh). In that case, there's no $mui.FinishPage.Run (a MUI2 var), you need to get the checkbox hwnd yourself:
ReadINIStr $0 "$PLUGINSDIR\ioSpecial.ini" "Field 4" "HWND"
The rest is the same. If you don't want the checkbox hidden, just disabled, use: EnableWindow $0 0
winman2004
15th October 2013 12:06 UTC
i can use ShowWindow and hidden that checkbox? Does it cause any problem?
Also what is Field 4 in ioSpecial.ini? i checked my ini and there was no Fielid 4 . But your solution works perfectly.
aerDNA
15th October 2013 12:15 UTC
It doesn't cause any problems.
winman2004
15th October 2013 12:25 UTC
Originally posted by aerDNA
It doesn't cause any problems.
Ok. But can u tell me what is that Field 4?
aerDNA
15th October 2013 12:26 UTC
MUI1 uses InstallOptions for the Welcome/Finish page and ioSpecial.ini is where the page elements are defined. You couldn't see Field 4 (the Run checkbox) probably because you were looking too early; take a look once the Finish page is displayed.
redxii
15th October 2013 18:03 UTC
What about using '.onInstSuccess'? Put your command there.