Skip to content

Instantly share code, notes, and snippets.

@krispayne
Created June 23, 2017 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krispayne/36474c2ea91d22eddba48852f2750a6e to your computer and use it in GitHub Desktop.
Save krispayne/36474c2ea91d22eddba48852f2750a6e to your computer and use it in GitHub Desktop.
#!/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