Created
June 23, 2017 22:34
-
-
Save krispayne/36474c2ea91d22eddba48852f2750a6e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
Check version of app installed using CFBundleVersion | |
""" | |
import os | |
import CoreFoundation | |
app = "Utilities/cocoaDialog.app" # Assumes '/Applications/App.app' | |
""" | |
Shouldn't need to change anything below here. | |
""" | |
path = "/Applications/" + app + "/Contents/Info.plist" | |
key = "CFBundleVersion" | |
if os.path.exists(path): | |
result = CoreFoundation.CFPreferencesCopyAppValue(key, path) | |
else: | |
result = "Not Installed." | |
print "<result>" + result + "</result>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment