With previous versions of VS you could query the registry to determine the installation directory for VS:
HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0
However, this doesn't seem to work with the VS2017 RC. We have scripts that detect the latest installed VS and then do "the right thing", and so far I'm having issues plugging VS2017 into those systems.
Does anyone know how to programmatically determine the installation location for VS2017?
I use powershell like KindDragon suggested
You can use
vswhere
tool to get VS2017 location.Example:
You can read more about it here: https://blogs.msdn.microsoft.com/heaths/2017/02/25/vswhere-available/
I had a devil of time trying to modify Srekel's answer to search for only VS2017. Note: If you put the "for" statement below inside an "if" block it will wreck the escape characters and won't work.