Find install path of office word 2010
I found this article which describe how to find the install path of office:
http://support.microsoft.com/kb/234788/en-us
But in the article are only the GUIDs up to office 2007, what are the GUIDs for office 2010 or where can I fi开发者_开发技巧nd them?
I use these registry entries:
HKLM\SOFTWARE\Microsoft\Office\11.0\Word\InstallRoot\Path
HKLM\SOFTWARE\Microsoft\Office\12.0\Word\InstallRoot\Path
HKLM\SOFTWARE\Microsoft\Office\14.0\Word\InstallRoot\Path
If you have a MSI installer you can use RegLocator table (registry searches).
Generally there's a better way to do this for products that are both installed via the Windows Installer service and support updating from one version to the next. Use the upgrade code, which you get from the Property table of an Office MSI file.
I don't have a bunch of Office versions to compare, but if they've taken their own advice and kept the upgrade code constant across versions, then you can call MsiEnumRelatedProducts to get the product code for the version of Office that's installed on your machine. With the product code you can call MsiGetProductInfo to get the install location, the version, the date it was installed, a list of transforms that were applied to the install... lots of stuff.
Do it this way, and you don't have to worry about not being able to detect some future version of Office.
This is the documentation you want to be looking at.
http://msdn.microsoft.com/en-us/library/aa370103%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa370130%28v=VS.85%29.aspx
This seems like what you need.
For Office 2010 you can try the Common key:
HKLM\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot
精彩评论