gpt4 book ai didi

wix - 利用 heat.exe 并获取已本地化的文件名,并使用 wix 将它们包含到 msi 中

转载 作者:行者123 更新时间:2023-12-02 03:49:20 28 4
gpt4 key购买 nike

我有一个问题,我想做的事情是否可行,如果答案是肯定的,该怎么做。

我是 wix 的新手,一直在阅读如何动态地将文件夹包含到安装程序中,最终我能够在 nant 中执行一项任务,使用 heat.exe 生成 wxs 文件,然后添加新生成的文件wxs 文件来点亮和蜡烛任务。这允许我将文件夹的内容添加到 msi,然后安装该文件夹及其内容。

我的问题始于我添加到 msi 的文件夹包含名称已本地化的文件(这是要求)。

当我将一个文件添加到目录结构中时,该文件的名称为俄语,例如,该文件不是 1252 代码页,我收到错误:

[exec] ......Templates.wxs(65) : error LGHT0311 : A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Product/@Codepage, Module/@Codepage, Patch/@Codepage, PatchCreation/@Codepage, or WixLocalization/@Codepage.

我尝试将 Product/@Codepage 设置为 65001 (UTF-8),但这并没有解决问题。

最终我想要做的是能够将文件夹及其内容添加到安装程序,然后其他人添加任意数量的文件,并将其名称本地化到该文件夹​​中。这样,每当构建运行并随后创建 msi 时,msi 将包含该文件夹及其内容。

提前非常感谢您。

最佳答案

这是 WiX.chm 关于设置 MSI 数据库代码页的说明:

You can set this to a valid Windows code page by integer like 1252, or by web name like Windows-1252. UTF-7 and UTF-8 are not officially supported because of user interface issues. Unicode is not supported.

只要您要使用不同语言命名的文件,即文件表不适合单个 Windows 代码页,您就别无选择。据说UTF-8并未得到官方支持,这给我们留下了希望。

如果将 Product 元素的 CodePage 属性设置为 UTF-8,它将成功构建。您可以毫无问题地安装/卸载生成的 MSI。我已经玩过它了,并没有遇到上面警告中提到的任何“界面问题”。

此外,我在 google 上搜索了该主题,发现 InstallShield 允许将 MSI 数据库代码页设置为 UTF-8,which is reflected in their docs (在该页面上搜索“utf-8”)。他们对潜在的界面问题有更多话要说:

However, some scenarios result in user interface issues. For example, if an end user specifies the /qb command-line option or uninstalls the product from Add or Remove Programs, Windows Installer uses very small fonts to display the user interface text in a UTF-8 database.

他们也希望保持安全,因此默认情况下此设置为 false(没有 UTF-8,只有 ASCII)。

那么,最后,在你的情况下我会怎么做?

  • 如果对安装包有严格要求,请使用 UTF-8 作为代码页
  • 在与本地化相关的所有可能组合(英语操作系统、非英语操作系统、当前文化和文化 UI 的各种组合)上测试所有可能的场景(安装/卸载/修复/升级等)
  • 如果您遇到这些幽灵“界面问题”,请将其展示给您的利益相关者,决定这是否是您可以忍受的问题,如果可以的话,发布已知问题
  • 否则,请重复这个想法,感谢生活给了您提升该领域技能的机会:)

希望这有帮助。

关于wix - 利用 heat.exe 并获取已本地化的文件名,并使用 wix 将它们包含到 msi 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12168895/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com