In addition to Yes/No, Allow Language Selection (or any other property) may accept additional value - Autodetect.
In this case, UI language should be selected according to the locale of the current Windows user (I don't know how MUI is organized in Linux and other Unix systems, so let's implement this for Windows only)
My investigation shows that on Windows 9x/Me the locale value is stored in value ResourceLocale of the registry key HKEY_CURRENT_USER\Control Panel\Desktop
(see http://www.microsoft.com/globaldev/handson/dev/muiapp.mspx\)
On WinNT and above it's Locale in HKEY_CURRENT_USER\Control Panel\International
The value you get from there can be translated into aa_bb format. 0x400 is the default subset (_bb is empty), last byte is the main language (aa)
Here are the examples:
40c: French France, 80c: French Belgium
409: English US, c09: English Australia, 809: English UK
The following TCL code can fetch main language number on WinNT:
set ::info(RegKey) "HKEY_CURRENT_USER\\Control Panel\\International"
set mainLangCode [expr 0x[::InstallAPI::SubstVirtualText -virtualtext "<%RegValue <%RegKey%> Locale%>"] & 0xFF]
I also tried to set Language and DefaultLanguage VirtualText variables in Setup Actions, but it didn't work. Anyway, if this autodetect feature gets implemented, I will not need setting the variables above anymore.
Logged In: YES
user_id=50387
Originator: NO
I knew I'd seen this stuff before. Tcl already does this automatically, but InstallJammer was overriding what Tcl was doing during initialization. It has been fixed and committed. InstallJammer will now only use the Default Language if the language on the target system is not included in the installer.
Logged In: YES
user_id=140353
Originator: YES
damon, thank you for implementing system language auto-detection !
When I set Allow Language Selection to Yes, the suggested language is the auto-detected one.
There exists some scenario that I think should be implemented too:
if you set Allow Language Selection to No, installer always uses Default Language.
I'd like you to add "Auto-detect" to the list of languages in the builder's Default Language selector,
so if Allow Language Selection is set to No, setup maker still could choose between specific language and the detected one.
Thank you in advance !