我有一个 Visual C++ 2013 解决方案,包括许多 C++ 项目和一个 WIX 安装程序项目。
在 x64 平台上,一切正常。
但是在x86平台上,C++项目的$(OutDirectory)$(Platform)$(Configuration)是...Win32...,但是WIX的$(OutDirectory)$(Platform)$(Configuration)是...x86。 ..
我能做些什么?
最佳答案
您应该将所有项目作为引用添加到您的 WiX 项目中。假设您的一个 C++ 项目名为“MyHelperProject”。您可以像这样访问该项目的输出二进制文件:
<Component Guid="{723E4174-C9D2-4385-844E-C7D035B0C8FB}" Directory="INSTALL_ROOT">
<File Source="$(var.MyHelperProject.TargetPath)" KeyPath="yes"/>
</Component>
或者,如果您想从该构建中获取其他文件:
<Component Guid="{A0D64469-A90C-4DF3-A54B-B386AC49E6E7}" Directory="INSTALL_ROOT">
<File Source="$(var.MyHelperProject.TargetDir)required_file.txt" KeyPath="yes"/>
</Component>
关于c++ - 如何在 Wix 中将 $(var.Platform) 从 x86 更改为 Win32,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30873077/