Open axet opened 2 months ago
Allow to work on linux (get rid of win32api)
diff --git a/sac_lib/get_file_version.py b/sac_lib/get_file_version.py index da53c0b..cacc012 100644 --- a/sac_lib/get_file_version.py +++ b/sac_lib/get_file_version.py @@ -1,5 +1,5 @@ -import win32api +import pefile def GetFileVersion(filename: str) -> str: - fileInfos = win32api.GetFileVersionInfo(filename, "\\") - return "%d.%d.%d.%d" % (fileInfos['FileVersionMS'] / 65536, fileInfos['FileVersionMS'] % 65536, fileInfos['FileVersionLS'] / 65536, fileInfos['FileVersionLS'] % 65536) \ No newline at end of file + fileInfos = pefile.PE(filename).VS_FIXEDFILEINFO + return "%d.%d.%d.%d" % (fileInfos.FileVersionMS >> 16, fileInfos.FileVersionMS & 0xFFFF, fileInfos.FileVersionLS >> 16, fileInfos.FileVersionLS & 0xFFFF)
Thanks! I'll test it and update if it works :)
How did you get all these colors? That's nice, didn't know that was possible to be shown in a github issue message
(and again for the really late response)
Allow to work on linux (get rid of win32api)