3

I'm installing a product that requires the Visual C++ redistributables (x64). First my bootstrapper attempts to detect if vcredist (x64) is already installed...

<util:RegistrySearch Root="HKLM" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x64" Value="Installed" Variable="vcredist"/>

The key is 'virtualized' (I think), in regedit it appears under...

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\VC\Runtimes\x64

Notice I don't put the 'Wow6432Node' bit in my search because I think that's meant to be hidden by the OS?. This search ALWAYS fails....

[131C:0BC0][2013-03-18T12:42:17]: Registry key not found. Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x64'

I tried adding Win64="yes" to my registry search, no success. Any suggestions?

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Jeff McClintock
  • 1,242
  • 10
  • 27
  • Why do you need to check to see if is already installed? Just redist the MSVCRT MSM and have your MSI install it. If the same version is installed, it will be detected by the installed itself. http://stackoverflow.com/questions/6956747/c-sharp-missing-msvcr100-dll/6963678#6963678 – selbie Mar 18 '13 at 00:44
  • The reason I check is to avoid having to download vcredist unless it's actually needed. I update my software often, so it's painful for the end-users to have to download and reinstall vcredist every week. – Jeff McClintock Mar 19 '13 at 00:35

1 Answers1

5

I think you want your search to look like this:

<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x64"
                     Value="Installed" Variable="vcredist"/>

You're current code is searching for a key named HKEY_LOCAL_MACHINE under HKLM. I doubt that exists. ;)

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130