WiX:包含文件中的定义无法从 wxs-fragment-file 中获得
我有一个 defines.wxi
文件,其中包含我所有 wxs 文件中使用的一些好的定义。
当我尝试从
文件之一引用定义的值时,我眼前出现了 未定义的预处理器变量 '$(var.IMAGE_FOLDER)'
。
我想我在这里缺少一些微不足道的东西...... 有什么想法吗?
编辑 4 月 19 日。
发现仅当引用片段文件时才会出现该问题。
重写示例以匹配该示例。
defines.wxi
<Include>
<?define IMAGE_FOLDER="Images" ?>
</Include>
some-Fragment.wxs
<Fragment>
<?Include defines.wxi ?>
<Component Id='c.Images' Guid=".." Directory='INSTALLDIR.Images' >
<File Id='f.sample.jpg' Source='$(var.IMAGE_FOLDER)sample.jpg' Name='sample.jpg' />
</Component>
I have a defines.wxi
-file which contains some good definitions used in all my wxs-files.
When I attempt to reference the defined value from one of the <Fragment>
-files I get Undefined preprocessor variable '$(var.IMAGE_FOLDER)'
back in my face.
I guess there is something trivial I am missing here...
Any ideas?
Edit 19:th April.
Found that issue only occurs if reference from a Fragment-file.
Re-wrote sample to match that.
defines.wxi
<Include>
<?define IMAGE_FOLDER="Images" ?>
</Include>
some-Fragment.wxs
<Fragment>
<?Include defines.wxi ?>
<Component Id='c.Images' Guid=".." Directory='INSTALLDIR.Images' >
<File Id='f.sample.jpg' Source='$(var.IMAGE_FOLDER)sample.jpg' Name='sample.jpg' />
</Component>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决了。
示例中的内容是:
它应该是小写...
那么它就像一个魅力!
/升
Solved it.
Where it in the sample says:
it should be lower case...
then it works like a charm!
/L
好吧,再试一次。
您是否从主
引用了
中的任何内容?如果您从中引用任何内容,则该片段的内容对其余代码是可见的。例如,您可以引用组件 (
) 或组件组 (
)。一旦引用任何内容,就会包含整个片段。希望这有帮助。
Ok, another try.
Do you reference anything in that
<Fragment/>
from the main<Product/>
? The contents of the fragment are visible to the rest of the code in case you reference anything from it. For instance, you can reference a component (<ComponentRef/>
) or component group (<ComponentGroupRef/>
). Once anything is referenced, the entire fragment is included.Hope this helps.
在您提供的错误消息的文本中,它显示“未定义的预处理器变量 '$(var.MAGE_FOLDER)'”,而不是 $(var.IMAGE_FOLDER) - 前导 <缺少“我”。这让我认为您在代码的其余部分中引用了相同的变量,但拼写错误。
在这种情况下,candle.exe 是绝对正确的 - 它可以找到 IMAGE_FOLDER,但找不到 MAGE_FOLDER。
希望是这种情况,并且您能尽快修复它。 ;-)
In the text of the error message you provided it says "Undefined preprocessor variable '$(var.MAGE_FOLDER)'", not $(var.IMAGE_FOLDER) - the leading 'I' is missing. This made me think that you reference the same variable somewhere in the rest of your code, but misspelling it.
In this case, the candle.exe is absolutely right - it can find IMAGE_FOLDER, but can't find MAGE_FOLDER.
Hope this is the case and you'll fix it quickly. ;-)