| 940 | |
| 941 | |
| 942 | def get_executable_version(filename): |
| 943 | try: |
| 944 | if WINDOWS: |
| 945 | import win32api |
| 946 | info = win32api.GetFileVersionInfo(filename, "\\") |
| 947 | ms = info['FileVersionMS'] |
| 948 | ls = info['FileVersionLS'] |
| 949 | version = win32api.HIWORD(ms), win32api.LOWORD(ms), win32api.HIWORD(ls), win32api.LOWORD(ls) |
| 950 | return '.'.join(map(str, version)) |
| 951 | elif MACOS: |
| 952 | plistfile = filename[0:filename.find('MacOS')] + 'Info.plist' |
| 953 | info = plistlib.readPlist(plistfile) |
| 954 | # Data in Info.plists is a bit odd, this check combo gives best information on each browser. |
| 955 | if 'firefox' in filename.lower(): |
| 956 | return info['CFBundleShortVersionString'] |
| 957 | if 'opera' in filename.lower(): |
| 958 | return info['CFBundleVersion'] |
| 959 | else: |
| 960 | return info['CFBundleShortVersionString'] |
| 961 | elif LINUX: |
| 962 | if 'firefox' in filename.lower(): |
| 963 | version = check_output([filename, '-v']) |
| 964 | version = version.replace('Mozilla Firefox ', '') |
| 965 | return version.strip() |
| 966 | else: |
| 967 | return "" |
| 968 | except Exception as e: |
| 969 | logv(e) |
| 970 | return "" |
| 971 | |
| 972 | |
| 973 | def get_browser_build_date(filename): |