Archive: Minimalist installer: Changing the dialog size and bg color


Minimalist installer: Changing the dialog size and bg color
I'm attempting to create simple, minimalist installer. That is, it's a simple white window with a single logo in the upper right corner, the usual fields, and three buttons along the bottom. It eliminates the big graphics on the Welcome and Finish pages.

Playing with MUI and MUI2 seemed to be getting me nowhere, as their designed to mimic InstallShield, MSI, and other well known installers. It occurred to me that it would be simpler to just eliminate the Modern UI (and any of the addon UIs) and return to the simple NSIS natural page look and customize from there.

Eliminating the old-fashioned icon at the top right was easy. What I'm having trouble with, though, is setting the page background color to white, and altering the size. (I did manage to create generous margins by using AddBrandingImage without defining any images.)

There's the "SetCtlColors" command which seems to be undocumented. (Or, more likely, is just not where I'm looking for it.) Will that help me? And, if so, where can I find a description and examples?

Secondly, how does NSIS decide the size of the dialog boxes? Is there an easy way to force a fixed size?

Thanks in advance for your help.

Michael


OK, I'm a whiner. :) I found the docs for SetCtlColors (right under my nose!) but it's still not clear how I would change the BG color of an entire dialog, or better yet, the standard bg color for all dialogs.

Is there a really clear writeup somewhere?

Thanks!
Michael


Are you looking for InstallColors?


Thanks for the suggestion... I'm not sure what InstallColors changes, but it doesn't seem to change the overall color of a dialog box. Or I'm not doing it right.

(The docs are vague. Does it change the color of the install details window?)

What I'm looking for is to change the background color of the entire dialog box from the normal Windows tan color to bright white. (And, of course, have all the gadgetry within the dialog also match.)

Michael


I've reread the description, and it is not what you are looking for. It will set the colors in the details list box. I don't see a command to change the dialog background.


Sigh. Thank you for looking for a solution! There's got to be a way to do this...

Michael


I don't think you'll find it easy to 'theme' your installer this way - probably easier to hack the resource file instead?

Here's an example that does the outer and inner dialog.. thing is, you'll also have to do all the labels.. and buttons.. and those sometimes refuse to change, and they'll still keep the grey 3d colors, and so forth.


OutFile "test.exe"

Section ""
FindWindow $0 "#32770" "" $HWNDPARENT
SetCtlColors $HWNDPARENT 0xFFFFFF 0x00FF00
SetCtlColors $0 0xFFFFFF 0x00EE00

ShowWindow $HWNDPARENT 0
ShowWindow $HWNDPARENT 1
SectionEnd

Thanks, Animaether! That's a useful code fragment, but I'm guessing you're correct about the difficulties.

So here's the next question: I downloaded ResHacker and tried messing around with the default.exe. (NSIS\Contrib\UIs\default.exe) When I compiled an installer that didn't use MUI -- that is, no Modern UI includes, macros, defines, etc., a "naked" installer -- I was surprised to see that none of my changes were present. Is there something I need to do in order to make my changes "stick"? Or am I simply editing the wrong file?

Thanks again for your help!
Michael


ChangeUI


OK, for the record, I was able to achieve my goal, by a more roundabout route.

I tried the different alternate UIs. Most choked when I ran them through reshacker, and I'm not enough of a hacking stud to figure out why. (Though one guess is that the UIs are fairly old, so perhaps they don't work well with recent NSIS builds.) Finally, I downloaded UltraModernUI, which has a fresh build out and a lot of forum activity. To my delight, I could adjust things with ResHacker and it actually worked. Combined with a special "white" skin, which changes all the colored graphics to white squares, and it worked.

(Well, almost. There's one little bit of weirdness that I'll bring up on the UMUI thread, but it's relatively minor.)

Of course, if I were feeling *really* ambitious, I would have coded my own using nsDialogs, but I've already spent too long on this project as it is.

Thanks again to everyone who offered suggestions!
Michael