Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion chromedriver_autoinstaller/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from io import BytesIO
import platform as pf
from packaging import version
from win32com.client import Dispatch

__author__ = "Yeongbin Jo <iam.yeongbin.jo@gmail.com>"

Expand Down Expand Up @@ -167,8 +168,15 @@ def get_chrome_version():
path = PROGRAMFILES if os.path.exists(PROGRAMFILES) else PROGRAMFILESX86 if os.path.exists(PROGRAMFILESX86) else None

dirs = [f.name for f in os.scandir(path) if f.is_dir() and re.match("^[0-9.]+$", f.name)] if path else None

version = None

version = max(dirs) if dirs else None
if len(dirs) == 1:
version = dirs[0]
elif len(dirs) > 1:
parser = Dispatch("Scripting.FileSystemObject")
version = parser.GetFileVersion(os.path.join(path, "chrome.exe"))

else:
return
return version
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
packages=["chromedriver_autoinstaller"],
install_requires=[
'packaging>=23.1',
"pywin32>=301; platform_system=='Windows'"
],
entry_points={
"console_scripts": [
Expand Down