Merge pull request #480 from handwerk2016/main

[Windows] Fix for custom Chrome Installations
This commit is contained in:
Pin Studios 2025-04-05 18:36:25 +08:00 committed by GitHub
commit efd1417407
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -33,6 +33,8 @@ a = Analysis(
('new_tempemail.py', '.'),
('quit_cursor.py', '.'),
('cursor_register_manual.py', '.'),
('oauth_auth.py', '.'),
('utils.py', '.'),
('.env', '.'),
('block_domain.txt', '.')
],
@ -42,7 +44,9 @@ a = Analysis(
'new_signup',
'new_tempemail',
'quit_cursor',
'cursor_register_manual'
'cursor_register_manual',
'oauth_auth',
'utils'
],
hookspath=[],
hooksconfig={},

View File

@ -13,6 +13,15 @@ def get_user_documents_path():
def get_default_chrome_path():
"""Get default Chrome path"""
if sys.platform == "win32":
# Trying to find chrome in PATH
try:
import shutil
chrome_in_path = shutil.which("chrome")
if chrome_in_path:
return chrome_in_path
except:
pass
# Going to default path
return r"C:\Program Files\Google\Chrome\Application\chrome.exe"
elif sys.platform == "darwin":
return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"