Old 20th April 2010, 20:31   #1
rgerard
Junior Member
 
Join Date: Sep 2009
Posts: 2
How can I force the language to get re-read after onInit?

For my installer, I was using the LangDialog DLL for a while to have users choose a language, but there was an issue: it's a really small window that opens, and it would commonly get "lost" on users machines. They would try to open the exe, not see the small language picker, and end up never installing.

Instead what I did was create a droplist on the first main page that users see, which is a CustomPage I created. The custom page allows the users to select the language from a drop-down list, and in the leave function of the custom page, I copy the selection to the $LANGUAGE variable.

The problem I'm having is that even though the $LANGUAGE variable is set correctly, the strings being used in the installer aren't the language set in $LANGUAGE. From what I'm reading in these forums, it looks like NSIS will somehow set the appropriate language to show sometime after onInit exits, but before any custom pages are shown.

Is there a way to force the installer to re-init the language for the installer after onInit has finished and pages are showing? I've tried manually calling onInit again from my custom page (after the $LANGUAGE is set correctly), and that mostly worked, but that seems like a buggy solution, and in my case calling onInit twice causes some other problems.

Any ideas?

Thanks,
Ryan
rgerard is offline   Reply With Quote
Old 22nd April 2010, 13:36   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The easiest solution would be to move your custom dialog to another NSIS executable and run that from .onInit. You can store the chosen language in the registry temporarily or pass it as the exit code (error level): http://nsis.sourceforge.net/Docs/AppendixD.html#D.1.

Stu
Afrow UK is offline   Reply With Quote
Old 28th June 2010, 11:17   #3
htome
Junior Member
 
Join Date: May 2009
Posts: 16
Hi

I need to do the same thing with the Welcome page

I was able to create my own Welcome nsDialog based on Welcome.nsh, but I don't even know how to populate the dropdown list with the available languages.

Does anybody have a working code for this? An example that I can base on?

I am new to NSIS but have this enormous task to do...

"rgerard", have you been able to create this? Would it be possible for you to share some of your code?

Any help is much appreciated!

Many thanks
htome is offline   Reply With Quote
Old 28th June 2010, 11:53   #4
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Quote:
Originally Posted by htome View Post
I was able to create my own Welcome nsDialog based on Welcome.nsh, but I don't even know how to populate the dropdown list with the available languages.
See:
http://nsis.sourceforge.net/Move_data_between_ListBoxes
and
http://forums.winamp.com/showthread.php?t=318395 (read full thread)
Animaether is offline   Reply With Quote
Old 30th June 2010, 07:49   #5
rgerard
Junior Member
 
Join Date: Sep 2009
Posts: 2
Populating the drop-down list

Hi htome,

I was using InstallOptions, not nsDialogs, so it might be a bit different for you. Basically, I defined the Droplist in my INI file, like so:

[Field 6]
Type=DropList
Left=230
Right=300
Top=125
Bottom=136
Flags=Notify
ListItems=English|Japanese|German|Dutch

When you render the Droplist, it should have the items already. I hope that helps!
rgerard 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