- NSIS Discussion
- Adding checkbox to welcome page + remove all subtext
Archive: Adding checkbox to welcome page + remove all subtext
hphantom
9th April 2011 05:22 UTC
Adding checkbox to welcome page + remove all subtext
Hi everyone,
I just started learning NSIS, and I wanted to ask a couple of questions.
1 - Is it possible to create a loop to remove/make blank all of the page header subtext, rather than defining: !define MUI_PAGE_HEADER_SUBTEXT '' for each page?
2 - For only the welcome page, where the "Next >" button is all the way at the bottom of the installer, I wanted to create a checkbox to the left of it where the user has an option to check it to go to the advance installation. Is there a way to do this with/out a plugin (am guessing nsDialogs? I haven't quite mastered the .ini file)? I tried ${NSD_CreateCheckbox} but then realised it would only align itself within the main section, rather than going to the footer of the installer.
Thank you very much for any/all input!
MSG
9th April 2011 06:38 UTC
Originally posted by hphantom
1 - Is it possible to create a loop to remove/make blank all of the page header subtext, rather than defining: !define MUI_PAGE_HEADER_SUBTEXT '' for each page?
2 - For only the welcome page, where the "Next >" button is all the way at the bottom of the installer, I wanted to create a checkbox to the left of it where the user has an option to check it to go to the advance installation. Is there a way to do this with/out a plugin (am guessing nsDialogs? I haven't quite mastered the .ini file)? I tried ${NSD_CreateCheckbox} but then realised it would only align itself within the main section, rather than going to the footer of the installer.
Thank you very much for any/all input!
1: No, but you can edit the MUI nsh files to change them to "". But why would you want to do this? What's so bad about putting a define in your scripts? They're all compiletime instructions, so it doesn't matter for eventual installer size or whatever.
2: The Next etc buttons are outside of the page space, so to edit it you'll have to edit the interface. You'll need to use resource editor for that (search the forums). But what you're suggesting is not really compliant with how wizard installers are supposed to look, and it's probably much easier to just create a custom page (nsDialogs).
Afrow UK
9th April 2011 14:18 UTC
I'd add the check box to the welcome page itself. You can do this using nsDialogs.
Stu
hphantom
9th April 2011 14:43 UTC
Originally posted by MSG
1: No, but you can edit the MUI nsh files to change them to "". But why would you want to do this? What's so bad about putting a define in your scripts? They're all compiletime instructions, so it doesn't matter for eventual installer size or whatever.
Short version is: very lazy. I figure if all of the sub_text require the same event happening, it'd be a smarter move to just loop through all of them rather than one at a time.
Originally posted by Afrow UK
I'd add the check box to the welcome page itself. You can do this using nsDialogs.
Originally posted by MSG
and it's probably much easier to just create a custom page (nsDialogs).
I'll give this a shot, thought might be something else as a checkbox would be in the center of the page, not at the bottom; sounds like I have some fun ahead of me!
Thanks guys~!
Afrow UK
9th April 2011 14:55 UTC
You could just destroy those static text controls using DestroyWindow in onGUIInit (set with MUI_CUSTOMFUNCTION_GUIINIT). You can find the control id's by opening up Contrib\UIs\modern.exe (dialog 105) in Resource Hacker.
Stu
hphantom
10th April 2011 03:41 UTC
I made my custom Welcome page which is looking how I want to (custom colors ftw), but I still can't seem to figure out how to get the checkbox to show up instead of the cancel. I tried not showing the cancel and replacing with a checkbox, and didn't figure that out. This is what I have now:
nsDialogs::CreateControl BUTTON ${BS_AUTOCHECKBOX}|${WS_VISIBLE}|${WS_CHILD}|${WS_TABSTOP}|${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE} 0 100 320 170 15 "Custom installation"
I tried coding the Y to go off the edge of the main section into where the cancel is, but that didn't work either. Any ideas? Thank you~!
T.Slappy
10th April 2011 06:17 UTC
It is impossible to add component apart from inner dialog area!
Window cannot hadle events outside of it's rect. For nsDialogs this rect is 300*140 (ID 1018 or 1044)
Try adding checkbox manually using ResHacker and hide it on next page.
Afrow UK
10th April 2011 15:30 UTC
Hence why I said add it to the welcome page itself. The outer dialog is NOT part of the welcome page. You cannot modify it using nsDialogs. As said already, if you must have it next to the navigation buttons (i.e. the outer dialog / $HWNDPARENT) then add it to the UI using resource hacker. Also, when working with nsDialogs, use the macros (i.e. ${NSD_Create*}.
Stu
T.Slappy
11th April 2011 06:53 UTC
Originally posted by Afrow UK
Hence why I said add it to the welcome page itself. The outer dialog is NOT part of the welcome page. You cannot modify it using nsDialogs. As said already, if you must have it next to the navigation buttons (i.e. the outer dialog / $HWNDPARENT) then add it to the UI using resource hacker. Also, when working with nsDialogs, use the macros (i.e. ${NSD_Create*}.
Stu
Yop, this is correct way, I said the same in other words, sorry I overlooked your post Afrow UK :)
Afrow UK
11th April 2011 10:56 UTC
No it's fine; that was just to build upon what we had both said for the purpose of hphantom's understanding :).
Stu