Created
April 9, 2015 05:40
-
-
Save pudquick/354badf94978f60375e1 to your computer and use it in GitHub Desktop.
Use Apple's PrivateFramework "JavaLaunching" functions to determine if the Apple JRE is installed (without triggering the dialog)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from ctypes import CDLL | |
JavaLaunching = CDLL('/System/Library/PrivateFrameworks/JavaLaunching.framework/JavaLaunching') | |
if (JavaLaunching.JLIsRuntimeInstalled() == 0): | |
print "Apple JRE is not installed." | |
sys.exit(1) | |
else: | |
print "Apple JRE is installed." | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment