5

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.

Daniel Bigham
  • 187
  • 3
  • 8

1 Answers1

0

ClickOnce is the actual deployment of the application, not the bootstrapper. Publishing a ClickOnce application will create a setup.exe that is a bootstrapper that installs the prerequisites for you. Your problem is with the prerequisite.

You can use the bootstrapper manifest generator (or notepad) to create the XML package information needed to make the C++ redistributable into a prerequisite package that you can select from the Visual Studio/Publish/Prerequisites dialog. I recommend you set up the prerequisite this way, and look at some of the other packages in the Bootstrapper folder (like SQLExpress) to see how they have done this.

RobinDotNet
  • 11,723
  • 3
  • 30
  • 33