- NSIS Discussion
- Finish Page Background color
Archive: Finish Page Background color
dc_dweller
1st May 2010 01:34 UTC
Finish Page Background color
Hi all,
I use MUI, and the Finish page looks different than all other pages NSIS generates. The Finish page's background is white while the other pages are grayish.
The following code does not seem to make any difference:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow
!insertmacro MUI_PAGE_FINISH
function FinishShow
FindWindow $1 "#32770" "" $HWNDPARENT
SetCtlColors $1 0xFF0000 0x00FF00
functionend
Any help would be appreciated.
-- DC Dweller
Afrow UK
1st May 2010 10:35 UTC
Are you using MUI or MUI2?
Stu
dc_dweller
1st May 2010 14:37 UTC
Mui2.
Afrow UK
1st May 2010 14:43 UTC
The finish page is actually made with nsDialogs and MUI has a $mui.FinishPage variable which contains the handle to the dialog. Before you try that, have you defined MUI_BGCOLOR?
Stu
dc_dweller
3rd May 2010 01:09 UTC
Stu, what's the exact syntax please? I am still struggling with the NSIS language.
Afrow UK
3rd May 2010 10:54 UTC
I assumed it was in the Modern UI manual but it isn't. It's definitely used in the code so try: !define MUI_BGCOLOR XXXXXX.
Stu
jpderuiter
3rd May 2010 13:02 UTC
It actually is in the MUI2 manual:
2. Interface configuration -> Interface settings -> Page header
dc_dweller
3rd May 2010 20:34 UTC
The line
!define MUI_BGCOLOR FF0000
generates compile error
!define: "MUI_BGCOLOR" already defined!
Error in script.... -- aborting creation process
dc_dweller
3rd May 2010 20:39 UTC
The line
!define MUI_BGCOLOR FF0000
generates compile error
!define: "MUI_BGCOLOR" already defined!
Error in script.... -- aborting creation process
So I did this:
!undef MUI_BGCOLOR
!define MUI_BGCOLOR FF0000
Now the header of each dialog (but not the main body) is red and the finish page is also red. So I guess my question is, how do I change the Finish page in such a way that it looks the same as the other pages (same look and feel, and same color.)
Afrow UK
3rd May 2010 21:08 UTC
You will get that if you try and define it more than once in the same script or if you define it after inserting the page macros (all interface settings must go before any page macro insertions).
If you want to have different colours for the welcome and finish pages then use SetCtlColors in a custom show function on $mui.WelcomePage and $mui.FinishPage respectively.
Stu
dc_dweller
3rd May 2010 21:20 UTC
This finally worked fine:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow
!insertmacro MUI_PAGE_FINISH
function FinishShow
SetCtlColors $mui.FinishPage /windows
GetDlgItem $0 $mui.FinishPage 1201
SetCtlColors $0 /windows
GetDlgItem $1 $mui.FinishPage 1202
SetCtlColors $1 /windows
GetDlgItem $1 $mui.FinishPage 1203
SetCtlColors $1 /windows
functionend