![]() |
Is there a way to insert specific macro language with MUI
Hello,
I'm trying to use the '!insertmacro MUI_LANGUAGE "myLMang"' in a specific way. First i have one install which store the language the user chose. PHP Code:
So I want insert the right language in the script (here " !insertmacro MUI_LANGUAGE "English" " My problem is that I can't use this macro in a function and I can't use switch case out of a function. Does anyone got an Idea to help my poor brain...? Here's my code: PHP Code:
|
I am not sure what you are trying to do.
You have two installers. The first one offers a choice of languages (English and French?). This installer stores the selected language in the registry. After you have run the first installer you want to run another installer. The second installer is to use whatever language was selected when the first installer was run. I think your problem is that you do not know how to make the second installer use the correct language. Have you looked at the multi-language MUI example that comes with NSIS? Try compiling the Examples\Modern UI\MultiLanguage.nsi script to make the MultiLanguage.exe demo installer. The first time I ran MultiLanguage.exe on my English version of Windows it showed a language selection dialog with "English" pre-selected. I used the dialog box to select "French" and ran the demo installer (and all the pages were in French). After the installer finished, I ran MultiLanguage.exe again. This time it did not show the language selection dialog so the very first thing that appeared was the License page and that was all in French (even though I was running it on an English version of Windows). This happened because the installer was using the language setting stored in the registry. |
leave your macros outside the section, where they belong. to switch the language you just need to do this:
code: i guess you have to use this before your GUI is initialized (onInit or onGUIInit). unless you need the language stores in the registry permanently, i think it's good practice to execut second installer with a parameter (mySetup.exe /L=1033). http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.12 |
Quote:
Quote:
Use the switch /L with the installer is a good advice. I'll try it. But at this time it's an external program (i.e. I can't handle it) which calls my second installer. Thank you both. I'll be back to tell you if i can find a fix :) |
Ok, It's working now.
What I have done in the second installer is: Put these lines: PHP Code:
PHP Code:
According to the MUI documentation: !If you want the installer to display a language selection dialog (see the the MultiLanguage.nsi example), insert the MUI_LANGDLL_DISPLAY macro in the .onInit function So i don't understand why I have to insert this code, because I don't want the language listBox. And in this case it's not shown... Did I miss something? Anyhow, it's working now. Thank You. |
Quote:
There is another MUI setting you can use if you ALWAYS want the language selection dialog to appear. See the MUI readme: Quote:
|
Damn,
I did not read the entire section. Sorry about that. |
Don't worry about that. I have read the documents lots of times and still find new things in them.
|
| All times are GMT. The time now is 17:24. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.