WIX 中的整数变量

发布于 2024-10-10 04:09:18 字数 646 浏览 0 评论 0原文

我想根据品牌安装一项功能。
所以在我的brand.wxi中我定义了:

    <?define brand.FeatureLevel = 1 ?>

在我的wxs中我写道:

            <Feature Id="FF" Title="FF" Level="$(var.brand.FeatureLevel)">
                <ComponentRef Id="..." />
                <ComponentRef Id="..." />
            </Feature>

这个定义工作得很好(无论我将0还是1作为FeatureLevel)。 我唯一的问题是在编译时收到的警告:

“Level”属性无效 - 根据其数据类型“http://www.w3.org/2001/XMLSchema:integer”,值“$(var.brand.FeatureLevel)”无效 - 字符串“ $(var.brand.FeatureLevel)' 不是有效的整数值。

有办法解决这个警告吗? 我可以定义整型变量吗?我找不到办法...

I would like to install a feature according to the brand.
So in my brand.wxi I defined:

    <?define brand.FeatureLevel = 1 ?>

And in my wxs I wrote:

            <Feature Id="FF" Title="FF" Level="$(var.brand.FeatureLevel)">
                <ComponentRef Id="..." />
                <ComponentRef Id="..." />
            </Feature>

This definition works fine (wheather I've placed 0 or 1 as FeatureLevel).
My only problem is a warning I get at compilation time:

The 'Level' attribute is invalid - The value '$(var.brand.FeatureLevel)' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:integer' - The string '$(var.brand.FeatureLevel)' is not a valid Integer value.

Is there a way to fix this warning?
Can I define integer variable? I couldn't find a way...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

祁梦 2024-10-17 04:09:18

您可以安全地忽略此警告。它只是提醒您注意该预处理器变量必须计算为整数。否则,如果将brand.FeatureLevel修改为上面示例中的字母,它将抛出错误并且根本无法编译。

You can safely ignore this warning. It just points your attention that this preprocessor variable must evaluate to integer. Otherwise, if you modify brand.FeatureLevel to a letter in the sample above, it will throw an error and simply won't compile.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文