Skip to content

Commit

Permalink
Merge pull request mtgatracker#25 from pak21/64-bit-arena
Browse files Browse the repository at this point in the history
Arena has gone 64-bit.
  • Loading branch information
Spencatro authored Jul 3, 2020
2 parents ac5655e + 9fc6073 commit 46272e3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions source/mtga/set_data/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@

def _get_data_location_hardcoded():
root = os.environ.get(
"ProgramFiles(x86)",
os.environ.get(
"ProgramFiles",
r"C:\Program Files (x86)"
)
"ProgramFiles",
r"C:\Program Files"
)
return os.path.join(root, "Wizards of the Coast", "MTGA", "MTGA_Data", "Downloads", "Data")

Expand Down Expand Up @@ -47,16 +44,15 @@ def get_win_data_location():
try:
from winreg import ConnectRegistry, OpenKey, HKEY_LOCAL_MACHINE, QueryValueEx
registry_connection = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
reg_path = r"SOFTWARE\WOW6432Node\Wizards of the Coast\MTGArena"
reg_path = r"SOFTWARE\Wizards of the Coast\MTGArena"
registry_key = OpenKey(registry_connection, reg_path)
data_location = QueryValueEx(registry_key, "Path")[0] + r"MTGA_Data\Downloads\Data"
print("Found data @ ")
print(data_location)
print(r"C:\Program Files (x86)\Wizards of the Coast\MTGA\MTGA_Data\Downloads\Data")
print(r"C:\Program Files\Wizards of the Coast\MTGA\MTGA_Data\Downloads\Data")
except:
print("Couldn't locate MTGA from registry, falling back to hardcoded path...")
data_location = _get_data_location_hardcoded()

return data_location

data_location = get_data_location()
Expand Down

0 comments on commit 46272e3

Please sign in to comment.