将 MSBuild 变量传递给 Votive 中的链接器
我试图动态命名 WiX 安装程序项目的输出,以便生成的 MSI 为 MyProject-Version-Configuration.msi(例如 MyProject-1.2.0.1325-Debug)。由于输出文件的名称是由链接器(light.exe)设置的,因此我认为我应该使用 WiX 项目工具设置中的附加参数:
-out $(TargetDir)MyProject-$(Version)-$(Configuration)$(TargetExt)
不幸的是,$(TargetDir) 和 $(TargetExt) 不是在项目运行时进行评估,因此光接收:
-out MyProject-1.2.0.1325-Debug
这显然不会产生正确的输出。鉴于 $(Configuration)
设置正确,我想知道为什么 $(TargetDir)
和 $(TargetExt)
不正确?
我可以通过使用构建后事件重命名输出文件来解决该问题,然后我确实可以访问 $(TargetDir)
和 $ (TargetExt)
属性,但我想知道为什么链接器没有收到正确的命令。
I am attempting to dynamically name the output of my WiX installer project, so that the resulting MSI is MyProject-Version-Configuration.msi (e.g. MyProject-1.2.0.1325-Debug). Since the name of the output file is set by the linker (light.exe), I thought that I would use the Additional Parameters in the Tool Settings of the WiX project thusly:
-out $(TargetDir)MyProject-$(Version)-$(Configuration)$(TargetExt)
Unfortunately, $(TargetDir) and $(TargetExt) are not being evaluated when the project runs, so light receives:
-out MyProject-1.2.0.1325-Debug
which obviously does not produce the correct output. Given that $(Configuration)
is set correctly, I wonder why $(TargetDir)
and $(TargetExt)
are not?
I can work around the issue by using the post-build event to rename the output file, and then I do have access to the $(TargetDir)
and $(TargetExt)
properties, but I would like to know why the linker does not receive the correct command.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要编辑 .wixproj 文件并在 Visual Studio 之外进行此更改。据我记得 Votive 错误地转义了一些字符(AFAIR 它用 $$ 替换了 $)。
You need to edit .wixproj file and make this change outside Visual Studio. As far as I remember Votive incorrectly escapes some characters (AFAIR it replaces $ with $$).