Starting with Visual Studio 2017 it is not possible to look in the registry where Visual Studio is installed (and if it is installed), if you need to use this path as INSTALLDIR. Instead we are required to run a tool called VSWhere, which is installed in [ProgramFilesFolder]\Microsoft Visual Studio\Installer to find out.
I am using InstallShield 2015.
My first idea was to use a Prerequisite to check for the presence of VSWhere and run the VSWhere.exe with some parameters to get an xml file generated:
vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -all -products * -property installationPath -format xml > [TempFolder]\HereIsVS.xml
Then I would use a System Search to extract the installationPath from the xml file.
But, it seemed like a Prerequisite could not call an exe already present on the target system. It needed to be included in the PreReq package.
So, I tried plan B:
First run a custom action to run the command to generate the xml file and then use a System Search to extract the installationPath from the xml file.
But it seems like it is not possible to run an exe already present on the target system.
Now I am out of ideas. Was anyone else able to find a working strategy? Please share!