2
$\begingroup$

Unfortunately people use different Mathematica and CDF versions and the default setting of "InsufficientVersionWarning" in MessageOptions is True both in Mathematica and the CDF Player (which is quite annoying since there always seems to be a time lag of CDF Player releases w.r.t. to Mathematica releases). How can one easily toggle this through a CDF?

$\endgroup$
1
  • $\begingroup$ Since this is not a mma answer, I put it in the comment. find . -name "*.nb" -print -exec sed -i "s/13\.1 for/12\.1 for/g" {} \; change the 13.1 and 12.1 to desired version. Dirty way but worked. $\endgroup$ Jul 18, 2023 at 15:07

1 Answer 1

2
$\begingroup$

This simple code generates a CDF which one has to open from within the desired Mathematica or CDF Player version. Then clicking the checkbox will change the corresponding init.m file in the $PreferencesDirectory/FrontEnd folder.

CDFDeploy["ChangeInsufficentVersionWarning.cdf", #, 
   Method -> "Standalone", "Target" -> "Player"] &@
 DynamicModule[{bool = 
    "InsufficientVersionWarning" /. (MessageOptions /. 
       Options[$FrontEnd, MessageOptions])},
      Dynamic[Style[#, "ShowStringCharacters" -> False] &@Column[{
          Row[{"CDF or Mathematica version: ", 
            MathLink`CallFrontEnd@FrontEnd`Value["$NotebookLicenseType"], 
            " ", $VersionNumber
        }],

      Row[{"InsufficientVersionWarning is currently ", 
        Style[bool, Bold]}],
      Row[{
        "Change: " , Checkbox[Dynamic[bool,
          (bool = #;
            SetOptions[$FrontEnd, MessageOptions -> 

              Append[MessageOptions /. 
                 Options[$FrontEnd, 
                  MessageOptions] /. 
               ("InsufficientVersionWarning" -> _) :> Sequence[],
               ("InsufficientVersionWarning" -> bool)]
             ]) &

          ], Appearance -> Large]}]
      }]], BaseStyle -> "Section"]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.