Wix Setting language and code page attributes
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)" />
Wix Setting language and code page attributes的更多相关文章
- 转载:Character data is represented incorrectly when the code page of the client computer differs from the code page of the database in SQL Server 2005
https://support.microsoft.com/en-us/kb/904803 Character data is represented incorrectly when the cod ...
- 关于windows系统里locale、code page、ANSI编码的问题
最近把公司代码库里的代码同步下来之后编译了下,竟然出问题.问下同事说代码库肯定没问题,而我啥也没改,那到底那里出问题了呢? VS2018报的错误是:error RC2001: newline in c ...
- IIS7的FTP出错: 451 No mapping for the unicode character exists in the target multi-byte code page
提示:IIS7的FTP出错: 451 No mapping for the unicode character exists in the target multi-byte code page 今天 ...
- Linear to physical address translation with support for page attributes
Embodiments of the invention are generally directed to systems, methods, and apparatuses for linear ...
- error C2220: warning treated as error - no 'object' file generated warning C4819: The file contains a character that cannot be represented in the current code page (936).
用Visual Studio2015 编译时,遇到如下编译错误: error C2220: warning treated as error - no 'object' file generated ...
- 微软BI 之SSIS 系列 - ETL 转换时关于 Code Page (1252 and 936) 转换错误的原因和解决方法
开篇介绍 最近经常碰到在 ETL 练习中出现这种转换失败的问题,试了多种方式,同样的代码同样的源结构和表结构但是一直不能成功执行,包报错.一般有这么几种错误: Error at DST_LOAD_DA ...
- error RC1205: invalid code page
Get followings error and warnings when building project: error RC1205: invalid code pagewarning C400 ...
- nginx启动报错(1113: No mapping for the Unicode character exists in the target multi-byte code page)
使用windows版本的nginx启动时遇到(1113: No mapping for the Unicode character exists in the target multi-byte co ...
- failed (1113: No mapping for the Unicode character exists in the target multi-byte code page), client: 127.0.0.1...
nginx部署网站后,访问域名,网页显示 500 Internal Server Error ,经查看发现nginx的error.log中有报错: failed (1113: No mapping ...
- 刨根究底字符编码之七——ANSI编码与代码页(Code Page)
ANSI编码与代码页(Code Page) 一.ANSI编码 1. 如前所述,在全世界所有国家和民族的文字符号统一编码的Unicode编码方案问世之前,各个国家.民族为了用计算机记录并显示自己的字符, ...
随机推荐
- python压缩解压文件
转载CSDN坏菠萝:https://blog.csdn.net/abcwanglinyong/article/details/80840813
- 浅拷贝导致的bug
目录 深拷贝与浅拷贝区别 hutool BeanUtil.copyProperties 浅拷贝问题重现 实现深拷贝的一些工具 深拷贝与浅拷贝区别 在 Java 中,除了基本数据类型(元类型)之外,还存 ...
- 自己动手从零写桌面操作系统GrapeOS系列教程——5.GrapeOS开发环境测试
学习操作系统原理最好的方法是自己写一个简单的操作系统. 在上一讲中我们已经安装配置了开发环境,在本讲中我们来测试一下开发环境是否正常. 我们的测试流程如下: 1.在Visual Studio Code ...
- H5与原生APP调了交互方式
APP中不支持position:fixed; 改成 position:absolute; 触发H5按钮跳转APP原生页,进入调取APP的名传自己的方法 <a href="javascr ...
- OpenLayers之图形交互绘制
一.实验内容 回顾鼠标事件及事件对象,练习鼠标坐标获取: 点.线.面.圆等常规图形的交互绘制: 点.线.面.圆等常规图形的样式编辑: 点.线.面.圆等常规图形编辑: 二.实验步骤 2.1 鼠标坐标获取 ...
- 魔兽世界2009年更换代理,九城CEO至全体员工公开信
尊敬的全体第九城市员工, 最近一段时间以来,有关九城将要失去<魔兽世界>代理权的说法甚嚣尘上,各种传言四起.在目前来自<魔兽世界>的收入仍占九城收入绝大部分的情况下,对于外界的 ...
- 问题记录——nginx加载lua 模块,启动报错找不到 libluajit-5.1.so.2
环境:SUSE 12 SP3 问题说明:根据工作需求,重新编译nginx加载 lua 模块后启动报错如下: 首先是尝试在 /etc/profile 配置文件中添加环境变量并 source /etc/p ...
- [NPUCTF2020]认清形势,建立信心
[NPUCTF2020]认清形势,建立信心 题目 from Crypto.Util.number import * from gmpy2 import * from secret import fla ...
- VOLO论文笔记
Outlook Attention 设给定输入为 \(X \in R^{H \times W \times C}\), 首先经过两个线性映射得到两个输出A 和 V,A叫做outlook weight ...
- python怎么实现正确的浮点数四舍五入
round 以下示例展示对于结构相同的两组数据(1.03575000和1.03425000)保留小数后4位,使用内置函数round方法的输出结果,并不是需要的结果 print(round(1.0357 ...