I have installed base managed package in org. Now depends on customers need i will install 'Extension package' on that org.

Now I want to know that, Is there any way in apex, that tell me, extension package is installed or not on base package?

(I want to know this thing, because if customer didn't installed extension package then i will show them appropriate message)

Thanks in advance.


1 Answer 1


This should be possible using metadata API to list installed packages. There is an APEX wrapper available here:


You can also install packages with it: http://andyinthecloud.com/2013/06/23/look-ma-no-hands-automating-install-and-uninstall-of-packages/

Here are some thoughts on getting the version numbers of installed managed packages and compare them to what's available on appexchange.

Dynamically get most recent version of Managed Package listed on AppExchange

There I used a trick to get the list of installed packages together with other information by parsing the setup page

PageReference p = new PageReference('/0A3');
String html = p.getContent().toString();

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .