I am looking for the safest way to detect what components of Microsoft Office, if any, are installed on a given workstation. I realize this could be seen as a question for Serverfault as well, but since I'll be using this in a script and many people here are more familiar with the inner workings of Office, I thought this would be the best place to ask.
I've looked at the uninstall key, but it shows components that do not actually exist on the system. I believe this has to do with the way Office can install a component on first access. I'm not fond of looking for executables as the path can theoretically change.
I ended up testing for specific registry keys, taking into account the differences between 32 and 64-bit Windows installs. I'm paying attention to the following registry locations/values:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\
—The base Office12 key on a 64-bit Windows installHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\
—The base Office12 location on a 32-bit Windows installOffice base path
\Outlook\InstallRoot\Path
—Key signifying Outlook installation pathOffice base path
\Registration\{90120000-0012-0000-0000-0000000FF1CE}
—Key for Office 12 Standard GUIDOffice base path
\Registration\{90120000-0011-0000-0000-0000000FF1CE}
—Key for Office 12 Professional Plus GUIDWith these locations I've been able to:
I have not attempted to get any more granular than this.