Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Run application compulsorily after install (http://forums.winamp.com/showthread.php?t=373022)

winman2004 12th October 2013 11:24

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 15:11

!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 04:54

Quote:

Originally Posted by aerDNA (Post 2969925)
!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 10:51

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 11:06

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 11:15

It doesn't cause any problems.

winman2004 15th October 2013 11:25

Quote:

Originally Posted by aerDNA (Post 2970331)
It doesn't cause any problems.

Ok. But can u tell me what is that Field 4?

aerDNA 15th October 2013 11:26

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 17:03

What about using '.onInstSuccess'? Put your command there.


All times are GMT. The time now is 17:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.