Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically determine if the Visual C++ Runtime 8.0 is installed?

I have an InstallShield installation that uses custom actions that depends on the Visual C++ Runtime 8.0 sp1. In the past, I was able to install the runtime using the merge module provided by Microsoft with Visual Studio. Based on the way the Visual C++ Runtime 8.0 sp1 side-by-side installation works on Vista, the runtime cannot be used until the commit sequence of the installation.

This means that I must either move the executing of my custom actions to the commit sequence (undesirable, since the installation can't be rolled back during this sequence if something goes wrong) or install the Visual C++ Runtime before my installation using an InstallShield prerequisite.

I would prefer to install the Visual C++ Runtime as a prerequisite, but a prerequisite for this is not provided by InstallShield, so I had to write my own. I was able to figure out how to configure the prerequisite to install the runtime, but I don't know how to determine if it is already installed. Is there a registry key or file version I can check to determine this?

like image 887
Kevin Kibler Avatar asked Feb 19 '09 17:02

Kevin Kibler


People also ask

How do I know if Visual Studio runtime 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. 27821".

How do I know if I have Visual Studio installed?

If you are running Windows 7, you can find the Visual Studio 2015 application at the top of the All Programs list grouped with other application icons. If you are running Windows 10, Windows 8.1, Windows 8 or Windows 11, you can find the icon listed under the V grouping.

Where is Visual C++ runtime installed?

The current installed version number is stored in the HKEY_LOCAL_MACHINE\SOFTWARE[\Wow6432Node]\Microsoft\VisualStudio\14.0\VC\Runtimes\{x86|x64|ARM} key. The version number is 14.0 for Visual Studio 2015, 2017, 2019, and 2022 because the latest Redistributable is binary compatible with previous versions back to 2015.

How do I know what version of Visual Basic I have?

To achieve this, In Visual Studio, from the Solution Explorer, right-click on the project and select Properties -> Build Tab, and then Select Advanced button. This will bring “Advanced Build Settings” windows, where you can check the drop-down option for “Language Version”.


1 Answers

I found blog posts that describes detect the Visual C++ Runtime 8.0 and Visual C++ Runtime 8.1. Basically, you can use the MSI Automation Interface to look for the product codes for each of the runtimes.

You could also look for the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode] where [ProductCode] is the product code for the runtime you're trying to detect (eg. {7299052b-02a4-4627-81f2-1818da5d550d} is the product code for the x86 version of the 8.0 sp1 runtime).

These methods only work to detect if the runtime redistributable package is installed; it is possible that the runtime is installed even if these methods don't indicate so (eg. if it was installed as a merge module instead of using the redistributable), but it shouldn't hurt anything to install the redistributable package in this case.

like image 131
Kevin Kibler Avatar answered Oct 17 '22 10:10

Kevin Kibler