Enable C ++ as pre-req, but says: "New version already exists"

I am using the Visual Studio installation project. If I move on to the properties of the Setup project, it allows me to choose which prerequisites are required, and at what point I choose C ++ Redistributable.

On some systems, this works well, but recently, my users report that the installation failed because "a newer version of Microsoft Visual C ++ 2010 Redistributable was found on the machine."

What is the right way to do this? Is Visual Studio discovery somehow and unable to detect C ++?

+6
source share
2 answers

Yuck, this is ugly. I was wondering what will happen after Microsoft drops side by side to install the runtime libraries for VS2010. It seems clear that interwebs are full of this installer error. The biggest victim, apparently, is Microsoft itself, when Streets and Maps are not installed.

I don't know any security patches, so I have to guess that you have not updated SP1 yet. And your customers use the vendor product that did it. This is a battle you'll ever lose. Consider using local application deployment for DLLs by copying them in the same directory as your main EXE. Just copy them from the vc / redist directory before you place the installation package together, you do not need to specify the necessary condition. You will need:

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

The only drawback is that they will not be updated if there is a security fix. This can be an advantage, depending on which color glasses you wear. If you are not comfortable, then maintaining an machine that creates an updated installation package, including the inclusion of Windows Update, is an important requirement.

+4
source

Redistributable by default Visual C ++ 2010 Redistributable uses product code for discovery. Therefore, Redistributable Visual C ++ 2010 SP1 is not defined as installed. This is why the package tries to install it and does not work.

A good solution is to create your own custom precondition that uses the best detection criteria. Here is an article that can help you: http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx

Visual Studio installation projects do not support the creation of custom prerequisites. However, this can be done by manually creating the necessary manifestos.

You can find the structure of the manifest here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx

These manifests can be generated automatically using the Bootstrapper Manifest manifest tool .

After creating the package manifest, you can add all these files (including the package) to a separate folder in the Visual Studio prerequisites folder, for example:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ 

Thus, Visual Studio will show the necessary condition on the properties page of the installation project.

+1
source

Source: https://habr.com/ru/post/900327/


All Articles