Old 12th October 2013, 11:24   #1
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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?
winman2004 is offline   Reply With Quote
Old 12th October 2013, 15:11   #2
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
!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} ""

PostEnd:
aerDNA is offline   Reply With Quote
Old 15th October 2013, 04:54   #3
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
Quote:
Originally Posted by aerDNA View Post
!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.
winman2004 is offline   Reply With Quote
Old 15th October 2013, 10:51   #4
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
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

PostEnd:
aerDNA is offline   Reply With Quote
Old 15th October 2013, 11:06   #5
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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.
winman2004 is offline   Reply With Quote
Old 15th October 2013, 11:15   #6
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
It doesn't cause any problems.

PostEnd:
aerDNA is offline   Reply With Quote
Old 15th October 2013, 17:03   #7
redxii
Senior Member
 
Join Date: Nov 2005
Posts: 115
What about using '.onInstSuccess'? Put your command there.
redxii is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump