Detect Microsoft Office 2003 and 2007

Got a problem you cannot solve? Try here.
Post Reply
Christoph Schneegans
Posts: 55
Joined: Tue Jan 09, 2007 12:20 pm

Detect Microsoft Office 2003 and 2007

Post 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.
Chris Miller
Posts: 66
Joined: Fri Mar 09, 2007 9:46 am
Location: Albany, NY
Contact:

Re: Detect Microsoft Office 2003 and 2007

Post 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.
Chris Miller
[url=http://www.versatrans.com]Tyler Technologies[/url]
[url=http://anotherlab.rajapet.net]My blog[/url]
[url=http://www.linkedin.com/in/christophermiller]My LinkedIn profile[/url]
Christoph Schneegans
Posts: 55
Joined: Tue Jan 09, 2007 12:20 pm

Post 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.
Chris Miller
Posts: 66
Joined: Fri Mar 09, 2007 9:46 am
Location: Albany, NY
Contact:

Post 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.
Chris Miller
[url=http://www.versatrans.com]Tyler Technologies[/url]
[url=http://anotherlab.rajapet.net]My blog[/url]
[url=http://www.linkedin.com/in/christophermiller]My LinkedIn profile[/url]
Post Reply