diff --git a/horizonzdr/hzdr.py b/horizonzdr/hzdr.py index 7c40be8..be312ed 100644 --- a/horizonzdr/hzdr.py +++ b/horizonzdr/hzdr.py @@ -37,10 +37,10 @@ LOCAL_USER_SETTINGS = os.path.join( "Saved", "Config", "WindowsNoEditor", "GameUserSettings.ini" ) VIDEO_PATH = os.path.join(get_steamapps_common_path(), "Horizon Zero Dawn Remastered", "Movies", "Mono") -input_file = os.path.join(SCRIPT_DIRECTORY, 'input.reg') -config_file = os.path.join(SCRIPT_DIRECTORY, 'config_registry.txt') +input_file = os.path.join(SCRIPT_DIRECTORY, 'graphics.reg') +config_file = os.path.join(SCRIPT_DIRECTORY, 'graphics_config.txt') hive = winreg.HKEY_CURRENT_USER -subkey = r"SOFTWARE\Guerilla Games\Horizon Zero Dawn Remastered\Graphics" +subkey = r"SOFTWARE\\Guerilla Games\\Horizon Zero Dawn Remastered\\Graphics" user.FAILSAFE = False diff --git a/horizonzdr/hzdr_utils.py b/horizonzdr/hzdr_utils.py index 71975cf..eca9620 100644 --- a/horizonzdr/hzdr_utils.py +++ b/horizonzdr/hzdr_utils.py @@ -2,10 +2,14 @@ from argparse import ArgumentParser import re import winreg +import os def export_registry_key(hive, subkey, input_file): try: + if not os.path.exists(input_file): + with open(input_file, 'w') as file: + file.write("") with winreg.OpenKey(hive,subkey) as reg_key: with open(input_file, 'w') as reg_file: reg_file.write(f"Windows Registry Editor Version 5.00\n\n") @@ -33,7 +37,7 @@ def convert_dword_to_decimal(dword_hex): return int(dword_hex, 16) def process_registry_file(input_file, config_file): - export_registry_key() + export_registry_key(hive, subkey, input_file) with open(input_file, 'r') as file: lines = file.readlines()