mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-11-01 21:12:35 +08:00
[Windows] Fix for Custom Chrome Installations
This commit fixes that error when you had an custom chrome installation. For example: D:\Chromium or something. Now it uses windows PATH to start chrome and if there's no PATH installation script would check default location. Here's demo for current bug: https://youtu.be/O8lPblnBIGQ
This commit is contained in:
9
utils.py
9
utils.py
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user