Skip to content
⌘ NSIS Forum Archive

Finish Page Background color

11 posts

dc_dweller#

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#
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
Afrow UK#
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#
It actually is in the MUI2 manual:
2. Interface configuration -> Interface settings -> Page header
dc_dweller#
The line

!define MUI_BGCOLOR FF0000

generates compile error

!define: "MUI_BGCOLOR" already defined!
Error in script.... -- aborting creation process
dc_dweller#
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#
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#
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