Skip to content
⌘ NSIS Forum Archive

Changing colors or MUI2 based installer, almost perfect except...

7 posts

Marbled#edited

Changing colors or MUI2 based installer, almost perfect except...

... the color change only works the first time...

If I click "next" and then go back to the page the colors are the original ones.

Is there anyway to fix this?

I did it by defining a MUI_PAGE_CUSTOMFUNCTION_SHOW as described here:
Demonstrating_Page's_Custom_Functions_Pre_Show_Leave

Thank you and have a nice day!

Nick
Marbled#
OK, apparently the way I changed colors would be appropriate for MUI1 but not MUI2...

I am still searching for the right way to do it with MUI2...

Nick

PS: By the way, I was tempted to delete my message when I found out this wasn't the right way to do it but could not figure out how to do it. I guess it might no longer be possible once a mod edit the message but I am pretty sure Anders hadn't yet edit my message when I tried...
Anders#
I assume you are talking about the welcome page?

There was a bug with how it finds the inner dialog. I fixed it and updated the wiki page...
Marbled#
Oops, you are right, I forgot to mention which page I wanted to change the color of...

Yes, it is the welcome page...

I found MUI_BGCOLOR could change the color of the background too but it does it for all the pages and I only want to change the color of the welcome page.

MUI_PAGE_CUSTOMFUNCTION_SHOW with FindWindow did the job but not if I went back...

MUI_PAGE_CUSTOMFUNCTION_SHOW with "StrCpy $1 $MUI_HWND" doesn't work for me (with MUI2 at least).

By the way, the forum mangles the URL in my first message...

Thank you and have a nice day!

Nick
Anders#
No it does not work with MUI2 but the wiki page uses MUI1. For MUI2 the handle is $mui.WelcomePage but the FindWindow call might work there, I don't know. With MUI2 you can also go straight for things like $mui.WelcomePage.Text without GetDlgItem...
Marbled#
Hi Anders!

Thank you!

I had actually figured it out and was replying to myself before I saw your update...

What I ended up doing is

Function wel_show

StrCpy $1 $mui.WelcomePage
SetCtlColors $1 '' '0x009CD6'

StrCpy $2 $mui.WelcomePage.Text
SetCtlColors $2 '0xFFFFFF' '0x009CD6'

StrCpy $2 $mui.WelcomePage.Title
SetCtlColors $2 '0xFFFFFF' '0x009CD6'

FunctionEnd
This seems to be the best way to do what I want to do short of recopying the code in Welcome.nsh....

Thank you very much and have a nice day!

Nick
JasonFriday13#
Just an improvement, you don't need to use StrCpy. You can use the MUI variable directly since SetCtlColors doesn't write to variables.