- NSIS Discussion
- License File
Archive: License File
Pravin
19th October 2010 12:56 UTC
License File
Hi all,
Im working on Localization of my installer.
my page flow is as follows.
1.welcome
2.license
3.custom page. ( i have created my own directory page)
4.custom page..
5...
...
8.finish page
Issue:
Im using the following code
FindWindow $HWND"#32770" "" $HWNDPARENT
GetDlgItem $R4 $HWND 1207
SendMessage $R4${WM_SETTEXT} 1 "STR:$(HELLO)"
1.The above code works fine when i dont include license page.
2.The above code doesnt work if i have license page before my custom page.
I removed my license page and introduced welcome page again and tested it. It works fine.
i guess the issue is in identifying the parent window.
Suggestion please.. Thanks in advance.
Netsurfer24
19th October 2010 13:39 UTC
There is a very simple way of using a multi-language license (file): http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.15.3
Or do it like on any other page by using LangString:http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.15.3
BTW: Searching the (linked) scripting reference may help you to solve such problems within minutes ... :D
Also using Google (if you have an idea of the search words) might often be better than the forum search (especially when searching for commands).
Gunther
Pravin
19th October 2010 13:52 UTC
Hi gunther ,
Nice to see your reply again for my new post :)
But my issue was not in usage of a multi-language license . Please read it again. If it is not clear will try to explain.
As u said.. when ever i find issue i'll try solving by myself. But if the deadline is near.. i google it.. if it is very near I post in forum :P
Afrow UK
19th October 2010 13:57 UTC
You have omitted some quite important information. Where are you using this code? Are you using nsDialogs or InstallOptions? To me it looks like InstallOptions. If that is the case, just write the language string to the INI file itself. If it is nsDialogs you should be using the control handle returned on the stack.
Stu
Netsurfer24
19th October 2010 14:06 UTC
Hi,
Originally posted by Pravin
But my issue was not in usage of a multi-language license . Please read it again. If it is not clear will try to explain.
upps ..., sorry - my bad. :confused:
OK, now I read it again ...
For debugging: Add a message box right after "GetDlgItem $R4 $HWND 1207" and see if you got a valid handle in $R4 or if it is 0).
What page are you on at this stage?
Are you sure there is an object with the ID 1207?
Gunther
Pravin
19th October 2010 14:58 UTC
To Afrow
1.Where are you using this code?
2.Are you using nsDialogs or InstallOptions?
1. Im using the code in function which belongs to page.
2. You are right Im using InstallOptions.
Pravin
19th October 2010 15:02 UTC
TO gunther
Are you sure there is an object with the ID 1207?
IF object doesnt exist how come it works fine if i omit the "LICENSE PAGE"
As i mentioned earlier it works fine if i omit the license page in the installer and insert my custom page with the above code.
But it doesnt work if License page is my previous page of the custom installer.
( Since it works fine when i remove LICENSE page, so I assume my code is fine. But this may not be true )
Pravin
19th October 2010 15:06 UTC
TO gunther
Are you sure there is an object with the ID 1207?
IF object doesnt exist how come it works fine if i omit the "LICENSE PAGE"
As i mentioned earlier it works fine if i omit the license page in the installer and insert my custom page with the above code.
But it doesnt work if License page is my previous page of the custom installer.
( Since it works fine when i remove LICENSE page, so I assume my code is fine. But this may not be true )
Now for time being till the issue is fixed I have omitted
;!insertmacro MUI_PAGE_LICENSE "E:\Program Files\license.txt"
and I have created my own custom license page but the issue is For Text Box where i display the license agreement i dont get scroll :D
Pravin
19th October 2010 15:11 UTC
To Afrow
If that is the case, just write the language string to the INI file itself. If it is nsDialogs you should be using the control handle returned on the stack.
1.I dont understand writing Language String to the INI file.Can u explain me
Afrow
2.I have not tried nsDialogs so far. Will give a try.
Pravin
19th October 2010 15:13 UTC
1How to delete the post created by us.
2.How to include the string "Originally Posted by" along with the person's name in the quote.
Afrow UK
19th October 2010 17:49 UTC
You can't delete posts. You can only edit them and within a limited time after posting. Use the INSTALLOPTIONS_WRITE macro. I'm not sure why your code stops working with a license page but using FindWindow to get the custom page's handle isn't the way to go. You Pop the handle after InstallOptions::InitDialog, just like you Pop the handle after nsDialogs::Create.
Stu
Pravin
21st October 2010 08:04 UTC
Thanks Afrow. But as of now let me continue with InstallOptions.
Once i learn about NSIS better I will try with nsDialogs.
Can u guide me in creating Custom license page.??
MSG
21st October 2010 08:58 UTC
Originally posted by Pravin
Once i learn about NSIS better I will try with nsDialogs.
Not that this is on-topic or anything, but that's a bad idea. nsDialogs is much easier to learn than InstallOptions.
Pravin
21st October 2010 09:40 UTC
Sure MSG. I'll follow with nsDialogs . But To be frank i have not used nsDialogs so far and i have used installOptions all over my code. I have a release by this week end. I think its not the time to play with the code. So May be from next week I'll implement nsDialogs.
1.As discussed earlier Iam able to pass value dynamically for all my custom page except the custom page which follows the MUI license page.
2.It works fine if i remove the MUI license page.
3.So, For time being i have removed license page and trying to create a custom license page.
please help me to create a custom license page. Is there any forum available which discuss about the custom license page??
MSG
21st October 2010 11:04 UTC
So... What is it you want help with? If you're already familiar with InstallOptions, you should be able to make a license page on your own. Info on how to rename the Next button to Agree (or something like that) is available in the forums, use search.
Pravin
21st October 2010 11:29 UTC
I have set My license text to READONLY and its back ground color is GERY.But Im looking for White Color(As we get in MUI). Regarding rename the Next button to Agreee ,Im going through the forums.
Help in the sense. I want to know whether there is any forum where custom license page is discussed. Thanks for your response.
MSG
21st October 2010 13:30 UTC
As far as I know there is only one English NSIS forum, and you're already here. As for the color of your text field, once again, try searching the forums. Setting background color is a very common question.
Pravin
21st October 2010 13:46 UTC
thanks :)
Pravin
27th October 2010 13:59 UTC
(ReadOnly textbox with scroll)
GetDLgItem $R1 $HWND1 1201
SetCtlColors $R1 000000 FFFFFF
CustomLicense
::LoadFile "E:\Program Files\license.txt" $R1
>
With the above code i constructed my custom page using install options.
My installer is multiLingual.
Where am i supposed to include the LangString??
i referred the forums and i found there was solution for MUI
LicenseLangString LicenseRTF ${LANG_JAPANESE} "E:\Program Files\license.txt"
LicenseLangString LicenseRTF ${LANG_ENGLISH} "E:\Program Files\license.txt"
!insertmacro MUI_PAGE_LICENSE $(LicenseRTF)
what about custom license page??
As i discussed earlier if i use MUI _PAGE_ LICENSE , the very next page following the license page alone not being translated. I find the strings are translated only if i click next and come back. Thats is the reason why i opted for Custom License.
Please help me to solve above two issues or either one among those.Thanks.
Pravin
27th October 2010 15:53 UTC
Following is the final code , i would like to share with you all which I use for custom license page using InstallOptions.Works fine. If im wrong please correct me.
>!define License_en "$PLUGINSDIR\License_en.txt"
>!define License_jp "$PLUGINSDIR\License_jp.txt"
>LangString license_txt ${LANG_ENGLISH} "${License_en}"
>LangString license_txt ${LANG_JAPANESE} "${License_jp}"
>FindWindow $HWND "#32770" "" $HWNDPARENT
>;I pass these values to the textbox which i created using install options.
;
Textbox flags :NOTABSTOP|MULTILINE|VSCROLL|READONLY|NOWORDWRAP
GetDLgItem $R1 $HWND 1201
SetCtlColors $R1 000000 FFFFFF
CustomLicense::LoadFile "$(license_txt)" $R1
>Function .onInit
File/oname=$PLUGINSDIRLicense_en.txt "E:\Program Files\license_en.txt"
>File /oname=$PLUGINSDIRLicense_jp.txt "E:\Program Files\license_jp.txt"
>FunctionEnd
>
I was advised by the moderators to prefer nsDialogs. So you ppl also stick to that. Even i'll be replacing my code from Install Options to nsDialogs in my near future.
Keep Coding..!! Keep on Coding..!! :)