Archive: force language


force language
Hi all,
I need you help: I'm trying to change the language after the .oninit function.
Is it possible?
I've already read a couple or threads on this and on one the suggestion was to use an external installer. Unfortunately I can't do it because the user must have the possibily to re-change the language again and again... :(
Any idea?

Thanks
Fabio


I can't really think of any option other than making every dialog a custom dialog so that you have complete control over their content - and thus the strings used - at runtime.

Why would they need the ability to change the language after initialization, though? Would be a bit odd to, say, have an English welcome page and then let the user change to Dutch for the Directory page, then change to German for the components page, etc.

Perhaps there is a better solution to what you're trying to do if we know what it is that you are trying to do :)


Thanks for feedback, but unfortunately my requirements are more or less like you described: the user will have a welcome page in the OS language and then in the second page he/she will have the option to change the installer language. :(:(
Very weird requirements, but I'm only the arm.... :)

I think I'll try to proceed as you suggested.
Thanks


Move the welcome page to a separate installer executable and extract and execute that from your primary installer's .onInit function. Make sure you use ReserveFile on it so that it's extracted promptly.

i.e.

Function .onInit
!system `"${NSISDIR}\makensis.exe" welcomepage.nsi`
InitPluginsDir
ReserveFile welcomepage.exe
File /oname=$PLUGINSDIR\welcomepage.exe welcomepage.exe
ExecWait `"$PLUGINSDIR\welcomepage.exe"`
FunctionEnd

Edit: And your language selection page would need to be in that exe as well. You can pass the chosen language ID via the registry or an INI file.

Stu