none
PowerPoint 2013 MsiGetComponentPath returns assembly dll path instead of installation path RRS feed

  • Question

  • I am trying to retrieve the installation path for PowerPoint using MsiGetComponentPath (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370112(v=vs.85).aspx) but the path buffer is returning a path to an assembly dll instead (\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.PowerPoint\15.0.0.0__<some alpha numeric key>\Microsoft.Office.Interop.PowerPoint.dll)

    Here are the 2 use cases I am working with:

    Computer A:
    Windows 7 [64bit]
    Office 2010 [32bit]

    Computer B:
    Window 7 [64bit]
    Office 2013 [32bit]

    On computer A, using the component id of E72E0D20-0D63-438B-BC71-92AB9F9E8B54 (for PowerPoint 2010 32bit, found here: http://support.microsoft.com/kb/234788), I am able to get the installation path of "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE"

    On Computer B, using the component id of 813139AD-6DAB-4DDD-8C6D-0CA30D073B41 (for PowerPoint 2013 32bit, found here: http://social.msdn.microsoft.com/Forums/office/en-US/017c43e2-05be-4ffd-b6ab-9b3bb5751609/component-guids-for-office-2013), I receive the installation path of "\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.PowerPoint\15.0.0.0__<some alpha numeric key>\Microsoft.Office.Interop.PowerPoint.dll"

    How do I get the installation path of PowerPoint 2013 in a similar fashion as previous version of PowerPoint?

    - Does this problem have anything to do with "Click-to-Run" Office?
    Monday, September 30, 2013 2:28 PM

Answers

  • I didn't find "Virtual" in the path you mentioned, however after manually searching the registry I found this path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe

    which has the value "Path" with data of

    C:\Program Files\Microsoft Office 15\Root\Office15\

    which is exactly what I am looking for.

    Do you think looking at this registry value is a good solution for C2R versions of Office 2013 and beyond? 

    • Marked as answer by gtsky303 Thursday, January 16, 2014 4:39 PM
    Thursday, January 16, 2014 4:16 PM

All replies

  • Hi,

    Thank you for posting in the MSDN Forum.
    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!
    Best regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, October 1, 2013 7:17 AM
    Moderator
  • Can you provide any possible time frame for this (days, weeks, months?), that way I can decide what immediate path, if any, to take with the software I am developing.  

    Thank you for your help.

    Thursday, October 17, 2013 6:49 PM
  • I'm still looking for some insight into how to solve my problem with "MsiGetComponentPath".  Have you been able to talk over the issue with some senior engineers Luna Zhang?
    Thursday, January 2, 2014 8:22 PM
  • Hello gtsky303,

    There are two possible ways for getting the installation path of Office applications:

    1. You can determine the class Id at runtime by using the its progid. You can read more about this in the How to Determine the Path for an Office Application and How To Find the Path and Version of an Office Application from Visual C++ articles. As you see, there is no need to remember class Id for each version.
    2. Also you can find the installation path in the windows registry directly at:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\PowerPoint\InstallRoot\Path

    where 15.0 - the version of Office applications; PowerPoint - the name of Office applications


    Friday, January 3, 2014 1:20 PM

  • 2. Also you can find the installation path in the windows registry directly at:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\PowerPoint\InstallRoot\Path

    where 15.0 - the version of Office applications; PowerPoint - the name of Office applications


    I just checked the 2 different machines (specs mentioned by my earlier post) and found the registry location of "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\" to look like:

    Computer A:

    14.0\ 

    • doesn't contain "PowerPoint" path
    • does however (only) contain "Common" but no InstallRoot, just FilePaths.

    15.0\

    • doesn't contain "PowerPoint" path
    • does however contain "Common\InstallRoot\Path" with value of "C:\Program Files\Microsoft Office\Office15\".  This value is a valid path on this machine, however it doesn't match the needed value of ""C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE" found when using "MsiGetComponentPath".  Therefore this suggestion is not useful when needing to find the PowerPoint exe location.

    Computer B:

    15.0\

    • doesn't contain "PowerPoint" path
    • does however contain "Common\InstallRoot\Path" with value of "C:\Program Files\Microsoft Office\Office15\".  This value is a valid path on this machine, however it doesn't match the needed value of what should be found when using "MsiGetComponentPath".  Therefore this suggestion is not useful when needing to find the PowerPoint exe location.  Another thing to note was that 15.0 in this registry contains "ClickToRun" and "ClickToRunStore", while computer A does not have these.  Again leading me to believe that a Click To Run installation makes MsiGetComponentPath behave differently.

    ---

    Then I looked at the site you mentioned: http://support.microsoft.com/kb/247985 and looked at my registry again (this time just on Computer A).  

    First I went to HKEY_LOCAL_MACHINE\Software\Classes\PowerPoint.Application\CLSID and retrieve the class id (lets call this XYZ).

    Then I tried to go to HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{XYZ}\LocalServer32 but didn't find "LocalServer32".  Instead I found "InprocServer32" and that contained no "path to the server" as mentioned by that website.

    I feel that this might not work for Office 2010 or later, which may also be backed up by the "APPLIES TO" section on each of those sites you referenced (although I suspect that those are rarely updated after a solution is authored because of the over head in doing so).

    ------

    Thank you for your suggestions/help and I hope we can continue this discussion as I will be actively monitoring this thread for a solution. 

    Friday, January 3, 2014 3:34 PM
  • Most probably you have the Clic2Run edition of Office installed. Please take a look at the "How to: Verify Whether Outlook Is a Click-to-Run Application on a Computer" article at http://msdn.microsoft.com/en-us/library/office/ff864733.aspx .
    Friday, January 3, 2014 8:33 PM
  • I agree, Computer B does have Clic2Run installed.  However, Computer A does not and can not since it is running Office 2010 and Clic2Run didn't become available until Office 2013 (as per the website you just referred met too).

    Therefore, how do you explain the missing "PowerPoint" path mentioned above on Computer A, which is not Clic2Run?

    Also, the mere fact that you brought up Clic2Run leads me to believe that Microsoft limits the logic of finding the installation path for that type of installation.  Is that correct?

    To summarize, I still have no solution for obtaining the installation path of PowerPoint (i.e. where the PowerPoint.exe file lives) that works on Computer A and B.

    As always, thanks again for your continued help in this matter.

    Monday, January 6, 2014 4:22 PM
  • Office 2010 has the corresponding Click2Run edition.

    >> Therefore, how do you explain the missing "PowerPoint" path mentioned above on Computer A, which is not Clic2Run?

    There is a difference between the x86 and x64 editions of Office. I have got the same path on my PC with Office 2013 x64 installed. It looks like x64 based Office applications don't include the host application name to the file path.

    >> Also, the mere fact that you brought up Clic2Run leads me to believe that Microsoft limits the logic of finding the installation path for that type of installation.  Is that correct?

    Yes, that is.

    Monday, January 6, 2014 6:56 PM
  • Hi gtsky303

    Actually, there is a "Click-to-Run" version of Office 2010. It is NOT identical to the 2013 C2R. The 2010 version runs in a "sandboxed" mode so that external code cannot work with the programming interfaces.

    If Computer A is the 2010 Click-to-Run then that explains completely why you aren't able to access this information - it's not available to you by design.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 7, 2014 9:32 AM
    Moderator
  • Cindy,

    The question is not related to identity. There is no need to work with programming interfaces. 

    All Click2Run Office versions keep their installation path in the same place:

    Office 2010 - PowerPoint
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\PowerPoint\InstallRoot\Path
    
    Office 2013 - PowerPoint 
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\PowerPoint\InstallRoot\Path
    

    Tuesday, January 7, 2014 9:41 AM
  • Hi gtsky303

    Actually, there is a "Click-to-Run" version of Office 2010. It is NOT identical to the 2013 C2R. The 2010 version runs in a "sandboxed" mode so that external code cannot work with the programming interfaces.

    If Computer A is the 2010 Click-to-Run then that explains completely why you aren't able to access this information - it's not available to you by design.


    Cindy Meister, VSTO/Word MVP, my blog

    But I am able to get the path using MsiGetComponentPath on Computer A.  It's the C2R Computer B that is the problem.  Which based on the recent posts, it appears MsiGetComponentPath can't be used with C2R installations.

    Furthermore, it seems that the only way to get the installation path for C2R office applications such as PowerPoint is through the registry.  However I am still not able to do this based on my previous post stating that my registry entries are different than what Eugene is referencing and I am not sure why.

    Tuesday, January 7, 2014 4:54 PM
  • Hi gtsky303,

    I'd suggest using the following scenario for detecting the installation path of Office applications:

    1. Check out the windows registry keys for the Click2Run edition.

    2. If there were no keys, use the MsiGetComponentPath method.

    However, you can change the order of actions. Could you please describe the problematic machine where you can't get the path?

    You can read more about Click2Run editions in the Click-to-Run and Office on Demand article. Also, if you develop COM add-ins, you may be interested in the Office 2010 Click-to-Run compatibility with add-ins document.

    Wednesday, January 8, 2014 7:01 PM
  • "Could you please describe the problematic machine where you can't get the path?"

    What type of information are you looking for, other than what I provided in my previous posts.

    • On my post dated Friday, January 03, 2014 3:34 PM  I talked about how Computer B with its C2R install has different registry entries than what is needed to determine the location of PowerPoint.exe.
    • On my original post I list a few specs of Computer B.

    I am not sure if this will help our discussion, but ultimately what I am trying to do is get the path to the PowerPoint OLB file (which is in the same directory as the PowerPoint.exe) for what ever version (including and after PowerPoint 2003( of PowerPoint is installed on the user's machine.  Once I have that OLB file I can use a third party library called JACOB to interface with that version of PowerPoint.  This logic has worked on various versions of PowerPoint until I tried it on a C2R install of PowerPoint 2013.  If this complicates the discussion then please feel free to ignore as I don't want to stray from the inability to locate the PowerPoint.exe file on a C2R installation.

    Thursday, January 9, 2014 3:07 PM
  • Hi gtsky303,

    <I talked about how Computer B with its C2R install has different registry entries than what is needed to determine the location of PowerPoint.exe.>

    What is the difference? I've re-read your message and didn't find any mentions what path you see on the problematic machine.

    Thursday, January 9, 2014 4:18 PM
  • On Computer B, in the registry (not expanding some locations marked with <...>):

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\

    .................15.0\

    ..........................ClickToRun\ <...>

    ..........................ClickToRunStore\ <...>

    ..........................Common\

    ...................................FilesPaths\ <...>

    ...................................InstallRoot\

    .........................................Path = C:\Program Files\Microsoft Office\Office15\

    ..........................OEM\ <...>

    ..........................Common\ <...>

    ...........................Excel\ <...>

    ...........................MS Project\ <...>

    ...........................Outlook\ <...>

    ............................Word\ <...>

    The goal is to get the path of "C:\Program Files\Microsoft Office 15\root\office15" because that is the location of PowerPoint.exe (and MSPPT.OLB), but as you can see from the registry entries shown above the paths don't match.  

    A work around might be to write static rules for each version of microsoft office as it is released (e.g. if office 15 is found in registry replace "Microsoft Office\Office15\" found in the registry with "Microsoft Office 15\root\office15", however this is not ideal as it requires constant updating on our end.  

    Ideally, using the 2 detection methods you mentioned would be ideal for Office 2003 and beyond but as you can see neither one work as you mentioned for C2R PowerPoint 2013.


    • Edited by gtsky303 Thursday, January 9, 2014 6:59 PM the tabs I entered were removed when I submitted the reply text.
    Thursday, January 9, 2014 6:57 PM
  • Hi gtsky303,

    Well, I didn't find anything in MSDN related to the issue.

    Did you install all Office 2013 applications at once on the problematic PC? Or did you choose/add PowerPoint later to the PC? I.e. it was a separate installation.

    Monday, January 13, 2014 9:22 AM
  • Office 2013 applications were installed all at once.
    Tuesday, January 14, 2014 2:38 PM
  • Hi gtsky,

    Here is what I've found so far in MSDN:

    Detecting Click-to-Run

    To detect the existence of Outlook (suppose the same applies to all host applications) in the Click-to-Run environment, verify that the VirtualOutlook (in your case VirtualPowerPoint etc.) key exists in the following registry key:

    HKLM\Software\Microsoft\Office\15.0\Common\InstallRoot\Virtual\VirtualOutlook

    If the VirtualOutlook key exists, then Outlook has been delivered as a Click-to-Run application.

    Well, it confirms my assumptions that another registry key is used for Office 2013.

    Wednesday, January 15, 2014 8:15 PM
  • I didn't find "Virtual" in the path you mentioned, however after manually searching the registry I found this path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\powerpnt.exe

    which has the value "Path" with data of

    C:\Program Files\Microsoft Office 15\Root\Office15\

    which is exactly what I am looking for.

    Do you think looking at this registry value is a good solution for C2R versions of Office 2013 and beyond? 

    • Marked as answer by gtsky303 Thursday, January 16, 2014 4:39 PM
    Thursday, January 16, 2014 4:16 PM
  • I'd say this is the right way for detecting whether the C2R edition of Office installed on the PC.
    Thursday, January 16, 2014 4:36 PM