有没有办法将预处理器变量设置为属性的值? [英] Is there a way to set a preprocessor variable to the value of a property?

查看:23
本文介绍了有没有办法将预处理器变量设置为属性的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下代码的 WiX 包含文件

I have a WiX include file with the following code

<Fragment Id="PropertyFragment">
  <Property Id="DynamicLanguageCode" Value="[SystemLanguageID]" />
  <?define productLanguage = [DynamicLanguageCode]?>
</Fragment>

现在在我的 WiX 脚本的 Product 标签中,我想将 Language 属性设置为 productLanguage 的值,因为它只需要可本地化的整数.有没有办法让我的变量被分配属性的值?

Now in my Product tag in my WiX script I'd like to set the Language attribute to the value of productLanguage, as it only takes localizable integers. Is there a way I can get my variable to be assigned the value of the property?

谢谢

推荐答案

您似乎对 wix 变量和 Windows 安装程序属性之间的区别感到困惑.

There seems to be confusion in your mind about what the difference is between wix variables and windows installer properties.

wix 变量 可以作为 $(var.foo) 引用.可以通过将 -d 命令行参数传递给 candle.exe 来定义这样的变量.它也可以由 语法定义.wix 变量是一个仅在构建设置时存在的概念.它是在其他任何事情发生之前由 wix 预处理器填充的东西,很像 C++ 中的 #define 语句.

A wix variable can be referenced as $(var.foo). Such a variable can be defined by passing -d command line arguments to candle.exe. It can also be defined by the <?define foo="bar"?> syntax. A wix variable is a concept that only exists while building your setup. It is something that it is filled in by the wix preprocessor before anything else happens, much like #define statements in C++.

windows installer 属性 是在安装过程中填写的内容.定义属性的一种方法是将它们放在 属性表中 MSI 文件.这就是 wix 属性元素所做的.使用了一些(但不是全部)数据类型在 Windows 安装程序数据库中,您可以使用 [FOO] 语法引用这样的属性.支持这一点的数据类型的一个例子是快捷方式 数据类型,由 wix Target 属性使用快捷方式 元素.Language 数据类型 支持!

A windows installer property is something that is filled in during installation. One way to define properties is to put them in the Property table of an MSI file. This is what the wix Property element does. Some (but not all) data types used in a windows installer database allow you to reference such a property with the [FOO] syntax. One example of a data type which supports this is the Shortcut data type, used by the Target attribute of the wix Shortcut element. The Language datatype does not support this!

这篇关于有没有办法将预处理器变量设置为属性的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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