How to get installed VisualStudio extensions programmatically?

Does this help:

System.IServiceProvider serviceProvider = package as System.IServiceProvider;
    Microsoft.VisualStudio.ExtensionManager.IVsExtensionManager em =
       (Microsoft.VisualStudio.ExtensionManager.IVsExtensionManager)serviceProvider.GetService(
            typeof(Microsoft.VisualStudio.ExtensionManager.SVsExtensionManager));

    string result = "";
    foreach(Microsoft.VisualStudio.ExtensionManager.IInstalledExtension i in em.GetInstalledExtensions())
    {
        Microsoft.VisualStudio.ExtensionManager.IExtensionHeader h = i.Header;
        if (!h.SystemComponent)
            result += h.Name + " (by " + h.Author + ") v" + h.Version + " " + h.MoreInfoUrl + System.Environment.NewLine;
    }

Copied from https://vlasovstudio.com/visual-commander/commands.html #20.


Another possibility, if you don't want DTE, because you are not running from within Visual Studio or are concerned about performance you can query the extensions from the file system / registry:

For User Extensions %LocalAppData%\Microsoft\VisualStudio*.vsix

For General Extensions \Common7\IDE\Extensions*.vsix

IF you want to be 100% correct you can look up the paths in \Common7\IDE\devenv.pkgdef

NOTE: There can be additional paths in the PkgDefSearchPath.

To check wether a User Extensions is enabled or not you have to query the registry: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ExtensionManager\EnabledExtensions

There are some other rules that apply, which you can find in this blog from Microsoft: http://blogs.msdn.com/b/visualstudio/archive/2010/02/19/how-vsix-extensions-are-discovered-and-loaded-in-vs-2010.aspx