Detect installed modules

Is there a way to detect if certain modules have been installed with unity? Eg android and il2cpp? I found only a rather old answer on stackoverflow using reflection and wonder if this is still the state of affairs.

Unity hub will tell you.

This is the scripting forum… I want to automate this

Would Unity’s preprocessor directives be of use? What’s the goal of this code?

I have an sdk unity package and need to determine if the user has installed everything needed