Archive: Change Setup Language


Change Setup Language
Hi there,

I am in a minor dilemma at the moment. Here's what I have to do:

I have an application for the pocket PC that comes in many different languages, i.e. each language has its own files. Because of this, I need to create different setup executables for each language. I need to basically write an NSIS script that will change the !insertmacro MUI_LANGUAGE to any language I want.

For example, I am thinking of having a batch file that will take the language as a parameter and basically collect all those language specific files and build a cab file. So based on that parameter I need to change the MUI_LANGUAGE in the NSIS script too. I know I can have multiple NSIS script files but that would be really inefficient, I want to change it through the batch file.

One of the ideas I had was that I can create a text file with all the parameters in it through the batch file, then read the file in the NSIS script and change the MUI_LANGUAGE on ".oninit". Is this idea feasible?

One other thing I need to do is that I need to replace the welcome screen page in the MUI with another page that displays a readme file that is also language specific, i.e. the readme filename is different for every language. How can this be done? Can someone provide some sample code for adding a custom page such as this...

Thanks in advance..

Shrekkie


you want only one nsis file?
i'd prefer different header files for every language.

i'd do it like that:
in you main.nsi:

!include ${lang}.nsh

(directly after you included the page macros, where you would normally place the !insertmacro MUI_LANGUAGE)

then in each language's header file:
!insertmacro MUI_LANGUAGE "<language>"
<add your custom language strings here>

now, you may compile the versions by using commandlineswitch like this:
/Dlang=english
/Dlang=french
/Dlang=german


so I just create header files for every language, and include them all in the script? And based on the commandline parameter, this would choose the appropriate language?


Thanks a lot for the help commander, your way works perfectly :)


:)