I am creating an installation package for an addIn made for a few versions of Visual Studio, Data Tools and SQL Server Management Studio. My installation package has to be able to detect which one of these tools is installed (if any) so that my install wizard can disable the checkboxes for software that is not present on the machine.
In the official Inno setup documentation i found this:
function RegKeyExists(const RootKey: Integer; const SubKeyName: String): Boolean;
So now I have a method of checking the registry, and I'm pretty sure VS setup writes some data in it.
After some digging I found another useful article that seemed to guide me further at this link and this one too.
I hoped quickly into my registry to make sure this was the stuff i was looking for, but to my surprise the reference that I was looking for wasn't there.
Why this is I don't know so My fist question is:
Question: Why do the instructions tell me to look under
HKLM\Software\Microsoft\DevDiv\VS\Servicing\11.0\Ultimate
when my 'DevDiv' subfolder doesn't even contain the 'VS' subfolder?
After some more digging I came across another way to detect if software was installed on my machine via the uninstall information on this site.
After taking a peek into the referenced registry locations I found that most software is represented with a Guid named subfolder.
Question: In the uninstall information of the registry, does one software product register itself via a totally random Guid or is the subfolder name the same every time the software is installed? In other words, can I just look up which of the Guid named subfolders holds info for ie. VS2012, and hardcode that into my script as the exact place to search for?
Last Thought: If there is a better way to look up installation information I would appreciate instructions. The addIn needs detection for VS 2010, 2012, Date Tools and SSMS 2012.
I believe what you might be looking for (as far as the proper registry keys) are located under HKEY_CURRENT_USER
(HKCU). For instance, HKCU\Software\Microsoft\VisualStudio
has keys for each version, with two keys for each (version and version_config).
My current system has entries for HCKU\Software\Microsoft\VisualStudio\10.0
(and 10.0_Config
) for one version of Visual Studio and HCKU\Software\Microsoft\Microsoft SQL Server\100
that seem to be what you're after for Visual Studio and SSMS. I can't help with Date Tools (as I don't have them), but I'd suspect there are registry entries for them as well in the same registry branch.