Archive: Custom License Dialog


Custom License Dialog
  Hi,

I need to display a custom license dialog for a 2-step license accepting process. The first step (the custom one) asks the user if they understand the license before pressing next, then the next step is the standard acceptence dialog.

Is there a way to override the text in the labels and buttons just for the default license dialog? Keeping in mind I'll want to use the defaults on the next step as well. If not, what would be the custom .ini settings to duplicate the license dialog? And how would the license be read into the label box?

Thanks.


Currently there is no way to show two different license pages (the buttons would be easy to change but the license text itself would not change with NSIS scripting alone). If the text is not too long you can put it in an IO text field, or a label. For example:

[Field 3]
Type=Label
Left=...
Right=...
Top=...
Bottom=...
Text=license text here\r\ncontinue....\r\nyet another line...


IO doesn't support RTF.

Putting two or more different license pages in one installer should be avaiable soon, before NSIS 2 final is released.

Right.. I don't want to change the license text between the two pages. How can I change the button text from "Accept" to "Next" on the first step?

Thanks.


If you don't want to change the licesne text itself use:

!include WinMessages.nsh


Page license"" licCallBack
Page license
># ... other pages

>Function licCallBack
GetDlgItem$0 $HWNDPARENT 1 # next button hwnd
SendMessage $0 ${WM_SETTEXT} 0 "STR:I understand"
# other buttons...
GetDlgItem $1 $HWNDPARENT 1018 # inner rect hwnd
GetDlgItem $0 $1 1006 # license label hwnd
SendMessage $0 ${WM_SETTEXT} 0 "STR:read and understand"
>FunctionEnd

># sections, other functions...
To get other id numbers of dialog controls (to use with GetDlgItem) use Resource Hacker or another resource editor and open default.exe in Contrib\UIs.

That's great. Although no text shows up below the box where the license is displayed where "If you accept all of the terms..." usually shows up, even when I comment out the last three statements of the function. Was that were "read and understand" was supposed to appear?
Thanks.


Add:

!insertmacro MUI_INNERDIALOG_TEXT 1040 $(MUI_INNERTEXT_LICENSE_BOTTOM) 
And it should be set. This is taken from System.nsh, that's how the MUI sets this text. You can use this macro to do the above too. First parm is the the control id and the second is the text itself (a LangString in the case).

Great, thanks a lot.


Is there somewhere where the dialog ID's are documented? I'd like to reuse the license dialog for a dialog that summarizes what's about to take place during the install and would like to override the license text dynamically, do you have any suggestions for how to do that?

Thanks.


To get other id numbers of dialog controls (to use with GetDlgItem) use Resource Hacker or another resource editor and open default.exe in Contrib\UIs.
As far as I am aware this is the only way you can find out the ID numbers.

There's only 7 of them there ranging from 102-111, that doesn't really tell me why 1040 is the lower text in the license page.

Thanks though.


102 is the license dialog, inside 102 you can find the numbers you are looking for. Just open the 102 "folder", click on 1033 (English) abd then you'll have all of the numbers you want.