I have an issue trying to get all the installed (not activated) features in SharePoint 2010. I have one site and site collection and what I want to do is have one feature that activates all my features at the site and web scopes. I am trying to get a list of the current installed but not activated features.
SPFeatureDefinitionCollection featureDefinitions = SPContext.Current.Site.FeatureDefinitions;
While using the debugger this returns empty and does not contain any features installed, active, or not active. If I use:
It only returns the active features. I was trying to follow this https://stackoverflow.com/questions/5169848/how-to-check-whether-a-feature-has-been-activated but it does not seem to work for me. The scope of the feature containing the code is "Site"