jwest
Posts: 56
Joined: Tue Dec 27, 2005 12:14 am

Determining language at install time

How can a custom action determine what language the msi file is using?

Our apps use a registry setting to determine what language/localization files should be loaded.

We need to be able to set the localized title and localized TARGETDIR at install time as well as set the value of the language registry variable to the appropriate language code.

Currently, I use a different project file for each language. This is because the English version needs to set a value in the program's registry settings called "Language" to "EN" and the Spanish version needs to set this value to "ES". These value are currently hard-coded into the registry section of the aip file.

It would be conveinient to just have one setup project to generate all of the different language versions that we support.
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

You do not need a custom action for this.

For a solution to your problem please visit:
http://www.advancedinstaller.com/forums ... .php?t=833

Please tell me if you encounter any problems.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
jwest
Posts: 56
Joined: Tue Dec 27, 2005 12:14 am

Thanks. That did it for the registry setting.

What's the best way to add a language in future? Is it to create a new dictionary with the new language and then manually merge the new settings into the main dictionary? Or just insert the new translation strings using the additional language code in the lang="" part.

Also, I would like to change the source file properties of certain items in the files and folders section based on the language. For example, I have a localized resource .dll for each language. They are all named resources.dll and are located in different folders on the build machine. If the language is "EN" then I'd like to install the English version of the resource dll. If the language is "ES" then I'd like to install the Spanish of the resource dll.

Any tips would be appreciated.
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

Please use this tutorial to see how to add a new language to Advanced Installer:

http://www.advancedinstaller.com/user-g ... guage.html

You cannot use the same method to install a certain file according to the package language.

For this you need a different approach:

- create a different component for each file group:
E.g. componentEN
file1EN
file2EN
componentES
file1ES
file2ES
-condition each component on the value of the ProductLanguage language property.

For example the condition for the English component is
ProductLanguage = "1033"

For more details about the ProductLanguage property please see:
http://msdn.microsoft.com/library/defau ... nguage.asp

For a list of LangIDs please see:
http://msdn.microsoft.com/library/defau ... tables.asp

Hope this helps.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”