![]() |
Adding a checkbox to the MUI_WELCOME page
Hi all,
I am curious if anyone is aware of a way to add one component to a MUI page (specifically the MUI_WELCOME page). Basically, I want to add one checkbox at the bottom of the welcome page that says "Check online for updates". I could of course write a custom page just for that one checkbox, but I think it'd be cleaner to integrate it into the existing MUI welcome page. I saw the following in the manual, and I will be testing out some ideas in a few minutes: Quote:
|
I'm guessing the easiest way to do this would be to add a PRE and LEAVE function to the MUI_WELCOME page, with the PRE function adding the checkbox to the MUI_WELCOME InstallOptions file, and the LEAVE function editing it back out? Hmmm. I'll have to look at it when I get home.
|
Example
1 Attachment(s)
(Picture attached)
PHP Code:
So far, things seem fine, with one caveat: The text with the checkbox does not have the same white background as the rest of the welcome page. Example picture attached. Do I need to redraw the screen somehow? Is there a way to tell NSIS to use the same background for the checkbox as the rest of the welcome page? Any pointers would be greatly appreciated. I just have never tried to add additional components to an existing MUI page, so maybe I am missing something obvious. Anyway... any help or pointers would be greatly appreciated :) |
Use SetCtlColors on the checkbox. Take a look at Contrib\Modern UI\System.nsh, it's done there a lot.
|
Thanks!
Thanks for the help sir! :)
|
Hmm. Well, I ran into a brick wall with one of two things (I've never tried to modify a built in MUI page before).
1) Maybe I am modifying the page too early, and it's being redone by the actual MUI_WELCOMEPAGE macro. I am inserting the PRE page right before MUI_WELCOMEPAGE though. 2) I am not getting the right "hwnd" or handle for the checkbox. I'm not sure how to figure out what the handle is. I know when I use InstallOptions, the correct item is "1200 + <label> -1." But I don't think that applies to built in MUI pages. So item #4 in the inSpecial.ini file.. hmm, well, 1203 does not seem to be doing the trick (the background of the checkbox is not white. So for now, I have been unsuccessful. I am going to just insert another custom page right after the welcome page until I can figure this out :P Thanks for the help all. -J |
You could always use WinSpy (google it) to get the control's ID (near the bottom, in HEX, convert to DEC). Really useful little tool, that.
|
Thanks all, for the help. I now have it working as intended. I will do a writeup describing some of the mistakes I made, and the proper way to do this, and submit it to the Wiki or something similar.
|
Quote:
|
| All times are GMT. The time now is 17:47. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.