Old 14th July 2010, 16:31   #1
guineapig
Junior Member
 
Join Date: May 2010
Posts: 13
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
guineapig is offline   Reply With Quote
Old 14th July 2010, 20:06   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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
Animaether is offline   Reply With Quote
Old 16th July 2010, 08:17   #3
guineapig
Junior Member
 
Join Date: May 2010
Posts: 13
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
guineapig is offline   Reply With Quote
Old 16th July 2010, 09:00   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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.
code:
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump