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

查看:100
本文介绍了创建本地化的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.我在解决方案中添加了一个新的Bootstrapper项目. 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:\ 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'.

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是Wix MSI项目的名称.如果我将LaunchPad.Wix项目更改为仅构建一种语言,则可以正常工作.在我看来,bootstrapper项目类型只是不支持构建多种语言的安装文件.这是真的?有任何解决方法的建议吗?

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,则需要两次调用bootstrapper .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\thm.wxl" SourceFile="..." />
<Payload Name="1036\thm.wxl" SourceFile="..." />

不幸的是,WixStandardBootstrapperApplication字符串当前仅适用于美国.这就是为什么fr-FR引导程序以英语显示UI的原因.您需要本地化WiX源文件HyperlinkTheme.wxl或RtfTheme.wxl(取决于您使用的主题).这两个文件都在src \ ext \ BalExtension \ wixstdba \ Resources中.

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.

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

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