seansjant
Posts: 1
Joined: Fri Sep 26, 2008 10:38 pm

Set Registry Based on User Selected Language

Hi,

We are building a multi-language package using AI. User can select whatever language he wants even though it is different from OS language. We need to record user's language selection into registry. Right now I can only assign a fixed value to registry. Is there a convinient way to assign the registry value depending on user's language selection? For example, if user selects French, we want to add a registry key "language" with value "French".
Thanks in advance.

Sean
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Set Registry Based on User Selected Language

Hi Sean,

What you need can be done in multiple ways:

1) Use the Registry page to create a registry value for each language. Since the values will have the same names, you can use the approach explained in the Install 32-bit/64-bit registry entries how-to (property-based registry keys). After the registry entries are created, you can use the Organization page to condition the installation of their components.

In the "Condition" field of the Component Properties page you can use the ProductLanguage property. For example, the condition of the English registry value can look like this:

Code: Select all

ProductLanguage = 1033
Note that "1033" is the language identifier of the English language. You can find a list of language identifiers here.

2) Another approach is to use a custom action. This custom action can verify the "ProductLanguage" property and based on the result it can write a registry value. Here you can find some sample VBScript code for creating a registry value. Note that in VBScript you can get the value of a property by using the "Session" object:

Code: Select all

dim languageID
languageID = Session.Property("ProductLanguage")
After retrieving the language identifier of the installation language, you can compare it with known values and set a variable. When all known values are verified, you can write the variable into the registry.

If you have questions about these approaches, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ajitavm
Posts: 1
Joined: Tue Jan 31, 2012 9:45 am

Re: Set Registry Based on User Selected Language

Hi,
We are building a similar approach for multilanguage installer.
But the sequence is as follows:
1. Insert CD.
2. Autorun CD Install Menu(created in VB).
this CD install menu gives multilanguage option at first and follows to display in the language selected.
3. Now the click on the "Install software" button in the CD Install menu runs the setup created in advanced installer.

Question:
How to invoke the Advanced installer based setup in the corresponding language which is selected by the CD Installer menu?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Set Registry Based on User Selected Language

Hi and welcome to Advanced Installer forums,

If you have a multilingual package, you can launch the installer with the following command line:

Code: Select all

msiexec.exe /i "C:\YourInstaller.msi" ProductLanguage="<UserChosenLangId>"
where <UserChosenLangId> is one of the identifiers from the "Values" column listed here:
http://msdn.microsoft.com/en-us/library ... 80%29.aspx

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”