When you localize your MSI package, you'll need to alter your Productand Package elements to suit. To do so, you'll leverage code pages and locale identifiers (LCIDs). So the first thing to do is define what we mean by these terms.
Alocale identifieris an ID used to classify a particular language and the region where it's spoken. It serves the same purpose as an IETF language tag, such as "en-us", but is formatted as a number. For example, "1033" means English as spoken in the United States. A full chart of LCIDs can be found at Microsoft's MSDN web site by searching for locale ID. The URL is:
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx
Although that page also provides LCIDs in hexadecimal form, you should always use the decimal form in WiX.
A code pageis an add-on of extra printable characters that aren't covered in the basic set of 128 ASCII characters. I might as well break the news that WiX does not use Unicode. It has to do with the fact that Windows Installer itself doesn't have strong support for Unicode. For most tasks, this shouldn't present much of a problem. ASCII covers all of the English alphabet and common punctuation marks. You can see a chart displaying ASCII at:
http://msdn.microsoft.com/en-us/library/60ecse8t%28VS.80%29.aspx
However, it doesn't cover non-Latin characters (such as Chinese) or characters with accents over them such as those found in French and Spanish. So, to print the accents marks over Spanish letters, you'll need a code page. Without it, your installer won't know how to render the characters you want. A full list of code pages can be found at Microsoft's MSDN website:

http://msdn.microsoft.com/en-us/library/dd317756
As an example, you could specify a code page of "950" to make Traditional Chinese characters available. In the following sections, we'll see how the Productand Packageelements make use of LCIDs and code pages.
The Package element
First, let's look at the Packageelement. Its job is to sum up details about the installer such as who the author is and what platform it supports. Another important piece of information it publishes is the language that's supported. An MSI package only lists one supported language and it does so by setting the Packageelement's Languagesattribute. The attribute name is plural because the Packageelement is also used in merge modules and they can list multiple supported languages. Here's an example that sets the supported language to 1033(English - United States):
<Package Compressed="yes"
InstallerVersion="301"
Manufacturer="Awesome Company"
Description="Installs Awesome Software"
Languages="1033" />
When the end user launches the installer, their computer looks to the Packageelement to find out what the supported language is. If that language isn't installed locally, an error will be displayed telling the user so.

Here's a message I got when I tried to install an MSI package that specified an LCID of 1085, Yiddish, as the supported language:
Also, if your own development computer doesn't have that language installed, an exception will be thrown when you try to build the WiX project, as shown in the following screenshot:
Windows Installer stores the supported language in something called the Template Summaryproperty. You can find more information about it at the following website:
http://msdn.microsoft.com/en-us/library/Aa372070
Open your MSI with Orca and select View| Summary Informationto see it. It will be listed as the Platformand Languagesfields.
Getting back to the Languagesattribute on the Packageelement, you have the option of using a localization variable instead of a hardcoded value, as in the following example:
<Package Compressed="yes"
InstallerVersion="301"
Manufacturer="Awesome Company"
Description="Installs Awesome Software"
Languages="!(loc.LocaleId)" />
Here, we've specified the variable !(loc.LocaleId)for the Languagesattribute. The value for this variable will be filled in by a WiX localization file (.wxl). Here's a sample .wxlfile that defines this variable for Spanish localization:
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="es-es" Codepage="1252"
xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="LocaleId">1034</String>

<!--Other strings defined here-->
</WixLocalization>
The Packageelement has another attribute called SummaryCodepagethat's used to set the code page for the summary properties. Summary properties are the details shown when you right-click on an MSI file and view its Properties. If any of these use characters outside of the ASCII set, they'll need a code page to display them.
You could set a hardcoded value, as in this example:
<Package Compressed="yes"
InstallerVersion="301"
Manufacturer="Awesome Company"
Description="Installs Awesome Software"
Languages="!(loc.LocaleId)"
SummaryCodepage="1252" />

Here we've specified that the code page to use is 1252, which is the code page containing additional Latin character such as the copyright symbol and characters with accents. If you don't specify the SummaryCodepageattribute it defaults to 1252. You might explicitly set this attribute if you use extended characters such as those for Chinese. If we had used Chinese characters in, for example, theDescriptionattribute, we would have had to specify a code page such as 950
You can also use a localization variable like this:
<Package Compressed="yes"
InstallerVersion="301"
Platform="x86"
Manufacturer="Awesome Company"
Description="Installs Awesome Software"
Languages="!(loc.LocaleId)"
SummaryCodepage="!(loc.SummaryCodepage)" />

最新文章

  1. ListView的属性及方法详解
  2. git clone google代码库
  3. 【BZOJ】3105: [cqoi2013]新Nim游戏
  4. windows环境下svn同步web文件[转]
  5. centos64位安装32位C/c++库
  6. JavaScript--动态更改CSS样式
  7. Andrid 多线程下载
  8. Jquery文本框值改变事件(支持火狐、ie)
  9. 解决nginx FastCGI sent in stderr: “Primary script unknown”
  10. 时间字符串格式化 js
  11. 转发: windows如何管理内存
  12. 一 分析easyswoole源码(启动服务)
  13. 使用U盘为虚拟机安装系统
  14. HDU 2073 无限的路 (模拟)
  15. Lombok使用详解(转)
  16. [转]IDEA 新建 JSP 项目时
  17. EVA:自定义字段实现
  18. 用 node.js 的 hexo 框架搭建一个支持 markdown 的静态博客系统
  19. Wiki版产品需求---产品需求文档到底是谁的?产品到底是谁的?
  20. React中利用axios来实现数据请求

热门文章

  1. Cobalt Strike 之:提权
  2. LeetCode-539 最小时间差
  3. Linux操作命令(一)1.ls命令 2.cd命令 3.pwd命令
  4. Shiro+SpringBoot前后端分离中跨域,sessionId,302问题
  5. staticmethod() 函数
  6. 容忍和污点Taint和Toleration
  7. Minio--docker部署
  8. datax clickhousewriter插件下载 elasticsearchwriter插件下载
  9. vue 学习 css第四天
  10. RockyLinux8.7 制作OpenSSH9.2 rpm包