如何在 Wix 中提供到 sourceDir 的硬编码路径

How to provide hardcoded path to sourceDir in wix

我想出了一个 wix heat.exe 收获命令

heat.exe dir ../SessionAPI/Publish -cg C_SessionAPIWebSiteComponent -gg -scom -sreg -sfrag -srd -dr SessionAPIDirectory -var ..\SessionAPI -out ./SessionAPI.wxs

这将创建 .wxs 文件,其源代码如下所示

Source="$(..\SessionAPI)\packages.config" />

但我不希望源指向环境变量,它应该像

Source="..\SessionAPI\packages.config" />

我做不到。有人可以解释一下这个问题吗?

您可以使用 XSLT 转换 Heat 生成的输出。看看这个问题和相应的答案: Move from manual component creation to harvesting with the HeatDirectory task

最好不要打系统。按照 Heat 的预期使用变量,然后在蜡烛中定义该变量。

heat.exe -var var.SessionAPI <other options>

candle.exe -dSessionAPI=..\SessionAPI <other options>