mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Change Log folder search order.
So Steam is searched before custom install, to match documentation.
This commit is contained in:
parent
7ff02567ef
commit
0ff5c515f7
@ -109,9 +109,9 @@ When looking for the log files, this app assumes:
|
||||
|
||||
In more detail, this app looks for the folder `elite-dangerous-64` in the following places:
|
||||
|
||||
1. In the `Products` folder under the launcher (in English versions of Windows usually `C:\Program Files (x86)\Frontier\EDLaunch\Products`).
|
||||
2. In the `Elite Dangerous Horizons\Products` folder under Steam (in English versions of Windows usually `C:\Program Files (x86)\Steam\steamapps\common\Elite Dangerous Horizons\Products`) and under each Steam library.
|
||||
3. In the `Elite Dangerous\Products` folder under Steam (in English versions of Windows usually `C:\Program Files (x86)\Steam\steamapps\common\Elite Dangerous\Products`).
|
||||
1. In the `Elite Dangerous Horizons\Products` folder under Steam (in English versions of Windows usually `C:\Program Files (x86)\Steam\steamapps\common\Elite Dangerous Horizons\Products`) and under each Steam library.
|
||||
2. In the `Elite Dangerous\Products` folder under Steam (in English versions of Windows usually `C:\Program Files (x86)\Steam\steamapps\common\Elite Dangerous\Products`) and under each Steam library.
|
||||
3. In the `Products` folder under the launcher (in English versions of Windows usually `C:\Program Files (x86)\Frontier\EDLaunch\Products`).
|
||||
4. `%PROGRAMFILES(X86)%\Frontier\Products` (in English versions of Windows usually `C:\Program Files (x86)\Frontier\Products`).
|
||||
5. `%LOCALAPPDATA%\Frontier_Developments\Products` (usually `C:\Users\you\AppData\Local\Frontier_Developments\Products`).
|
||||
|
||||
|
49
monitor.py
49
monitor.py
@ -256,9 +256,32 @@ class EDLogs(FileSystemEventHandler):
|
||||
|
||||
def _logdir(self):
|
||||
|
||||
# Try locations described in https://support.elitedangerous.com/kb/faq.php?id=108, in reverse order of age
|
||||
candidates = []
|
||||
|
||||
# First try under the Launcher
|
||||
# Steam and Steam libraries
|
||||
if not RegOpenKeyEx(HKEY_CURRENT_USER, r'Software\Valve\Steam', 0, KEY_READ, ctypes.byref(key)):
|
||||
valtype = DWORD()
|
||||
valsize = DWORD()
|
||||
if not RegQueryValueEx(key, 'SteamPath', 0, ctypes.byref(valtype), None, ctypes.byref(valsize)) and valtype.value == REG_SZ:
|
||||
buf = ctypes.create_unicode_buffer(size.value / 2)
|
||||
if not RegQueryValueEx(key, 'SteamPath', 0, ctypes.byref(valtype), buf, ctypes.byref(valsize)):
|
||||
steamlibs = [buf.value]
|
||||
try:
|
||||
# Simple-minded Valve VDF parser
|
||||
with open(join(buf.value, 'config', 'config.vdf'), 'rU') as h:
|
||||
for line in h:
|
||||
vals = line.split()
|
||||
if vals and vals[0].startswith('"BaseInstallFolder_'):
|
||||
steamlibs.append(vals[1].strip('"'))
|
||||
except:
|
||||
pass
|
||||
for lib in steamlibs:
|
||||
candidates.append(join(lib, 'steamapps', 'common', 'Elite Dangerous Horizons', 'Products'))
|
||||
candidates.append(join(lib, 'steamapps', 'common', 'Elite Dangerous', 'Products'))
|
||||
RegCloseKey(key)
|
||||
|
||||
# Next try custom installation under the Launcher
|
||||
key = HKEY()
|
||||
if not RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
machine().endswith('64') and
|
||||
@ -286,29 +309,7 @@ class EDLogs(FileSystemEventHandler):
|
||||
i += 1
|
||||
RegCloseKey(key)
|
||||
|
||||
# Next try locations described in https://support.elitedangerous.com/kb/faq.php?id=108, in reverse order of age
|
||||
|
||||
if not RegOpenKeyEx(HKEY_CURRENT_USER, r'Software\Valve\Steam', 0, KEY_READ, ctypes.byref(key)):
|
||||
valtype = DWORD()
|
||||
valsize = DWORD()
|
||||
if not RegQueryValueEx(key, 'SteamPath', 0, ctypes.byref(valtype), None, ctypes.byref(valsize)) and valtype.value == REG_SZ:
|
||||
buf = ctypes.create_unicode_buffer(size.value / 2)
|
||||
if not RegQueryValueEx(key, 'SteamPath', 0, ctypes.byref(valtype), buf, ctypes.byref(valsize)):
|
||||
steamlibs = [buf.value]
|
||||
try:
|
||||
# Simple-minded Valve VDF parser
|
||||
with open(join(buf.value, 'config', 'config.vdf'), 'rU') as h:
|
||||
for line in h:
|
||||
vals = line.split()
|
||||
if vals and vals[0].startswith('"BaseInstallFolder_'):
|
||||
steamlibs.append(vals[1].strip('"'))
|
||||
except:
|
||||
pass
|
||||
for lib in steamlibs:
|
||||
candidates.append(join(lib, 'steamapps', 'common', 'Elite Dangerous Horizons', 'Products'))
|
||||
candidates.append(join(lib, 'steamapps', 'common', 'Elite Dangerous', 'Products'))
|
||||
RegCloseKey(key)
|
||||
|
||||
# Standard non-Steam locations
|
||||
programs = ctypes.create_unicode_buffer(MAX_PATH)
|
||||
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, programs, CSIDL_PROGRAM_FILESX86, 0)
|
||||
candidates.append(join(programs.value, 'Frontier', 'Products')),
|
||||
|
Loading…
x
Reference in New Issue
Block a user