Creating localized WIX 3.6 bootstrappers.
Asked Answered
W

2

16

I created a WIX project in Visual Studio 2010 over a year ago. It creates an MSI file and a bootstrapper setup.exe. Actually, it creates that pair of files for two languages - English and French. I am just now integrating this project into our TFS CI builds. I'm having trouble getting the CI build to generate the bootstrapper setup.exe files.

We've recently upgraded Wix on all our build servers to Wix 3.6 RC. So, I thought I'd give Burn a try instead of using the old style of bootstrapper. I added a new Bootstrapper project to my solution. The bootstrapper project includes a simple bundle.wxs that just loads the MSI generated by my old MSI project. However, when I try to build I get the following error:

error LGHT0103: The system cannot find the file 'C:\Tf\Advantage\Dev\Solution\Configuration\LaunchPad.Wix\bin\Release\fr-fr\LaunchPad.msi;C:\Tf\Advantage\Dev\Solution\Configuration\LaunchPad.Wix\bin\Release\en-us\LaunchPad.msi'.

My package reference in the bundle looks like this:

<MsiPackage Id="MyApplication" SourceFile="$(var.LaunchPad.Wix.TargetPath)" />

LaunchPad.Wix is the name of the Wix MSI project. If I change the LaunchPad.Wix project to build only one language then it works fine. It looks to me like the bootstrapper project type just doesn't support building setup files for multiple languages. Is this true? Any suggestions for a workaround?

Edit

Upon further investigation, I wonder if bootstrapper projects even support localization. I tried setting my Wix MSI project to create only fr-fr. The setup.exe that my bootstrapper project created with English. When I edit the project properties for the bootstrapper project the "Cultures to build" field is locked down and blank. How would I build a non-english bootstrapper? Is this possible yet?

Worn answered 28/6, 2012 at 18:16 Comment(1)
There is a bootstrapper localization sample - with source code - in this CodePlex project: classicwixburntheme.codeplex.comPipe
E
23

There are several things going on here:

  1. If you use multiple Cultures, you can't use TargetPath in something outside MSBuild that expects a single filename. As you found, TargetPath is a list of the localized files that were built. However, you can use TargetPath if you qualify the .msi package's output language: <MsiPackage SourceFile="$(var.TestMsi.en-US.TargetPath)" Id="MsiEnUs" />

  2. If you want to create one bootstrapper that can install either/both en-US and fr-FR, you'll need to list each .msi package separately in its own MsiPackage element.

  3. If you want to create two bootstrappers, one en-US and one fr-FR, you'll need to invoke the bootstrapper .wixproj twice, once for each language. Bootstrappers don't support the Cultures "trick" -- it's problematic to produce two outputs from a single invocation of MSBuild (witness the TargetPath problem).

If you're using WixStandardBootstrapperApplication, it automatically tries to localize the UI based on the user UI language, falling back to the system UI language, and finally falling back to English. It looks for localized strings in directories named after the LCID, so you'd have payloads like this:

<Payload Name="1033\thm.wxl" SourceFile="..." />
<Payload Name="1036\thm.wxl" SourceFile="..." />

Unfortunately, WixStandardBootstrapperApplication strings are currently available only for en-US. That's why an fr-FR bootstrapper shows UI in English. You'd need to localize the WiX source file HyperlinkTheme.wxl or RtfTheme.wxl (depending on which theme you use). Both of these files are in src\ext\BalExtension\wixstdba\Resources.

Eon answered 9/7, 2012 at 20:4 Comment(3)
Our en-US and fr-FR installation packages are identical except for the WIX UI strings. I just now noticed that the burn installer doesn't show the MSI UI at all. Is there a way to have the burn bootstrapper use my MSI's UI instead of the burn UI? If so, I could create two projects - one for each MSI (en-US and fr-FR). Sounds like my other option would be a single bootstrapper. I'd create the UI in burn (with both en-US and fr-FR translations). Burn will display the right translation based on the user's OS language setting. Does that sound about right?Worn
Right. If you localize the bootstrapper, you would need only one .msi. Or you could go one step further and move code to one .msi and localized resources to one .msi per language. It wouldn't save you much with just two languages, but I've worked on products that shipped a dozen languages and it saved space and simplified patching, since you usually patch code and not resources.Eon
I want to create one bootstrapper that can install en-US/fr-FR/ko-KO/th-TH/ar-SA/el-GR which is automatically detect the current system language, then translate the UI strings to the system laguage. How can I achieve it? In bootstrapper there is one tag, WixStandardBootstrapperApplication/@LocalizationFile attribute, need to manually chosen, how can it automatically select it according to the system language?Chuckle
A
4

good. it works as Bob Arnson said.

but you must pay attention to the name and the SourceFile of payload.

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
      <Payload Name="2052\thm.wxl" SourceFile="2052\thm.wxl" />
</BootstrapperApplicationRef>

if you change the name to another one. the bootstrapper will not be localized.

Angelicaangelico answered 11/4, 2013 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.