创建本地化的 WIX 3.6 引导程序. [英] Creating localized WIX 3.6 bootstrappers.

查看:18
本文介绍了创建本地化的 WIX 3.6 引导程序.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一年多前,我在 Visual Studio 2010 中创建了一个 WIX 项目.它会创建一个 MSI 文件和一个引导程序 setup.exe.实际上,它为两种语言(英语和法语)创建了这对文件.我刚刚将此项目集成到我们的 TFS CI 构建中.我无法让 CI 构建生成引导程序 setup.exe 文件.

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.

我们最近将所有构建服务器上的 Wix 升级到了 Wix 3.6 RC.所以,我想我会尝试一下 Burn,而不是使用旧风格的引导程序.我在我的解决方案中添加了一个新的 Bootstrapper 项目.引导程序项目包括一个简单的 bundle.wxs,它只加载我的旧 MSI 项目生成的 MSI.但是,当我尝试构建时,出现以下错误:

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:

错误 LGHT0103:系统找不到文件'C:TfAdvantageDevSolutionConfigurationLaunchPad.WixinReleasefr-frLaunchPad.msi;C:TfAdvantageDevSolutionConfigurationLaunchPad.WixinReleaseen-usLaunchPad.msi'.

error LGHT0103: The system cannot find the file 'C:TfAdvantageDevSolutionConfigurationLaunchPad.WixinReleasefr-frLaunchPad.msi;C:TfAdvantageDevSolutionConfigurationLaunchPad.WixinReleaseen-usLaunchPad.msi'.

我在捆绑包中的包引用如下所示:

My package reference in the bundle looks like this:

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

LaunchPad.Wix 是 Wix MSI 项目的名称.如果我将 LaunchPad.Wix 项目更改为仅构建一种语言,那么它可以正常工作.在我看来,引导程序项目类型只是不支持为多种语言构建设置文件.这是真的?有什么解决方法的建议吗?

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?

编辑

经过进一步调查,我想知道引导程序项目是否支持本地化.我尝试将我的 Wix MSI 项目设置为仅创建 fr-fr.我的引导程序项目用英语创建的 setup.exe.当我编辑引导程序项目的项目属性时,要构建的文化"字段被锁定并留空.我将如何构建一个非英语引导程序?这可能吗?

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?

推荐答案

这里发生了几件事:

  1. 如果您使用多个区域性,则不能在 MSBuild 之外需要单个文件名的内容中使用 TargetPath.如您所见,TargetPath 是已构建的本地化文件的列表.但是,如果您限定 .msi 包的输出语言,则可以使用 TargetPath:<MsiPackage SourceFile="$(var.TestMsi.en-US.TargetPath)" Id="MsiEnUs"/>

如果您想创建一个可以安装/同时安装 en-US 和 fr-FR 的引导程序,您需要在其自己的 MsiPackage 元素中分别列出每个 .msi 包.

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.

如果您想创建两个引导程序,一个 en-US 和一个 fr-FR,您需要调用引导程序 .wixproj 两次,每种语言一次.引导程序不支持文化技巧"——从一次 MSBuild 调用产生两个输出是有问题的(见证 TargetPath 问题).

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).

如果您使用的是 WixStandardBootstrapperApplication,它会自动尝试根据用户 UI 语言对 UI 进行本地化,然后回退到系统 UI 语言,最后回退到英语.它在以 LCID 命名的目录中查找本地化字符串,因此您将拥有如下所示的有效负载:

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	hm.wxl" SourceFile="..." />
<Payload Name="1036	hm.wxl" SourceFile="..." />

不幸的是,WixStandardBootstrapperApplication 字符串目前仅适用于 en-US.这就是为什么 fr-FR 引导程序以英文显示 UI.您需要本地化 WiX 源文件 HyperlinkTheme.wxl 或 RtfTheme.wxl(取决于您使用的主题).这两个文件都在 srcextBalExtensionwixstdbaResources 中.

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 srcextBalExtensionwixstdbaResources.

这篇关于创建本地化的 WIX 3.6 引导程序.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆