I am having an .NET 4.0 application which needs VC++ 2010 Redistributable Package installed. While creating Setup Project using Visual Studio Installer project I have selected Visual c++ 2010 Runtime Libraries (x64)
and Visual c++ 2010 Runtime Libraries (x86)
to support on both 32bit and 64bit platforms.
While testing installer on 32bit machine it gives error
Prerequisite check for system component Visual C++ 2010 Runtime Libraries (x64) failed with the following error message: "Installation of Visual C++ 2010 Runtime Libraries (x64) is supported only on x64 machines."
How can I make Visual c++ 2010 Runtime Libraries Prerequisite conditional according to platform target.
You can't, if the VC redist package won't let you. The reason is that different architectures require separate MSI setups:
So if you are really building an app and setup that is intended for both 32 and 64 bit then you build two setups, an x86 one with the x86 VC redist for 32-bit and an x64 one with the redist for 64-bit. You can add a condition to prevent the x86 setup from installing on x64, referring clients to the x64 setup.