Within a Mathematica program with a graphical user interface I want to programmatically determine whether the code runs in a full Mathematica, a Player Pro or a CDF-Player. There seem to not be any documented functions which would allow to get that information. I understand that this might be on purpose, as the idea is that it shouldn't matter. At least Mathematica Player Pro provides basically the same functionality as Mathematica. But there are some subtle differences and of course the CDFPlayer has well known limitations.
For the moment I have ways to get that information, but they are all somewhat dirty and/or not very reliable:
- Look at variables like
$InstallationDirectory
or$BaseDirectory
and check for known directory names - Look at
SystemInformation[]
orOptions[$FrontEnd]
and use heuristics to get the desired information from what these return. - try something that is known to not work with CDF Player (e.g. export data). Will of course not work for a Player Pro.
and of course one could use any combination of these things to get a more reliable result.
Does anyone know a better way to get that information?
$LicenseType
("Professional"
for Mathematica; presumably something else for Player) or the supposedly (but not really) deprecated$ProductInformation
(gives"ProductIDName" -> "Mathematica"
vs."ProductIDName" -> "MathematicaPlayer"
). For the CDF plugin you can checkCurrentValue[PluginEnabled]
. $\endgroup$Developer`$ProtectedMode
for that too. $\endgroup$