Default language / GetSystemDefaultLCID() ?

Mar 13, 2009 at 9:38 PM
Edited Mar 15, 2009 at 10:56 AM


in order to determine the default LCID of the system you explicitely do not use "GetSystemDefaultLCID()" because of

If I understood correctly you would get the currently set language setting if you use GetSystemDefaultLCID() and if you do it like you do one gets the LCID of the language the system was originally installed. But I think it makes much more sense to ask for the language the system is currently set to - since the user apparently goes quite good with this one set ;)

Is this intended? I changed the code to "GetSystemDefaultLCID()" and it exactly what I want :)

Maybe it would be a good idea to do sth. like:

// Retruns the operating system LCID. With setting installed_windows true
// one gets the LCID of the installed windows version (e. g. 1031 for a german windows)
// and by setting it false one gets the currently set LCID
inline LCID GetOperatingSystemLCID(bool installed_windows_lcid)
//per ulteriori informazioni vedere :
// Microsoft Knowledge Base Article - 181604
// HOWTO: Determine Default Language ID of Windows 95 or WinNT
if (!installed_windows_lcid) {
return GetSystemDefaultLCID(); //NO Questa funzione restituisce la lingua impostata di default dal pannello di controllo
} else {

[...] // code up to now


One could then make it possible to add an configuration- or component based property.


Mar 18, 2009 at 12:30 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 18, 2009 at 12:31 PM
I created a feature request:
Mar 19, 2009 at 1:10 PM
I've implemented lcidtype which can be set at the top level.
A new build was uploaded to
Let me know if it works for you.

Here's the new section from the documentation under Setup Bootstrapper/Multilingual Support.

Selecting an LCID

You can define the lcid property of a configuration to set its Locale ID. A locale is either a language or a language in combination with a country. For example, a value of 1033 identifies English (United States), while 1049 identifies Russian. See this page for a table of LCID values.

 Important Note:

dotNetInstaller will produce an error and exit when it fails to identify an acceptable configuration. Hence, when defining localized configuration it's important to either create one configuration without an lcid value for all other locales or use a ! operator. For example, your setup can have two configurations 1040 and !1040.

dotNetInstaller obtains the system's LCID via one of the following configurable methods. Set the lcidtype property of the configuration file to one of these values.

Obtain the LCID from the language information in the FileVersionInfo of User.exe by calling GetFileVersionInfo, and then VerQueryValue (on \VarFileInfo\Translation") on the VersionInfo block of the operating system's User.exe. This method works on all versions of Windows and is described in KB181604.
System default LCID using GetSystemDefaultLCID.
User default LCID using GetUserDefaultLCID. The user-defined language identifier of the operating system can be set by using the Regional Settings option in Control Panel.
for a table of LCID values.
Mar 20, 2009 at 11:30 AM


thank you very much - this is exactly what I wanted :). It works like a charm.

Regards and thanks,