diff --git a/scripts/wk/os/win.py b/scripts/wk/os/win.py index 4d73c21e..92d91525 100644 --- a/scripts/wk/os/win.py +++ b/scripts/wk/os/win.py @@ -219,7 +219,7 @@ def get_installed_ram(as_list=False, raise_exceptions=False): if raise_exceptions: if RAM_OK > mem.total >= RAM_WARNING: raise GenericWarning(mem_str) - if mem.total > RAM_WARNING: + if mem.total < RAM_WARNING: raise GenericError(mem_str) # Done @@ -276,6 +276,11 @@ def get_raw_disks(): json_data = get_json_from_command(cmd) raw_disks = [] + # Bail early + if not json_data: + # No RAW disks detected + return raw_disks + # Fix JSON if only one disk was detected if isinstance(json_data, dict): json_data = [json_data] @@ -595,7 +600,7 @@ def is_secure_boot_enabled(raise_exceptions=False, show_alert=False): # Command completed enabled = 'True' in proc.stdout if 'False' in proc.stdout: - msg_error = 'ERROR' + msg_error = 'DISABLED' else: msg_warning = 'UNKNOWN' @@ -603,9 +608,8 @@ def is_secure_boot_enabled(raise_exceptions=False, show_alert=False): for msg, exc in ((msg_error, GenericError), (msg_warning, GenericWarning)): if not msg: continue - msg = f'Secure Boot {msg}' if show_alert: - show_alert_box(msg) + show_alert_box(f'Secure Boot {msg}') if raise_exceptions: raise exc(msg) break diff --git a/scripts/wk/setup/win.py b/scripts/wk/setup/win.py index eac9b0f7..bfe076fb 100644 --- a/scripts/wk/setup/win.py +++ b/scripts/wk/setup/win.py @@ -645,8 +645,10 @@ def install_firefox(): profile then it is reverted so the original existing profile instead. """ current_default_profile = None - firefox_exe = f'{os.environ["PROGRAMFILES"]}/Mozilla Firefox/firefox.exe' - profiles_ini = case_insensitive_path( + firefox_exe = get_path_obj( + f'{os.environ["PROGRAMFILES"]}/Mozilla Firefox/firefox.exe', + ) + profiles_ini = get_path_obj( f'{os.environ["APPDATA"]}/Mozilla/Firefox/profiles.ini', ) program_path_32bit_exists = False @@ -673,7 +675,7 @@ def install_firefox(): run_tool('Firefox', 'Firefox', '/S', download=True) # Open Firefox to force profiles.ini update - popen_program(firefox_exe) + popen_program([firefox_exe]) sleep(5) kill_procs('firefox.exe', force=True)