Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include c++ as pre-req, but says "A new version already exists"

I'm using the Visual Studio Setup project. If I go to the properties of the Setup project, it lets me choose which pre-reqs are required, at which point I choose the C++ Redistributable.

On some systems, this works fine - but recently my users are reporting that the install failed because "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine."

What's the proper way to do this? Is Visual Studio's detection fouled up somehow and unable to detect C++?

like image 535
bugfixr Avatar asked Oct 29 '11 02:10

bugfixr


1 Answers

Yuck, this is ugly. I was wondering what would happen after Microsoft gave up on the side-by-side install of the runtime DLLs for VS2010. Seems clear, the interwebs are full of this installer error. The biggest victim seems to be Microsoft itself with Streets and Maps failing to install.

I'm not aware of any security patches for it so I have to guess that you haven't updated to SP1 yet. And your customers use a product of a vendor that did. This is a battle that you're always going to lose some day. Do consider taking advantage of the app-local deployment for the DLLs, copying them in the same directory as your main EXE. Simply copy them from the vc/redist directory before putting the setup package together, no need to tick the prerequisite. You'll need:

  • msvcr100.dll and msvcp100.dll for the regular CRT
  • atl100.dll if you use ATL
  • mfc100.dll, mfc100u.dll, mfcm100.dll, mfc100u.dll if you use MFC (u = Unicode, m = managed)
  • mfc100xxx.dll where xxx is the 3 letter language code if you use MFC on a non-English machine
  • vcomp100.dll if you use OpenMP in your code.

Only disadvantage is that they won't get updated if there's a security patch. That could be an advantage too, depending on what color glasses you wear. If you're uncomfortable about it then keeping the machine that creates the setup package updated, including enabling Windows Update, is an important requirement.

like image 62
Hans Passant Avatar answered Oct 04 '22 20:10

Hans Passant