Page 1 of 1

Detect Microsoft Office 2003 and 2007

Posted: Fri Jul 31, 2009 9:56 am
by Christoph Schneegans
Is there a reliable way to detect whether Microsoft Office 2003 or 2007 are installed on the target machine?

I am using InstallAware 7 R2 Developer Edition.

Re: Detect Microsoft Office 2003 and 2007

Posted: Fri Jul 31, 2009 11:10 am
by Chris Miller
Christoph Schneegans wrote:Is there a reliable way to detect whether Microsoft Office 2003 or 2007 are installed on the target machine?

I am using InstallAware 7 R2 Developer Edition.
There is an old MSDN article that included some sample code in ComponentCheck.cpp for a component that would telll you which version was installed.

A simpler way would be to check the registry, look under

HKCU\\Software\\Microsoft\\Office

Office 2003 will have keys under 10.0, Office 2007 will be 12.0. I would assume that Office 2010 would be under 14.0.

I would check for the existence of "WordName", in the Word key under the 10.0 and 12.0 keys, that would have a REG_SZ value if that version of Word is installed.

Posted: Sun Aug 02, 2009 8:05 am
by Christoph Schneegans
Thank you. Is there a specific reason why you read from HKCU rather than HKLM? For example, [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\11.0\\Excel\\InstallRoot\\Path] looks like a place to check.

Furthermore, AFAIK Office 2003 is 11.0, not 10.0.

Posted: Sun Aug 02, 2009 5:06 pm
by Chris Miller
Christoph Schneegans wrote:Thank you. Is there a specific reason why you read from HKCU rather than HKLM? For example, [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\11.0\\Excel\\InstallRoot\\Path] looks like a place to check.

Furthermore, AFAIK Office 2003 is 11.0, not 10.0.

It's probably 11, I just didn't have any Office 2003 machines handy. You could probably use HKLM or HKCU, the HKCU key was the first one that came to mind.