如何在 Wix 中将 $(var.Platform) 从 x86 更改为 Win32

How to change $(var.Platform) from x86 to Win32 in Wix

我有一个 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>