Multiple Language Setup Package
- Can I create a deployment package which support 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
All Replies
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).aspx for 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).aspx for 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, 20526. 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.- Proposed As Answer byThuan Tran Sunday, November 01, 2009 3:56 AM
2. Create a localized version of the installer package.
Thanks Linda. For this step do I need to create a separate setup project?- 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.vdproj Setup.zh-cn" and "Warning 2 Could 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.vdproj Setup.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? 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.Hi Hardy,
How about the 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.Hi Hardy,
How about the 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.- Hi Linda,
Could you please help? Can it run in 5 or more different languages as Cscript WiLangId.vbs DemoShowcase.msi package 1033, 1031, 1036, 1041, 1042?
Thanks,
Thuan
From Step # 3, I got error at
1. set newdb = wi.opendatabase ("SetupTestChange.msi", 0)" if I don't make a copy of SetupTest.msi to SetupTestChange.msi
2. newdb.CreateTransformSummaryInfo basedb, "2052.mst", msiTransformErrorNone, msiTransformValidationNone
Here is the error log
C:\Temp>DemoShowcaseQA.cmd
INFO: Run DeLangID.vbs (1031), FrLangID.vbs (1036), JaLangID.vbs (1041) and KoL
angID.vbs (1042) to generate the specific language transform
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Temp\DeLangID.vbs(14, 1) Msi API Error: CreateTransformSummaryInfo,ReferenceD
atabase,TransformFile,ErrorConditions,Validation
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Temp\FrLangID.vbs(12, 1) Msi API Error: CreateTransformSummaryInfo,ReferenceD
atabase,TransformFile,ErrorConditions,Validation
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Temp\JaLangID.vbs(13, 1) Msi API Error: CreateTransformSummaryInfo,ReferenceD
atabase,TransformFile,ErrorConditions,Validation
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Temp\KoLangID.vbs(13, 1) Msi API Error: CreateTransformSummaryInfo,ReferenceD
atabase,TransformFile,ErrorConditions,Validation
INFO: Run WiSubStg.vbs DemoShowcase.msi 1031.mst 1031 to embed the 1031.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Msi API Error 80004005: SetStream,Field,FilePath
1: 1101 2: 1031.mst 3: 2
INFO: Run WiSubStg.vbs DemoShowcase.msi 1036.mst 1036 to embed the 1036.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Msi API Error 80004005: SetStream,Field,FilePath
1: 1101 2: 1036.mst 3: 2
INFO: Run WiSubStg.vbs DemoShowcase.msi 1041.mst 1041 to embed the 1041.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Msi API Error 80004005: SetStream,Field,FilePath
1: 1101 2: 1041.mst 3: 2
INFO: Run WiSubStg.vbs DemoShowcase.msi 1042.mst 1042 to embed the 1042.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Msi API Error 80004005: SetStream,Field,FilePath
1: 1101 2: 1042.mst 3: 2
INFO: Add 1031, 1036, 1041 and 1042 to the package language of the DemoShowcase
.msi (the original package language of DemoShowcase.msi is 1033) using WiLangId.
vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Package language = 1033,, ProductLanguage = 1033, Database codepage = 1252
Here is the DeLangID.vbs
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 ("DemoShowcase.msi", 0)
Set newdb = wi.opendatabase ("DemoShowcaseChange.msi", 0)
newdb.GenerateTransform basedb, "1031.mst"
newdb.CreateTransformSummaryInfo basedb, "1031.mst", msiTransformErrorNone, msiTransformValidationNone
Set wi = Nothing
Here is my DemoShowcaseQA.cmd
@echo off
@echo.
@echo INFO: Run DeLangID.vbs (1031), FrLangID.vbs (1036), JaLangID.vbs (1041) and KoLangID.vbs (1042) to generate the specific language transform
Cscript DeLangID.vbs
Cscript FrLangID.vbs
Cscript JaLangID.vbs
Cscript KoLangID.vbs
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1031.mst 1031 to embed the 1031.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript WiSubStg.vbs DemoShowcase.msi 1031.mst 1031
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1036.mst 1036 to embed the 1036.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript WiSubStg.vbs DemoShowcase.msi 1036.mst 1036
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1041.mst 1041 to embed the 1041.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript WiSubStg.vbs DemoShowcase.msi 1041.mst 1041
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1042.mst 1042 to embed the 1042.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript WiSubStg.vbs DemoShowcase.msi 1042.mst 1042
@echo.
@echo INFO: Add 1031, 1036, 1041 and 1042 to the package language of the DemoShowcase.msi (the original package language of DemoShowcase.msi is 1033) using WiLangId.vbs
Cscript WiLangId.vbs DemoShowcase.msi package 1033, 1031, 1036, 1041, 1042 Hi Linda,
I did figure out the issue. In step # 3 for creating vbs file, need to update SetupTestChange.msi to SetupTestChinese.msi file.
I still have an issue after completing all of your instruction. This issue is that when I ran the step # 7, I got an error when I changed 'Regional and Langage Options' in the Control Panel and set the Location to China and format to other language as German or French in step # 6. If I kept in English then the installation is fine.
Here is the error:
Windows Installer dialog with the message "Error applying transorms. Verify that the specified transform paths are valid.
Here is my cmd file output:
icrosoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.C:\temptfs\Scripts\VBS\DemoShowcaseQA.cmd
INFO: Set the vbs and msi paths
INFO: Run DeLangID.vbs (1031), FrLangID.vbs (1036), JaLangID.vbs (1041) and KoL
angID.vbs (1042) to generate the specific language transform
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
INFO: Run WiSubStg.vbs DemoShowcase.msi 1031.mst 1031 to embed the 1031.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
INFO: Run WiSubStg.vbs DemoShowcase.msi 1036.mst 1036 to embed the 1036.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
INFO: Run WiSubStg.vbs DemoShowcase.msi 1041.mst 1041 to embed the 1041.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
INFO: Run WiSubStg.vbs DemoShowcase.msi 1042.mst 1042 to embed the 1042.mst int
o the DemoShowcase.msi file using WiSubStg.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
INFO: Add 1031, 1036, 1041 and 1042 to the package language of the DemoShowcase
.msi (the original package language of DemoShowcase.msi is 1033) using WiLangId.
vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.Package language = 1033,1031,1036,1041,1042, ProductLanguage = 1033, Database co
depage = 1252I was trying to follow Linda's detailed instructions and created transform for 1031 to my base 1033. Set my Regional Settings to German and was trying to run. The same error - Thuan reported :
Windows Installer dialog with the message "Error applying transorms. Verify that the specified transform paths are valid.
====================
Added msiexec /lv option to run MSI with substoraged transform and could see error details
MSI (c) (8C:6C) [16:44:01:580]: Looking for storage transform: 1031
MSI (c) (8C:6C) [16:44:01:580]: Validating transform '1031' with validation bits 0x1
MSI (c) (8C:6C) [16:44:01:580]: Note: 1: 2745 2: 1031 3: C:\DOCUME~1\mgruzman\LOCALS~1\Temp\40bd8c2.msi 4: 1033 5: 1031
MSI (c) (8C:6C) [16:44:01:580]: 1: 2745 2: 1031 3: C:\DOCUME~1\mgruzman\LOCALS~1\Temp\40bd8c2.msi 4: 1033 5: 1031
MSI (c) (8C:6C) [16:44:01:580]: Note: 1: 2729
DEBUG: Error 2745: Transform 1031 invalid for package C:\DOCUME~1\mgruzman\LOCALS~1\Temp\40bd8c2.msi. Expected language 1033, found language 1031.
1: 2745 2: 1031 3: C:\DOCUME~1\mgruzman\LOCALS~1\Temp\40bd8c2.msi 4: 1033 5: 1031
Error applying transforms. Verify that the specified transform paths are valid.
1031
MSI (c) (8C:6C) [16:44:01:611]: Note: 1: 1708
MSI (c) (8C:6C) [16:44:01:611]: Note: 1: 2729
MSI (c) (8C:6C) [16:44:01:611]: Note: 1: 2729
MSI (c) (8C:6C) [16:44:01:611]: Product: Avaya one-X Agent 2.0 -- Installation failed.MSI (c) (8C:6C) [16:44:01:627]: MainEngineThread is returning 1624
==========================
next I have opened my MSI in ORCA and changed order of languages in "Summary Information" from "1033,1031" to "1031,1033", saved and ran again.
Now I did not see error but only first message box "Preparing to install" appears in German, next "Welcome" dialog box was in English and well as others.Looks like Transform 1031.mst is not actually calling when Installer recognized regional=1031 and should use other property setting - maybe on command line. What should I do?
Thanks,
Michael- Hi Linda & Michael,
Finally I made it work, but from Linda's step # 3, I use IRMakeMSITransform.exe from MSI Factory tools that can download athttp://www.indigorose.com/webhelp/msifact/HowTo/Support_Multiple_Languages_from_One_Installer.htm and step # 5 (Cscript WiLangId.vbs SetupTest.msi package 1033, 2052) has no space as 1033,2052.
Here is my cmd file that I can run in TFSBuild daily kick off.
However, when I ran the msi installer with'Regional and Langage Options' in the Control Panel and set the Location to Germany (or French or Japanese or Korean) and format to Germany (or French or Japanese or Korean), I got error and roll back (Please see the end of message for the error). I'm trying to fix this error, but still no lucky yet. If you can help me that should be wonderful. I'm almost :).
@echo off@echo.
@echo INFO: Set the vbs and msi paths
@set VBSPath=C:\temptfs\Scripts\VBS
@set English=C:\temptfs\SimulationSuite\SimBuilderLocalization\Sources\SimSuiteLiveDevLocalization\SimDeploy\SimBuilderSetup\SimBuilderOnly\DemoShowcase.msi
@set German=C:\temptfs\SimulationSuite\SimBuilderLocalization\Sources\SimSuiteLiveDevLocalization\SimDeploy\SimBuilderSetup.DE\SimBuilderOnly\DemoShowcase.msi
@set French=C:\temptfs\SimulationSuite\SimBuilderLocalization\Sources\SimSuiteLiveDevLocalization\SimDeploy\SimBuilderSetup.FR\SimBuilderOnly\DemoShowcase.msi
@set Japan=C:\temptfs\SimulationSuite\SimBuilderLocalization\Sources\SimSuiteLiveDevLocalization\SimDeploy\SimBuilderSetup.JA\SimBuilderOnly\DemoShowcase.msi
@set Korean=C:\temptfs\SimulationSuite\SimBuilderLocalization\Sources\SimSuiteLiveDevLocalization\SimDeploy\SimBuilderSetup.KO\SimBuilderOnly\DemoShowcase.msi
@echo.
@echo INFO: Run IRMakeMSITransform.exe to generate the specific language transform for 1031.mst, 1036.mst, 1041.mst and 1042.mst
%VBSPath%\IRMakeMSITransform.exe %German% %English% %VBSPath%\1031.mst
%VBSPath%\IRMakeMSITransform.exe %French% %English% %VBSPath%\1036.mst
%VBSPath%\IRMakeMSITransform.exe %Japan% %English% %VBSPath%\1041.mst
%VBSPath%\IRMakeMSITransform.exe %Korean% %English% %VBSPath%\1042.mst@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1031.mst 1031 to embed the 1031.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript %VBSPath%\WiSubStg.vbs %English% %VBSPath%\1031.mst 1031
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1036.mst 1036 to embed the 1036.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript %VBSPath%\WiSubStg.vbs %English% %VBSPath%\1036.mst 1036
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1041.mst 1041 to embed the 1041.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript %VBSPath%\WiSubStg.vbs %English% %VBSPath%\1041.mst 1041
@echo.
@echo INFO: Run WiSubStg.vbs DemoShowcase.msi 1042.mst 1042 to embed the 1042.mst into the DemoShowcase.msi file using WiSubStg.vbs
Cscript %VBSPath%\WiSubStg.vbs %English% %VBSPath%\1042.mst 1042
@echo.
@echo INFO: Add 1031, 1036, 1041 and 1042 to the package language of the DemoShowcase.msi (the original package language of DemoShowcase.msi is 1033) using WiLangId.vbs
Cscript %VBSPath%\WiLangId.vbs %English% Package 1033,1031,1036,1041,1042
@echo.
@echo INFO: Delete all of mst files
del /q /f %VBSPath%\*.mst
Error and rollback. I don't know how to fix it yet
Aktion 19:39:52: RemoveODBC. ODBC-Komponenten werden entfernt
Aktion 19:39:52: CreateFolders. Ordner werden erstellt
CreateFolders: Ordner: C:\Program Files\Microsoft Demo Showcase\
CreateFolders: Ordner: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\
Aktion 19:39:52: InstallFiles. Neue Dateien werden kopiert
InstallFiles: Datei: Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.dll, Verzeichnis: C:\Program Files\Microsoft Demo Showcase\, Größe: 16896
DEBUG: Error 2356: Couldn't locate cabinet in stream: _4B65F304662F453577DF39104E15D8D0.
DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog
Bei der Installation dieses Pakets ist ein unerwarteter Fehler aufgetreten. Es liegt eventuell ein das Paket betreffendes Problem vor. Der Fehlercode ist 2835. Argumente: ErrorIcon, ErrorDialog,
Bei der Installation dieses Pakets ist ein unerwarteter Fehler aufgetreten. Es liegt eventuell ein das Paket betreffendes Problem vor. Der Fehlercode ist 2356. Argumente: _4B65F304662F453577DF39104E15D8D0, ,
MSI (s) (5C:34) [19:39:54:984]: Produkt: Microsoft Demo Showcase -- Bei der Installation dieses Pakets ist ein unerwarteter Fehler aufgetreten. Es liegt eventuell ein das Paket betreffendes Problem vor. Der Fehlercode ist 2356. Argumente: _4B65F304662F453577DF39104E15D8D0, , - Hi Michael,
You can try IRMakeMSITransform.exe German.msi English.msi 1031.mst then test it by run
msiexec.exe -i English.msi - This will run the installer with the English text.msiexec.exe -i English.msi TRANSFORMS=1031.mst - This will run the installer with the German text.
Thuan - Thank you, Thuan, I have actually build transforms for all languages as Linda suggested but not included them as substorage into base English MSI. They were just added into CD installation directory with base English.msi
Command "msiexec.exe -i English.msi TRANSFORMS=1031.mst" works for me very well. In this case only "preparation message box" been showed in English, all other dialogs in German.
Substoraged transform has tricky algorithm to recognize base language. (see http://blogs.msdn.com/heaths/archive/2006/10/25/how-windows-installer-uses-languages.aspx) and I don't know if it was ever working for big real projects as our is.
-Michael - I'm able to build msi package in the English base and have multiple languages transfroms into this base msi by following those steps:
1. You can use TFS build as we do or run the cmd file to build by using devenv.exe mutiple times (each time to build that needs to change the LangID from 1033 (English) to 1031 (German) to 1036 (French) and so on in the Setup.vdproj file then copy and rename each msi as English.msi, German.msi, and so on
2. Run
IRMakeMSITransform.exe German.msi English.msi 1031.mst
IRMakeMSITransform.exe French.msi English.msi 1036.mst
IRMakeMSITransform.exe Japan.msi English.msi 1041.mst
IRMakeMSITransform.exe Korean.msi English.msi 1042.mst
so on
3. Run
Cscript WiSubStg.vbs English.msi 1031.mst 1031
Cscript WiSubStg.vbs English.msi 1036.mst 1036
Cscript WiSubStg.vbs English.msi 1041.mst 1041
Cscript WiSubStg.vbs English.msi 1042.mst 1042
4. Run
Cscript WiLangId.vbs English.msi Package 1033,1031,1036,1041,1042
Note: No space between those language ID
I create the above steps into one cmd file and integrate into TFSBuild for the daily kick off
Important note: All of those msi packages were built from one setup deployment and just change Localization (LangID) from properties to different language.
I got the above error, because I built multiple projects that use the Setup Merge Module from the Core project.
Well. Good luck everyone
Thank Linda Liu so much for those information even I have to do some more researches, but it works.
Thanks,
Thuan


