WiX (Windows Installer Xml),创建通用变量 [英] WiX (Windows Installer Xml), Create universal variables

查看:41
本文介绍了WiX (Windows Installer Xml),创建通用变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过一些在线教程为 WiX 学习了几天.我看到了三个案例来创建一些变量

I was studying for WiX for several days through some online tutorial. I saw three cases to create some variables

  1. <代码> 然后使用该值作为 $(var.Variable)
  2. 创建本地化文件.输入内容为 Value</String> 然后使用值作为 !(loc.Variable)
  3. 创建一个包含文件.输入内容为 <Property Id="VARIABLE" Value="value"/> 然后包含文件,使用 Fragment 中的属性作为 [VARIABLE]
  1. <? define Variable = "value" ?> and then use the value as $(var.Variable)
  2. Create a localization file. Type in content as <String Id="Variable">Value</String> and then use the value as !(loc.Variable)
  3. Create a include file. Type in content as <Property Id="VARIABLE" Value="value" /> and then include the file, use the property in Fragment as [VARIABLE]

我知道本地化文件主要用于不同的语言环境.但我不知道我们什么时候应该使用每种情况.谁能帮忙解释一下?

I know the localization file is mainly used for different locales. But I don't know when we should use each case. Can anyone help explain?

推荐答案

我并没有经常使用这些结构.但是,我认为 Bob Arnson(WiX 开发人员)在 这个关于本地化的博客条目(解释很好,但我仍然设法混淆了自己 - 碳错误).

I haven't used these constructs that much. However, I think Bob Arnson (WiX developer) explains this pretty well in this blog entry about localization (the explanation is good, but I still manage to confuse myself - carbon error).

基本上:

  • 预处理器变量 - $(var.Variable) - 由 WiX 预处理器解析 - 它发生在编译之前 (Candle.exe).
  • 本地化变量 - !(loc.LanguageLcid) - 在链接时解析 (Light.exe).链接过程可以吐出多个不同语言的MSI文件.因此,本地化是一个链接时过程.
  • 有关本地化示例,请参阅下面的链接 3.本地化后,您就本地化了大部分或所有字段.在下面的示例中,我没有本地化 versionupgrade code - 它们对于所有输出 MSI 文件都保持不变.
  • 您必须在每种情况下确定应该本地化的内容.Manufacturer 名称是否应该本地化?也许如果您想要亚洲设置的亚洲字符,以及其他等效的拉丁字符名称?
  • 包含文件 只是在编译前包含在 WiX 源中.这就像在 C++ 中包含一个头文件.这使其成为预处理器构造.有关包含文件的使用的讨论,请参阅下面的链接 2.
  • 更新:还有燃烧引擎变量 -如果您使用 WiX 制作 setup.exe 启动器.
    • Preprocessor variables - $(var.Variable) - are resolved by the WiX preprosessor - it happens before compilation (Candle.exe).
    • Localization variables - !(loc.LanguageLcid) - are resolved at link time (Light.exe). The linking process can spit out multiple MSI files in different languages. Hence localization is a link-time process.
    • See link 3 below for a localization sample. Once you localize, you localize most or all fields. In the sample below I don't localize version and upgrade code - they remain the same for all output MSI files.
    • You have to determine in each case what should be localized. Should the Manufacturer name be localized? Perhaps if you want Asian characters for Asian setups, and an equivalent Latin character name otherwise?
    • Include files are simply included in the WiX source before compilation. It is like including a header file in C++. This makes it a preprocessor construct. See link 2 below for a discussion of the use of include files.
    • UPDATE: There are also Burn Engine Variables - if you make setup.exe launchers with WiX.
      • https://wixtoolset.org/documentation/manual/v3/xsd/wix/variable.html

      我相信还有其他技术原因.RobBob 需要照亮.WiX 4 也可能与我在 WiX 3 中习惯的有所不同 - 并且可能有我不知道的计划更改.

      I am sure there are other technical reasons as well. Rob or Bob would need to illuminate. There could also be differences in WiX 4 than what I am used to in WiX 3 - and there could be changes planned that I am unaware of.

      一些链接:

      1. 是否可以通过WIX 本地化文件的变量?(便于检索)
      2. Wix 安装程序:在命令行执行 MSIEXEC 管理员安装时设置组件条件属性(预处理器构造与其他有用构造的详细描述,以创建不同的设置)
      3. Wix 工具集许可协议多语言问题(使用本地化)
      4. Wix尽管设置了代码页,但包含在数据库代码页中不可用的字符的字符串
      5. 关于各种预处理器结构$(env.someval)$(sys.someval)、<强>$(var.someval):https://wixtoolset.org/documentation/manual/v3/overview/preprocessor.html
      1. Is it possible to pass variable to WIX localization file? (for easy retrieval)
      2. Wix Installer : Setting component condition property when doing a MSIEXEC admin install at command line (a lenghty description of preprocessor constructs versus other useful constructs to create flavors of setups)
      3. Wix toolset license agreement multi-languages issue (using localization)
      4. Wix string with characters not available in database 's codepage although codepage is set
      5. On various preprocessor constructs $(env.someval), $(sys.someval), $(var.someval): https://wixtoolset.org/documentation/manual/v3/overview/preprocessor.html

      这篇关于WiX (Windows Installer Xml),创建通用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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