FreeThinker Posted July 29, 2016 Share Posted July 29, 2016 (edited) Question: How to detect if a specific mod is installed by code? I need to know in order to enable certain features .. Edited August 1, 2016 by FreeThinker Link to comment Share on other sites More sharing options...
wasml Posted August 2, 2016 Share Posted August 2, 2016 I've lost the source where I found this - think it was Sarbian that posted this: bool isThatModLoaded = AssemblyLoader.loadedAssemblies.Any(a => a.name == "TheModName"); Link to comment Share on other sites More sharing options...
JPLRepo Posted August 2, 2016 Share Posted August 2, 2016 (edited) internal static bool IsModInstalled(string assemblyName) { Assembly assembly = (from a in assemblies where a.FullName.Contains(assemblyName) select a).FirstOrDefault(); return assembly != null; } Returns true if the passed in string matches a loaded assembly name. eg: Bool IsEveInstalled = IsModInstalled("EveManager"); Sorry for the formatting. This forum software is not phone friendly Edited August 2, 2016 by JPLRepo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now