views:

26

answers:

2

I'm using the following registry search in WiX

  <Property Id="VISUALSTUDIODIR">
      <RegistrySearch Id="VISUALSTUDIODIRCMD" Type="raw" Root="HKLM" 
      Key="Software\Microsoft\VisualStudio\10.0" Name="InstallDir" Win64="yes" />
  </Property>

Unfortunately, the path resolves to C:\ instead of the required path. Can someone help me understand why? (The registry path exists - I checked.)

+1  A: 

What happens if you remove the Win64 attribute? I have been using the following without any problems:

<Property Id="VSINSTALLDIR" Secure="yes">
  <RegistrySearch Id="VSInstallRegistry" Root="HKLM" Key="Software\Microsoft\VisualStudio\10.0" Name="InstallDir"  Type="directory" />
</Property>
liggett78
Thanks, that seems to be working - I suspect it's due to the `Secure` flag because I tried it without `Win64` and it still didn't work.
Dmitri Nesteruk
`Secure` is needed there for custom actions to work, as far as I remember. Are you using the value in a custom action?
liggett78
A: 

I'm not sure why the registry search doesn't work in your case. But have you tried referencing the standard VS properties provided by WiX instead?

Starting from WiX v3.5 VSExtension offers a number of properties containing various info about VS 2010. For instance, VS2010_ROOT_FOLDER contains full path to the Visual Studio 2010 root installation directory.

Yan Sklyarenko