WiX:包含文件中的定义无法从 wxs-fragment-file 中获得

发布于 2024-08-29 18:03:59 字数 759 浏览 4 评论 0原文

我有一个 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 技术交流群。

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

发布评论

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

评论(3

流绪微梦 2024-09-05 18:03:59

解决了。

示例中的内容是:

<?Include defines.wxi ?>

它应该是小写...

<?include defines.wxi ?>

那么它就像一个魅力!

/升

Solved it.

Where it in the sample says:

<?Include defines.wxi ?>

it should be lower case...

<?include defines.wxi ?>

then it works like a charm!

/L

苏大泽ㄣ 2024-09-05 18:03:59

好吧,再试一次。
您是否从主 引用了 中的任何内容?如果您从中引用任何内容,则该片段的内容对其余代码是可见的。例如,您可以引用组件 () 或组件组 ()。一旦引用任何内容,就会包含整个片段。

希望这有帮助。

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.

妄想挽回 2024-09-05 18:03:59

在您提供的错误消息的文本中,它显示“未定义的预处理器变量 '$(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. ;-)

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