|
|
#1 |
|
Junior Member
Join Date: May 2003
Posts: 2
|
Two License Pages
Hi,
I'm very new to NSIS and I'm trying to figure out how to make an installer that displays 2 license pages that follow each other using Modern UI. I tried something like code: but it does not seem to work. Could someone help me with this issue?? One more question: Can I somehow display RTF files in the license box? It's not really necessary, but it would be nice to have. Thanks for the great installer, btw.!! Greets, Daniel |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
i am not sure - this might same problem with an additional readme section which is on the to-do-list.
search the forum for "readme" and you will find no answer ;( # i forgot there exist a extlicense.dll or so - i found the SC on this site, but no DLL - dont know how to compile Greets, Brummelchen |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You will need to do the following:
code: You now need to get the License text on one line into the command, and you also might need to get the right dialog number (currently 102) However, I think I have the right dialog number there? Change the dialog number until the license text within the window changes. -Stu |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
grmph - nice solution from the cvs i guess?
when will cvs go final
Greets, Brummelchen |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2003
Posts: 2
|
Hi,
Thanks for your answer. I'm almost there! I now get the license page twice, but unfortunatly both time with the same license. When I compile the NSI I get the warning: code: I don't quite understand. Perhaps you could have a look at the script? Thanks in advance, Daniel |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Try
!define MUI_CUSTOMFUNCTION_LICENSEPAGE_PRE LicenseText instead of !define MUI_CUSTOMFUNCTION_LICENSE_PRE LicenseText -Stu |
|
|
|
|
|
#7 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
FindWindow, GetDlgItem and SendMessage are all present in b3 too.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#8 | |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Re: Two License Pages
Quote:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Will LicenseData ever become a non compiletime command?
I mean, so that it can be used multiple times to change the LicenseData on multiple LicensePages. That would be a helpful feature. -Stu |
|
|
|
|
|
#10 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Yes.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#11 |
|
Senior Member
|
hi!
i have a similar problem... i need to show 2 licence pages. i followed the steps (as explained in this tread), and i have 2 license pages, but with the same content (from LicenseData "txt.txt"). i have no errors or warnings. help ! thanks. |
|
|
|
|
|
#12 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Attach the script and I'll have a look.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#13 |
|
Senior Member
|
here is my script:
maybe it would be usefull to others to... |
|
|
|
|
|
#14 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Change:
GetDlgItem $1 $0 102 #change to: GetDlgItem $1 $0 1000 You will also need a way to determine that the LicenseText function was called for the right page, as it will be called for both the license pages. You should probably set a variable to 1 in the page's leave function and then if it's set in the pre function change the text and reset the variable. This way you will only see the first license when the variable is not set which is when the user comes back from the second page to the first page. I'm assuming here that the two pages come right after the other, as in your script. If this is not the case anymore you will have to set the variable in other pages too to know which page you should show next. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#15 |
|
Senior Member
|
i changed "GetDlgItem $1 $0 102 #change" with "GetDlgItem $1 $0 1000" but i still have 2 pages with the text from LicenseData displayed.
thanks. |
|
|
|
|
|
#16 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Hmm... Right. The window hasn't been created yet. You should use it in the show function not the pre function.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#17 |
|
Senior Member
|
a little help please!
where to put the variable ? in what section ? i must create a new one ? and in what section to check the state of the variable, and change it ? and the most important ! how do i declare one ? thanks. |
|
|
|
|
|
#18 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Not a section, in the pre/show/leave functions of the pages. You don't need to declare one, just use $0, $1, ..., or $R9. This variable is meant for the LicenseText function to know in which page it is so it won't show the same text on both pages. In your case setting it on the leave function of the license page and clearing (and checking) it in the show function should be enough.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#19 |
|
Senior Member
|
sorry. i do not understand.
maybe with an example ? a little one ? |
|
|
|
|
|
#20 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
I have used the same pre, show and leave functions for both of the license pages because that's how it works with the MUI.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#21 |
|
Senior Member
|
i will try tonight. thanks very much. i'll tell you tomorow the result.
thanks again. |
|
|
|
|
|
#22 |
|
Senior Member
|
hi!
i tried and tried and finaly it works. but one big question: the first license page displayes "LicenseData" while for the second one i have to write manualy in the script every line. but what if i have a license about 10KB ? is it posible to display in the second page too, the license from a file ? thanks again! |
|
|
|
|
|
#23 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Use this instead of the SendMessage ${WM_SETTEXT} command:
code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#24 |
|
Senior Member
|
it works. thanks.
then it should work for 3 licenses too ? |
|
|
|
|
|
#25 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
If you apply the right checking in the show and leave functions. It shouldn't be too hard, just keep in mind that the leave function is only called when the user clicks next and not on back or cancel.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#26 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
@kichik
same problem here - i have no idea - not familiar with this: code: I get twice the License-Page with nail [x] and when i reached the compo-page and step one step back i get my readme in a small (license) window and a nail. step back once more and repeat from license page same procedure. ![]() ## second problem - i get no option for the readme at the end. cvs-problem? 2b3 did so. Or just again the MUI? Greets, Brummelchen |
|
|
|
|
|
#27 |
|
Senior Member
|
try changing like this:
FileOpen $1 "readme.txt" "r" to FileOpen $1 "$PLUGINSDIR\readme.txt" "r" and you must have this: Function .onInit InitPluginsDir File /oname=$PLUGINSDIR\readme.txt "readme.txt" FunctionEnd hope it will help |
|
|
|
|
|
#28 |
|
Senior Member
|
for kichik,
i tried (for the 3rd license page) but no result. so for the moment it will remain so. |
|
|
|
|
|
#29 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Can you attach the script?
|
|
|
|
|
|
#30 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Brummelchen, please attach large scripts from now on. o_owd answer is correct, you have to extract the file first and use full path.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#31 | |
|
Senior Member
|
for Joost:
Quote:
|
|
|
|
|
|
|
#32 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
does not work so far
![]() After MUI_PAGE_WELCOME MUI_PAGE_LICENSE image Page license "" "showLicense" "leaveLicense" image MUI_PAGE_COMPONENTS image then back to Page license image and so on ... i always get the correct readme when i step back. script is attached so far (sorry for inconvenience) Greets, Brummelchen |
|
|
|
|
|
#33 |
|
Senior Member
|
i don't know why it does not display the borh license pages.
try with this script. (it works in my script) |
|
|
|
|
|
#34 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
Greta move - u da man
![]() it works. i have made a little change to get different pageheaders > Page license "" "showLicense" "leaveLicense" > Page license "" "showLicense1" "leaveLicense" but one little teardrop > !define MUI_LICENSEPAGE_CHECKBOX no checkbox so far Greets, Brummelchen |
|
|
|
|
|
#35 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Brummelchen, you have to use the MUI macros all the way if you are using the MUI. Using Page as a replacment for the MUI_PAGE_LICENSE macro is what causing you all of the problems above.
o_owd, please attach the script, or describe the logic you've tried to include 3 license pages. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#36 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
@kichik
> !define MUI_LICENSEPAGE_CHECKBOX exist there a MUI macro for that? > or describe the logic you've tried to include 3 license pages. I made an example to this, i hope that helps - it is based on the script from o_owd The MUI section must be like this > Page license "" "showLicense" "leaveLicense" > Page license "" "showLicense1" "leaveLicense" > Page license "" "showLicense2" "leaveLicense" ... the first function is reduced 'cause it only displays the normal license.txt Greets, Brummelchen |
|
|
|
|
|
#37 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
No, "Using Page as a replacment for the MUI_PAGE_LICENSE macro is what causing you all of the problems above. "
MUI_LICENSEPAGE_CHECKBOX is a MUI define and is OK, but worth nothing if you don't use the MUI macro to insert the license page. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#38 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
@kichik
So there is no alternative for that? Not a problem at all - the checkbox is only preventing from "klick - klick - klick - installed" must be "klick - read - check - klick - installed" ![]() But the other way dont work. Is it possible to get the checkbox additional from InstallOption? Greets, Brummelchen Last edited by Brummelchen; 4th June 2003 at 21:27. |
|
|
|
|
|
#39 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
The other way is the only right way and it can work, you only need to find the right logic to make it show the right license in the right page. The logic implemented in my examples works for two pages that come one after the other. If you have another case you'd have to find another logic and implement it.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#40 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
>> you only need to find the right logic to make it show the right license in the right page. The logic implemented in my examples works for two pages that come one after the other.
Thats what i am doing to - Welcome/license/readme but so far i have no check button only the "accept" button. to prevent misunderstandings... you have a solution for that (2pages with check button) or not? Greets, Brummelchen |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|