fix: support standard Chromium-GOST installer path (Chromium\Application\chrome.exe)

This commit is contained in:
VolandSZ
2026-09-03 15:55:18 +03:00
parent 63194d1824
commit 63b829471d

View File

@ -38,7 +38,16 @@ def find_gost_browser_executable() -> Optional[str]:
prog_files_x86 = os.environ.get("ProgramFiles(x86)", "")
candidates = [
# Chromium-Gost (AppData / Program Files)
# Пути официального установщика Chromium-GOST (устанавливается в папку Chromium\Application)
os.path.join(local_app_data, "Chromium", "Application", "chrome.exe"),
os.path.join(local_app_data, "Chromium", "chrome.exe"),
os.path.join(local_app_data, "Programs", "Chromium", "Application", "chrome.exe"),
os.path.join(prog_files, "Chromium", "Application", "chrome.exe"),
os.path.join(prog_files, "Chromium", "chrome.exe"),
os.path.join(prog_files_x86, "Chromium", "Application", "chrome.exe"),
os.path.join(prog_files_x86, "Chromium", "chrome.exe"),
# Портативные пути и архивы Chromium-Gost
os.path.join(local_app_data, "Chromium-Gost", "chrome.exe"),
os.path.join(local_app_data, "Chromium-Gost", "Application", "chrome.exe"),
os.path.join(local_app_data, "Programs", "Chromium-Gost", "chrome.exe"),
@ -47,15 +56,11 @@ def find_gost_browser_executable() -> Optional[str]:
os.path.join(prog_files, "Chromium-Gost", "Application", "chrome.exe"),
os.path.join(prog_files_x86, "Chromium-Gost", "chrome.exe"),
os.path.join(prog_files_x86, "Chromium-Gost", "Application", "chrome.exe"),
# Яндекс.Браузер (поддерживает ГОСТ TLS при наличии КриптоПро CSP)
os.path.join(local_app_data, "Yandex", "YandexBrowser", "Application", "browser.exe"),
os.path.join(prog_files, "Yandex", "YandexBrowser", "Application", "browser.exe"),
os.path.join(prog_files_x86, "Yandex", "YandexBrowser", "Application", "browser.exe"),
# Linux / macOS пути
"/opt/chromium-gost/chrome",
"/usr/bin/chromium-gost",
"/Applications/Chromium-Gost.app/Contents/MacOS/Chromium-Gost",
"/Applications/Yandex.app/Contents/MacOS/Yandex",
]
for path in candidates:
@ -63,7 +68,7 @@ def find_gost_browser_executable() -> Optional[str]:
return os.path.abspath(path)
# 3. Поиск в системном PATH
for name in ("chromium-gost", "chrome-gost", "yandex-browser"):
for name in ("chromium-gost", "chrome-gost", "chromium"):
found = shutil.which(name)
if found:
return os.path.abspath(found)