Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Multiple Language Setup Package
 

Multiple Language Setup Package

Can I create a deployment package whichsupport cultures inside one single setup.exe. For example I have various language versions of license agreement text, button texts and so on. I would like to make my setup package to detect OS' locale and display correct version of language.

Or I add a language selection option as step one and display corresponding language content by selection.

Is it possible?

Thanks
Hardy
Hardy  Wednesday, July 22, 2009 2:28 AM

Hi Hardy,

I suggest you use Transforms to create a multiple language installer package. A transform is a collection of changes applied to an installation. By applying a transform to a base installation package, the installer can add or replace data in the installation database. The installer can only apply transforms during an installation.

The following are the steps to create a multiple language installer package.

1. Create a Setup project named SetupTest in VS05 and add the primary output from a WinForms application. Build the Setup project. The resulted installer package is named setuptest.msi.

2. Create a localized version of the installer package, e.g. Chinese.See the http://msdn.microsoft.com/en-us/library/kcx25hzz(VS.80).aspxfor how to do it. Rename the resulted installer package setuptestChinese.msi.

3. Use the following script to generate the specific language transform, in this case, a Chinese language transform.

option explicit
dim wi, basedb, newdb
' NOTE: It is very important to use this validation flag to ensure the transform can be applied to the original msi package later without any error
const msiTransformValidationNone = 1
const msiTransformErrorNone = 0
set wi = CreateObject("WindowsInstaller.Installer")
set basedb = wi.opendatabase("SetupTest.msi", 0)
set newdb = wi.opendatabase ("SetupTestChange.msi", 0)
newdb.GenerateTransform basedb, "2052.mst"
newdb.CreateTransformSummaryInfo basedb, "2052.mst", msiTransformErrorNone, msiTransformValidationNone
set wi=Nothing

Save this script as a .vbs file in the setup project's Debug folder and run it to create a 2052.mst. 2052 is the language id of Chinese. See http://msdn.microsoft.com/en-us/library/aa369771(VS.85).aspxfor more language ids and page code.

4. Embed the 2052.mst into the SetupTest.msi file using WiSubStg.vbs. Note: WiSubStg.vbs is a sample script in Windows Platform SDK and you can find it at C:\Program Files\Microsoft Platform SDK\Samples\SysMgmt\Msi\Scripts.
The command line is like below:
Cscript WiSubStg.vbs SetupTest.msi 2052.mst 2052

5. Add 2052 to the package language of the SetupTest.msi (the original package language of SetupTest.msi is 1033) using WiLangId.vbs. Note: WiLangId.vbs resides in the same folder where the WiSubStg.vbs is.
Cscript WiLangId.vbs SetupTest.msi package 1033, 2052

6. Open the 'Regional and Langage Options' in the Control Panel and set the Location to China and format to Chinese(PRC).

7. Double-click the SetupTest.msi to run it. The banner text shown in the welcome form is in Chinese. In addition, the prepare to install dialog shows characters in Chinese as well.

Hope this helps.

Sincerely,
Linda Liu


Please remember to mark the replies as answers if they help and unmark them if they provide no help. Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Wednesday, July 22, 2009 6:33 AM

2. Create a localized version of the installer package.


Thanks Linda. For this step do I need to create a separate setup project?
Hardy  Wednesday, July 22, 2009 2:56 PM
I tried your solution to create 2 setup projects in Windows Vista English. The first one is default to English US, and the second one is Chinese. but I saw a warning message after I switched to a different language "Could not match culture 'zh-CN' for item 'Windows Installer 3.1'. Using culture 'en' instead.C:\Temp\SetupTest\Setup.zh-cn\Setup.zh-cn.vdprojSetup.zh-cn" and "Warning2Could not match culture 'zh-CN' for item '.NET Framework 3.5 SP1'. Using culture 'en' instead.C:\Temp\SetupTest\Setup.zh-cn\Setup.zh-cn.vdprojSetup.zh-cn".

I followed exact your instruction above to fet a final merged version of MSI. I copied that MSI to a Chinese version of XP to launch. I saw the first window displays in Chinese and right after that everything is still in English.

Any idea?
Hardy  Thursday, July 23, 2009 1:18 AM

Hi Hardy,

> For this step do I need to create a separate setup project?

No. Use the same setup project to create the localized version of Windows Installer package.

> I copied that MSI to a Chinese version of XP to launch. I saw the first window displays in Chinese and right after that everything is still in English.

You need to change the region location from Control Panel-> Regional and Language Options.


Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Thursday, July 23, 2009 9:05 AM

Hi Hardy,

How aboutthe problem now? If you need furthur assistance, please feel free to let me know.


Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Monday, July 27, 2009 2:35 AM

Hi Hardy,

How aboutthe problem now? If you need furthur assistance, please feel free to let me know.


Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

I think I gave up. I decided to use WiX to manually build the entire setup project.
Hardy  Monday, July 27, 2009 2:36 AM

You can use google to search for other answers

Custom Search

More Threads

• Fail to deploy software to another machine
• Anything better than InstallShield?
• Installing ClickOnce server to multiple URLs
• Setup projects and build events
• Setup Project produces both a MSI file and a setup.exe file.
• Installing 2 versions of the same application on the same machine with ClickOnce.
• Deploying ClickOnce on a Vista non-admin environment... help.
• Problems in Deploying a Project !
• User option to select "Log on" when installing VB .NET Windows Service
• Which Port is used by ClickOnce?