Skip to content

Commit

Permalink
better detection of windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe2824 committed Nov 8, 2023
1 parent 9165687 commit 6c65d28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@

if importlib.util.find_spec("win32com"):
from win32com.client import *
WINDOWS = True
def get_version_number(file_path):
information_parser = Dispatch("Scripting.FileSystemObject")
print(information_parser)
version = information_parser.GetFileVersion(file_path)
return version
VERSION = f'v{get_version_number(sys.argv[0])}'
else:
WINDOWS = False
VERSION = 'DEV VERSION'


Expand Down Expand Up @@ -300,7 +302,7 @@ def creation_date(self, path_to_file):
last modified if that isn't possible.
See http://stackoverflow.com/a/39501288/1709587 for explanation.
'''
if platform.system() == 'Windows':
if platform.system() == 'Windows' or WINDOWS:
return os.path.getctime(path_to_file)
else:
stat = os.stat(path_to_file)
Expand Down

0 comments on commit 6c65d28

Please sign in to comment.