need second checkbox for modern UI license page
I would like to add a second checkbox to the Modern UI license page to force users to check both boxes before enabling the next button. Anyone know how to do this?
Archive: need second checkbox for modern UI license page
need second checkbox for modern UI license page
I would like to add a second checkbox to the Modern UI license page to force users to check both boxes before enabling the next button. Anyone know how to do this?
No this isn't possible without a plugin or modification to the NSIS source.
Edit: This is an idea for a plugin that I shall write.
In new installers now, you can only continue by scrolling to the end of the license first.
-Stu
It's better to add a control RichEdit to InstallOptions than creating useless plugins for just the purpose. It would make much easier to customize license pages.
I don't care how it's written, I just need this functionality to satisfy the attorney. Doing a hack job is just fine for this project.
I was able to create a second checkbox on the license page, but the checkbox caption from the resource file went away. Obviously I need to hack the code even more. Can someone point to where in the source the caption for the checkbox is actually written to the dialog?
It's no good adding another check-box with Resource Hacker because you can't apply a notify function on it (so that it actually does something).
You can however do as deguix suggests and create an InstallOptions page. You'd probably have to use InstallOptionsEx which you'll find on this forum to use a RichEdit control.
-Stu
I'm working with the sources. No resource hacker needed. I created the second checkbox by making a new Contrib\UIs\modern.exe using the Contrib\UIs\UI Holder project. If I could find out where this gets processed in the source code, I might be able to make the changes I need.
What would you need the second check-box to say? Would you want the two side by side? I've finished writing the plugin to disable the next button until the user has finished scrolling, and I thought I could add your feature too if it's worth it (and if other people would benefit?)
-Stu
Here are my two checkbox statements.
-I have read and do understand the terms and conditions of this EULA.
-I agree to these terms and conditions.
I thought the second checkbox would be below the first, possibly shortening the height of the license text box to make room for it.
I think this along with the page down requirement on the text would satisfy most attorneys :D
Ah that makes sense. They have that on a lot of commercial game installers now too. I have nothing else to do now (was headbanging on Friday so I've got a screwed neck) so I'll add this. I'll also add some plugin parameters which allow you to set the check-box text as well.
-Stu
I've got everything to function correctly, except I can't get it to put the new check-box in the right place because GetClientRect returns 0 for x and y coords. I need to get the x and y coords of the old check-box relative to the child window.
I'll probably end up using some dodgy hack-up job for this.
-Stu
Nearly finished. Modern UI has another label on there which tells you that you need to click the "Agree" check-box. Shall I get rid of it (as we now have two check-boxes)?
-Stu
Never mind, I kept the label as it actually still made sense.
Took longer than I thought it would, because I couldn't find a hard-coded way to get an x and y coor of a control.
I ended up adding all the heights of the controls down to where I wanted to put my new check-box (not a very clean way to do it).
Anyway, it works for both Modern UI and default UI which is the main thing.
Also works for:
LicenseForceSelection off
LicenseForceSelection checkbox
LicenseForceSelection radiobuttons
http://nsis.sourceforge.net/wiki/File:ScrollLicense.zip
Readme included and two examples.
-Stu
I just installed ScrollLicense and it worked like a champ first try! Excellent work!! Thank you very much!!!
One testing note: After I hit next (after scrolling and checking the boxes) if I hit back to go back to the license page, it shows only one checkbox. Not a big deal, but might be an easy fix.
Ah yes... I'll fix that now.
This will have to be my last plugin for a while because I've got some work to do on a project of mine.
Edit: Uploaded (v0.2)
-Stu
I tested the new version and it works great. I did find another issue that happens if you hit the back button on the license page and then hit the next button to go to the license page again. If the text hasn't scrolled to the bottom, the checkboxes are disabled and you can't set them. If the text did scroll to the bottom, then both checkboxes are set.
This issue is very minor, and the plugin works great as is. Thanks again.
I've fixed that now too.
Uploaded v0.3
-Stu
How can you make sure it unloads and thus gets deleted at the end of the installation ?
I tried just calling it with...
ScrollLicense::Set /CHECKBOX
and
ScrollLicense::Set
...but both just crash the installer.
Another thing...
If you go Back a page and then Next to the License page again, the checkbox(es) never become enabled; i.e. they stay greyed out.
My current work-around involves disabling the Back button on the license page so that a user simply can't do the above.
I have a fix for the DLL Unloading, but I could not reproduce the second bug that you mentioned. cyrusazar mentioned this in his last post (a few posts up) and I should have fixed this in v0.3
-Stu
Whoops... I can't read. Or rather, I confused it with his post before that (Next > Back | checkbox disappears). I guess that still means I can't read :)
Is there anything we could do to help find out what's happening with that issue ? Doesn't seem like Sysinternals has a "Call Monitor" ;)
The unload fix would be awesome - though I don't mind the orphan directories *too* much, given that it is in a temp location.
Still unable to reproduce.
Try downloading v0.4 (which has the Unload function added).
http://nsis.sourceforge.net/wiki/File:ScrollLicense.zip
Try the examples to see if they reproduce the problem (in Contrib\ScrollLicense).
-Stu
Happens with bot the example scripts as well...
The prerequisite appears to be that you need to be using /CHECKBOX.
E.g.
works fine :
ScrollLicense::Set /NOUNLOAD
ScrollLicense::Set /NOUNLOAD /CHECKBOX
LicenseForceSelection radiobuttons
ScrollLicense::Set /NOUNLOAD
LicenseForceSelection radiobuttons
ScrollLicense::Set /NOUNLOAD /CHECKBOX
LicenseForceSelection checkbox
ScrollLicense::Set /NOUNLOAD
checkboxes remain disabled after Back > Next :
LicenseForceSelection checkbox
ScrollLicense::Set /NOUNLOAD /CHECKBOX
Ah finally I got the problem too :)
I'll try and fix it now.
-Stu
Fixed, thanks :)
http://nsis.sourceforge.net/wiki/File:ScrollLicense.zip
-Stu
Confirmed :) Glad I could help out
hey, this is a really good idea! imho such "feature" should be officially built in. good job! :)
c ya,
nco2k
there is only one more thing.
the text "If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to install XYZ." is a little bit confusing because there is no "I Agree" button.
can i somehow remove the first textpart, so that only "You must accept the agreement to install XYZ." is left or maybe even better, change it to "If you accept the terms of the agreement, click Next to continue. You must accept the agreement to install XYZ." ??
c ya,
nco2k
Thanks :)
-Stu
if you're using MUI:
!define MUI_LICENSEPAGE_TEXT_BOTTOM "If you've read, understood and agree to the terms of the agreement, click the checkboxes below.$\r$\nYou must accept the agreement to continue installation. Click Next to continue."
great, thanks for your help! :)
c ya,
nco2k