Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distributing VC++ Redist... running installer when already installed causes problems

Using the Inno installer, we distribute the VC++ redistributable with our app so we can run it automatically. We've found that running it on a system where it's already installed asks us to repair/undo the installation which is going to totally confuse users.

Is there a way around this? Maybe a flag on the installer or something?

Thanks.

like image 732
Mr. Boy Avatar asked Mar 17 '10 11:03

Mr. Boy


People also ask

How do I fix Microsoft Visual C++ redistributable package installation failed?

The Microsoft Visual C++ installation error might be caused by corrupted registry keys. In this case, the Microsoft Program Install and Uninstall troubleshooter could resolve the issue. The Microsoft Program Install and Uninstall Troubleshooter will scan and repair corrupted registry keys.

How do I know if Vcredist is installed?

To check if Visual C++ redistributables are installed, open Add and Remove Programs and look for the Microsoft Visual C++ Redistributable. If installed, you see "Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.22.

What is Visual C++ runtime installer?

The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.


2 Answers

Try the /q flag http://support.microsoft.com/kb/227091 (assuming you're installing it via calling msiexec.exe on their redistributable)

like image 192
Kyle Alons Avatar answered Sep 28 '22 00:09

Kyle Alons


For some reason none of the above answers worked for me. This did, however:

[Run]
Filename: {tmp}\vcredist_x86.exe; Parameters: "/passive /Q:a /c:""msiexec /qb /i vcredist.msi"" "; StatusMsg: Installing 2010 RunTime...
[Files]
Source: vendor/vcredist_x86.exe; DestDir: {tmp}

I got the hint for it by running vcredist_x86.exe /?, as noted at the bottom of this thread: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a8d4d5b4-7927-4c86-95e8-3cd8b3018ae8/

As a further note, another possible option for redistribution is to just static link against (your version of) the msvcrt see comments in http://blogs.msdn.com/b/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx (though MS apparently frowns on this type of static linking, at least you won't need a dll).

Distributing the Visual C++ Runtime Libraries (MSVCRT) may also be useful.

Also note that if you can guarantee you'll have control, you can just include msvcr100.dll in the same directory as your executable and that would work, too, though not a very standard solution.

like image 39
rogerdpack Avatar answered Sep 27 '22 23:09

rogerdpack