gpt4 book ai didi

wix - 我可以通过引用 Wix 片段中定义的属性来包含其中吗?

转载 作者:行者123 更新时间:2023-12-02 02:43:17 25 4
gpt4 key购买 nike

我使用的是 Wix 3.8。我有一个 Wix 库,在它的 wxs 文件中我有一个具有属性的片段:

<Fragment>
<!-- The following property is only used for reference -->
<Property Id="ReferenceProp"></Property>

<!-- other stuff here ... -->
</Fragment>

在我的设置项目中,我想使用此片段的内容,但我想以一种简单的方式完成它,因此我尝试将 PropertyRef 添加到 ReferenceProp 上面定义的属性。我收到一个错误:

Unresolved reference to symbol 'Property:ReferenceProp'

但是,如果我将所述属性更改为 ComponentGroup (以及对 ComponentGroupRef 的引用),那么它就可以工作。这是一个错误吗?它是为了以这种不直观的方式工作而设计的吗?还是我错过了什么?

编辑:需要明确的是,当我收到上述错误时,我的 PropertyRef 确实位于我的 Product 元素中。

Edit2: 在明确声明我可以使用 PropertyRef 拉入片段之前,我知道我已经看到了一些信息。以下是 Nick Ramirez 所著的《Wix 3.6 Windows Installer XML 开发人员指南》一书中的引述:

For example, properties, which are variables that you can use to store data, are represented by Property elements and could be stored in a separate file within a Fragment element. Then, by referencing just one of them in your main source file with a PropertyRef element, you'd pull all of them into your project."

要么那本书是错误的,要么这是他们删除的功能,或者是新引入的错误。

最佳答案

您需要链接到一个组件才能加载整个片段。

引用约翰·库珀的话:

You need a reference element to any one bit inside the fragment. The way Wix linking currently works, a linkage to one item in a fragment brings in the whole fragment.

For example, if you have a Component element in a fragment, you would link in the fragment using a ComponentRef with the appropriate Id attribute.

还有伊恩·威廉姆斯

Yep, you need to reference something in a fragment (DirectoryRef, ComponentRef, etc) to load the fragment (it will all be loaded, note).

Also remember to include allt he .wxs files in your call to candle and light

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-reference-a-wxs-file-from-another-td7334084.html

编辑

PropertyRef 也可以实现。我刚刚亲自检查过。更改此:

<Property Id="ReferenceProp"></Property>

对此:

<Property Id="ReferenceProp" Value="1" />

您需要设置一个值。

关于wix - 我可以通过引用 Wix 片段中定义的属性来包含其中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25814128/

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