I have written a C# application that requires the Visual C++ 2010 redistributable to be installed, and I'm using the built-in "Publish" mechanism in Visual Studio to distribute the app -- which uses Microsoft's "ClickOnce" installer technology.
I discovered that I needed to click on the "Prerequisites" button on the Publish page, but there lies a problem.
Not knowing whether a user is x86 or 64-bit, I have to check box the x86 and x64 versions of the redistributable.
But if an x86 user installs it, they get an 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."
But if I don't include the x64 version, then 64-bit users can't user the installer.
Another issue is that some users get the error "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine", and the installer fails.
This whole thing seems like a big mess. Isn't the ClickOnce installer tech smart enough to figure out whether the user needs the x86 or 64-bit version of the C++ redistributable? And if a newer version is installed, is that really a show stopper?
This all seems very brittle and it seems as though there should be a very simple fix for it.