views:

2976

answers:

3

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?

+2  A: 

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.

CodeSavvyGeek
A: 

Hi,

I'm also including a prerequisite for the Microsoft Visual C++ 9.0 SP1 Redistributable package in my InstallShield project. Can you tell me what you put for the return code that the application returns if a reboot is required?

Thanks.

I actually don't check to see if the installer requested a restart; I have not found it to be necessary. I do know that InstallShield installer return codes for restart initiated and restart required are 1641 and 3010 respectively. I don't know if those codes are particular to InstallShield or not.
CodeSavvyGeek
+1  A: 

For anyone trying to detect Visual C++ 2010 runtime, you can find good instructions here: http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx