From 79d2af6e0aa2764dcef054400a1df5075305b7b6 Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Sun, 13 May 2018 18:20:42 -0600 Subject: [PATCH] Fix issue #27 Several popen_program() calls were not inside try blocks causing full crashes --- .bin/Scripts/functions/setup.py | 10 ++++++++++ .bin/Scripts/system_checklist.py | 15 ++++++++++----- .bin/Scripts/user_data_transfer.py | 3 ++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.bin/Scripts/functions/setup.py b/.bin/Scripts/functions/setup.py index c6b681a8..8e873088 100644 --- a/.bin/Scripts/functions/setup.py +++ b/.bin/Scripts/functions/setup.py @@ -268,5 +268,15 @@ def install_vcredists(): os.chdir(prev_dir) +# Misc +def open_device_manager(): + popen_program(['mmc', 'devmgmt.msc']) + +def open_windows_activation(): + popen_program(['slui']) + +def open_windows_updates(): + popen_program(['control', '/name', 'Microsoft.WindowsUpdate']) + if __name__ == '__main__': print("This file is not meant to be called directly.") diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py index 7de2e52a..d3d6a978 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -81,13 +81,18 @@ if __name__ == '__main__': function=show_installed_ram, ns='Unknown', silent_function=False) # Play audio, show devices, open Windows updates, and open Activation - popen_program(['mmc', 'devmgmt.msc']) - run_hwinfo_sensors() - popen_program(['control', '/name', 'Microsoft.WindowsUpdate']) + try_and_print(message='Opening Device Manager...', + function=open_device_manager, cs='Started') + try_and_print(message='Opening HWiNFO (Sensors)...', + function=run_hwinfo_sensors, cs='Started') + try_and_print(message='Opening Windows Updates...', + function=open_windows_updates, cs='Started') if not windows_is_activated(): - popen_program('slui') + try_and_print(message='Opening Windows Activation...', + function=open_windows_activation, cs='Started') sleep(3) - run_xmplay() + try_and_print(message='Running XMPlay...', + function=run_xmplay, cs='Started') # Done print_standard('\nDone.') diff --git a/.bin/Scripts/user_data_transfer.py b/.bin/Scripts/user_data_transfer.py index 8616137e..1c787cfe 100644 --- a/.bin/Scripts/user_data_transfer.py +++ b/.bin/Scripts/user_data_transfer.py @@ -43,7 +43,8 @@ if __name__ == '__main__': umount_backup_shares() # Done - run_kvrt() + try_and_print(message='Running KVRT...', + function=run_kvrt, cs='Started') print_standard('\nDone.') pause("Press Enter to exit...") exit_script()