diff --git a/.bin/Scripts/activate.py b/.bin/Scripts/activate.py index 642e5edd..cf17263f 100644 --- a/.bin/Scripts/activate.py +++ b/.bin/Scripts/activate.py @@ -11,52 +11,54 @@ init_global_vars() os.system('title {}: Windows Activation Tool'.format(KIT_NAME_FULL)) if __name__ == '__main__': - try: - stay_awake() - clear_screen() - print_info('{}: Windows Activation Tool\n'.format(KIT_NAME_FULL)) - # Bail early if already activated - if windows_is_activated(): - print_info('This system is already activated') - sleep(5) - exit_script() - other_results = { - 'Error': { - 'BIOSKeyNotFoundError': 'BIOS key not found.', - }} + try: + stay_awake() + clear_screen() + print_info('{}: Windows Activation Tool\n'.format(KIT_NAME_FULL)) + # Bail early if already activated + if windows_is_activated(): + print_info('This system is already activated') + sleep(5) + exit_script() + other_results = { + 'Error': { + 'BIOSKeyNotFoundError': 'BIOS key not found.', + }} - # Determine activation method - activation_methods = [ - {'Name': 'Activate with BIOS key', 'Function': activate_with_bios}, - ] - if global_vars['OS']['Version'] not in ('8', '8.1', '10'): - activation_methods[0]['Disabled'] = True - actions = [ - {'Name': 'Quit', 'Letter': 'Q'}, - ] + # Determine activation method + activation_methods = [ + {'Name': 'Activate with BIOS key', 'Function': activate_with_bios}, + ] + if global_vars['OS']['Version'] not in ('8', '8.1', '10'): + activation_methods[0]['Disabled'] = True + actions = [ + {'Name': 'Quit', 'Letter': 'Q'}, + ] - while True: - selection = menu_select( - '{}: Windows Activation Menu'.format(KIT_NAME_FULL), - main_entries=activation_methods, action_entries=actions) + while True: + selection = menu_select( + '{}: Windows Activation Menu'.format(KIT_NAME_FULL), + main_entries=activation_methods, action_entries=actions) - if (selection.isnumeric()): - result = try_and_print( - message = activation_methods[int(selection)-1]['Name'], - function = activation_methods[int(selection)-1]['Function'], - other_results=other_results) - if result['CS']: - break - else: - sleep(2) - elif selection == 'Q': - exit_script() - - # Done - print_success('\nDone.') - pause("Press Enter to exit...") + if (selection.isnumeric()): + result = try_and_print( + message = activation_methods[int(selection)-1]['Name'], + function = activation_methods[int(selection)-1]['Function'], + other_results=other_results) + if result['CS']: + break + else: + sleep(2) + elif selection == 'Q': exit_script() - except SystemExit: - pass - except: - major_exception() + + # Done + print_success('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/cbs_fix.py b/.bin/Scripts/cbs_fix.py index 9a8ff10c..460a32a5 100644 --- a/.bin/Scripts/cbs_fix.py +++ b/.bin/Scripts/cbs_fix.py @@ -13,30 +13,32 @@ os.system('title {}: CBS Cleanup'.format(KIT_NAME_FULL)) set_log_file('CBS Cleanup.log') if __name__ == '__main__': - try: - # Prep - stay_awake() - clear_screen() - folder_path = r'{}\Backups'.format(KIT_NAME_SHORT) - dest = select_destination(folder_path=folder_path, - prompt='Which disk are we using for temp data and backup?') + try: + # Prep + stay_awake() + clear_screen() + folder_path = r'{}\Backups'.format(KIT_NAME_SHORT) + dest = select_destination(folder_path=folder_path, + prompt='Which disk are we using for temp data and backup?') - # Show details - print_info('{}: CBS Cleanup Tool\n'.format(KIT_NAME_FULL)) - show_data('Backup / Temp path:', dest) - print_standard('\n') - if (not ask('Proceed with CBS cleanup?')): - abort() + # Show details + print_info('{}: CBS Cleanup Tool\n'.format(KIT_NAME_FULL)) + show_data('Backup / Temp path:', dest) + print_standard('\n') + if (not ask('Proceed with CBS cleanup?')): + abort() - # Run Cleanup - try_and_print(message='Running cleanup...', function=cleanup_cbs, - cs='Done', dest_folder=dest) + # Run Cleanup + try_and_print(message='Running cleanup...', function=cleanup_cbs, + cs='Done', dest_folder=dest) - # Done - print_standard('\nDone.') - pause("Press Enter to exit...") - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/check_disk.py b/.bin/Scripts/check_disk.py index 7e59fb2b..1140f4fc 100644 --- a/.bin/Scripts/check_disk.py +++ b/.bin/Scripts/check_disk.py @@ -12,45 +12,47 @@ os.system('title {}: Check Disk Tool'.format(KIT_NAME_FULL)) set_log_file('Check Disk.log') if __name__ == '__main__': - try: - stay_awake() - clear_screen() - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - options = [ - {'Name': 'Run CHKDSK scan (read-only)', 'Repair': False}, - {'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}] - actions = [{'Name': 'Quit', 'Letter': 'Q'}] - selection = menu_select( - '{}: Check Disk Menu\n'.format(KIT_NAME_FULL), - main_entries=options, - action_entries=actions) - print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL)) - if selection == 'Q': - abort() - elif selection.isnumeric(): - repair = options[int(selection)-1]['Repair'] - if repair: - cs = 'Scheduled' - else: - cs = 'CS' - message = 'CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']) - try_and_print(message=message, function=run_chkdsk, - cs=cs, other_results=other_results, repair=repair) - else: - abort() + try: + stay_awake() + clear_screen() + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + options = [ + {'Name': 'Run CHKDSK scan (read-only)', 'Repair': False}, + {'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}] + actions = [{'Name': 'Quit', 'Letter': 'Q'}] + selection = menu_select( + '{}: Check Disk Menu\n'.format(KIT_NAME_FULL), + main_entries=options, + action_entries=actions) + print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL)) + if selection == 'Q': + abort() + elif selection.isnumeric(): + repair = options[int(selection)-1]['Repair'] + if repair: + cs = 'Scheduled' + else: + cs = 'CS' + message = 'CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']) + try_and_print(message=message, function=run_chkdsk, + cs=cs, other_results=other_results, repair=repair) + else: + abort() - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_success('Done.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/dism.py b/.bin/Scripts/dism.py index e49a9512..8b227da2 100644 --- a/.bin/Scripts/dism.py +++ b/.bin/Scripts/dism.py @@ -12,46 +12,48 @@ os.system('title {}: DISM helper Tool'.format(KIT_NAME_FULL)) set_log_file('DISM Helper.log') if __name__ == '__main__': - try: - stay_awake() - clear_screen() - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - disabled = bool(global_vars['OS']['Version'] not in ('8', '8.1', '10')) - options = [ - {'Name': 'Check Health', 'Repair': False, 'Disabled': disabled}, - {'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}] - actions = [{'Name': 'Quit', 'Letter': 'Q'}] - selection = menu_select( - '{}: DISM Menu\n'.format(KIT_NAME_FULL), - main_entries=options, - action_entries=actions) - print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL)) - if selection == 'Q': - abort() - elif selection.isnumeric(): - repair = options[int(selection)-1]['Repair'] - if repair: - message='DISM RestoreHealth...' - else: - message='DISM ScanHealth...' - try_and_print(message=message, function=run_dism, - cs='No corruption', ns='Corruption detected', - other_results=other_results, repair=repair) - else: - abort() + try: + stay_awake() + clear_screen() + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + disabled = bool(global_vars['OS']['Version'] not in ('8', '8.1', '10')) + options = [ + {'Name': 'Check Health', 'Repair': False, 'Disabled': disabled}, + {'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}] + actions = [{'Name': 'Quit', 'Letter': 'Q'}] + selection = menu_select( + '{}: DISM Menu\n'.format(KIT_NAME_FULL), + main_entries=options, + action_entries=actions) + print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL)) + if selection == 'Q': + abort() + elif selection.isnumeric(): + repair = options[int(selection)-1]['Repair'] + if repair: + message='DISM RestoreHealth...' + else: + message='DISM ScanHealth...' + try_and_print(message=message, function=run_dism, + cs='No corruption', ns='Corruption detected', + other_results=other_results, repair=repair) + else: + abort() - # Done - print_success('Done.') - pause("Press Enter to exit...") - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_success('Done.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/functions/network.py b/.bin/Scripts/functions/network.py index f210a2b0..492ba16f 100644 --- a/.bin/Scripts/functions/network.py +++ b/.bin/Scripts/functions/network.py @@ -1,6 +1,4 @@ -#!/bin/python3 -# -## Wizard Kit: Functions - Network +# Wizard Kit: Functions - Network import os import shutil diff --git a/.bin/Scripts/safemode_enter.py b/.bin/Scripts/safemode_enter.py index cce7e28a..027f4987 100644 --- a/.bin/Scripts/safemode_enter.py +++ b/.bin/Scripts/safemode_enter.py @@ -11,28 +11,30 @@ init_global_vars() os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL)) if __name__ == '__main__': - try: - clear_screen() - print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) - other_results = { - 'Error': {'CalledProcessError': 'Unknown Error'}, - 'Warning': {}} + try: + clear_screen() + print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) + other_results = { + 'Error': {'CalledProcessError': 'Unknown Error'}, + 'Warning': {}} - if not ask('Enable booting to SafeMode (with Networking)?'): - abort() + if not ask('Enable booting to SafeMode (with Networking)?'): + abort() - # Configure SafeMode - try_and_print(message='Set BCD option...', - function=enable_safemode, other_results=other_results) - try_and_print(message='Enable MSI in SafeMode...', - function=enable_safemode_msi, other_results=other_results) + # Configure SafeMode + try_and_print(message='Set BCD option...', + function=enable_safemode, other_results=other_results) + try_and_print(message='Enable MSI in SafeMode...', + function=enable_safemode_msi, other_results=other_results) - # Done - print_standard('\nDone.') - pause('Press Enter to reboot...') - reboot() - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + pause('Press Enter to reboot...') + reboot() + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/safemode_exit.py b/.bin/Scripts/safemode_exit.py index af66222e..85376d51 100644 --- a/.bin/Scripts/safemode_exit.py +++ b/.bin/Scripts/safemode_exit.py @@ -11,28 +11,30 @@ init_global_vars() os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL)) if __name__ == '__main__': - try: - clear_screen() - print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) - other_results = { - 'Error': {'CalledProcessError': 'Unknown Error'}, - 'Warning': {}} + try: + clear_screen() + print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) + other_results = { + 'Error': {'CalledProcessError': 'Unknown Error'}, + 'Warning': {}} - if not ask('Disable booting to SafeMode?'): - abort() + if not ask('Disable booting to SafeMode?'): + abort() - # Configure SafeMode - try_and_print(message='Remove BCD option...', - function=disable_safemode, other_results=other_results) - try_and_print(message='Disable MSI in SafeMode...', - function=disable_safemode_msi, other_results=other_results) + # Configure SafeMode + try_and_print(message='Remove BCD option...', + function=disable_safemode, other_results=other_results) + try_and_print(message='Disable MSI in SafeMode...', + function=disable_safemode_msi, other_results=other_results) - # Done - print_standard('\nDone.') - pause('Press Enter to reboot...') - reboot() - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + pause('Press Enter to reboot...') + reboot() + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/settings/windows_builds.py b/.bin/Scripts/settings/windows_builds.py index 2817979a..216be21f 100644 --- a/.bin/Scripts/settings/windows_builds.py +++ b/.bin/Scripts/settings/windows_builds.py @@ -1,193 +1,195 @@ # Wizard Kit: Settings - Windows Builds WINDOWS_BUILDS = { -# Build Version Release Codename Marketing Name Notes - '6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'), - '6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'), - '6001': ( 'Vista', 'SP1', 'Longhorn', None, 'unsupported'), - '6002': ( 'Vista', 'SP2', 'Longhorn', None, 'unsupported'), + # Build, Version, Release, Codename, Marketing Name, Notes + '6000': ('Vista', 'RTM', 'Longhorn', None, 'unsupported'), + '6000': ('Vista', 'RTM', 'Longhorn', None, 'unsupported'), + '6001': ('Vista', 'SP1', 'Longhorn', None, 'unsupported'), + '6002': ('Vista', 'SP2', 'Longhorn', None, 'unsupported'), - '7600': ( '7', 'RTM', 'Vienna', None, 'unsupported'), - '7601': ( '7', 'SP1', 'Vienna', None, 'outdated'), + '7600': ('7', 'RTM', 'Vienna', None, 'unsupported'), + '7601': ('7', 'SP1', 'Vienna', None, 'outdated'), - #9199 is a fake build since Win 8 is 6.2.9200 but that collides with Win 8.1 (6.3.9200) - '9199': ( '8', 'RTM', None, None, 'unsupported'), + #9199 is a fake build since Win 8 is 6.2.9200 but that collides with Win 8.1 (6.3.9200) + '9199': ('8', 'RTM', None, None, 'unsupported'), - '9200': ( '8.1', None, 'Blue', None, 'outdated'), - '9600': ( '8.1', None, 'Update', None, None), + '9200': ('8.1', None, 'Blue', None, 'outdated'), + '9600': ('8.1', None, 'Update', None, None), - '9841': ( '10', None, 'Threshold 1', None, 'preview build'), - '9860': ( '10', None, 'Threshold 1', None, 'preview build'), - '9879': ( '10', None, 'Threshold 1', None, 'preview build'), - '9926': ( '10', None, 'Threshold 1', None, 'preview build'), - '10041': ( '10', None, 'Threshold 1', None, 'preview build'), - '10049': ( '10', None, 'Threshold 1', None, 'preview build'), - '10061': ( '10', None, 'Threshold 1', None, 'preview build'), - '10074': ( '10', None, 'Threshold 1', None, 'preview build'), - '10122': ( '10', None, 'Threshold 1', None, 'preview build'), - '10130': ( '10', None, 'Threshold 1', None, 'preview build'), - '10158': ( '10', None, 'Threshold 1', None, 'preview build'), - '10159': ( '10', None, 'Threshold 1', None, 'preview build'), - '10162': ( '10', None, 'Threshold 1', None, 'preview build'), - '10166': ( '10', None, 'Threshold 1', None, 'preview build'), - '10240': ( '10', 'v1507', 'Threshold 1', None, 'unsupported'), - '10525': ( '10', None, 'Threshold 2', None, 'preview build'), - '10532': ( '10', None, 'Threshold 2', None, 'preview build'), - '10547': ( '10', None, 'Threshold 2', None, 'preview build'), - '10565': ( '10', None, 'Threshold 2', None, 'preview build'), - '10576': ( '10', None, 'Threshold 2', None, 'preview build'), - '10586': ( '10', 'v1511', 'Threshold 2', 'November Update', 'unsupported'), - '11082': ( '10', None, 'Redstone 1', None, 'preview build'), - '11099': ( '10', None, 'Redstone 1', None, 'preview build'), - '11102': ( '10', None, 'Redstone 1', None, 'preview build'), - '14251': ( '10', None, 'Redstone 1', None, 'preview build'), - '14257': ( '10', None, 'Redstone 1', None, 'preview build'), - '14271': ( '10', None, 'Redstone 1', None, 'preview build'), - '14279': ( '10', None, 'Redstone 1', None, 'preview build'), - '14291': ( '10', None, 'Redstone 1', None, 'preview build'), - '14295': ( '10', None, 'Redstone 1', None, 'preview build'), - '14316': ( '10', None, 'Redstone 1', None, 'preview build'), - '14328': ( '10', None, 'Redstone 1', None, 'preview build'), - '14332': ( '10', None, 'Redstone 1', None, 'preview build'), - '14342': ( '10', None, 'Redstone 1', None, 'preview build'), - '14352': ( '10', None, 'Redstone 1', None, 'preview build'), - '14361': ( '10', None, 'Redstone 1', None, 'preview build'), - '14366': ( '10', None, 'Redstone 1', None, 'preview build'), - '14367': ( '10', None, 'Redstone 1', None, 'preview build'), - '14371': ( '10', None, 'Redstone 1', None, 'preview build'), - '14372': ( '10', None, 'Redstone 1', None, 'preview build'), - '14376': ( '10', None, 'Redstone 1', None, 'preview build'), - '14379': ( '10', None, 'Redstone 1', None, 'preview build'), - '14383': ( '10', None, 'Redstone 1', None, 'preview build'), - '14385': ( '10', None, 'Redstone 1', None, 'preview build'), - '14388': ( '10', None, 'Redstone 1', None, 'preview build'), - '14390': ( '10', None, 'Redstone 1', None, 'preview build'), - '14393': ( '10', 'v1607', 'Redstone 1', 'Anniversary Update', 'unsupported'), - '14901': ( '10', None, 'Redstone 2', None, 'preview build'), - '14905': ( '10', None, 'Redstone 2', None, 'preview build'), - '14915': ( '10', None, 'Redstone 2', None, 'preview build'), - '14926': ( '10', None, 'Redstone 2', None, 'preview build'), - '14931': ( '10', None, 'Redstone 2', None, 'preview build'), - '14936': ( '10', None, 'Redstone 2', None, 'preview build'), - '14942': ( '10', None, 'Redstone 2', None, 'preview build'), - '14946': ( '10', None, 'Redstone 2', None, 'preview build'), - '14951': ( '10', None, 'Redstone 2', None, 'preview build'), - '14955': ( '10', None, 'Redstone 2', None, 'preview build'), - '14959': ( '10', None, 'Redstone 2', None, 'preview build'), - '14965': ( '10', None, 'Redstone 2', None, 'preview build'), - '14971': ( '10', None, 'Redstone 2', None, 'preview build'), - '14986': ( '10', None, 'Redstone 2', None, 'preview build'), - '15002': ( '10', None, 'Redstone 2', None, 'preview build'), - '15007': ( '10', None, 'Redstone 2', None, 'preview build'), - '15014': ( '10', None, 'Redstone 2', None, 'preview build'), - '15019': ( '10', None, 'Redstone 2', None, 'preview build'), - '15025': ( '10', None, 'Redstone 2', None, 'preview build'), - '15031': ( '10', None, 'Redstone 2', None, 'preview build'), - '15042': ( '10', None, 'Redstone 2', None, 'preview build'), - '15046': ( '10', None, 'Redstone 2', None, 'preview build'), - '15048': ( '10', None, 'Redstone 2', None, 'preview build'), - '15055': ( '10', None, 'Redstone 2', None, 'preview build'), - '15058': ( '10', None, 'Redstone 2', None, 'preview build'), - '15060': ( '10', None, 'Redstone 2', None, 'preview build'), - '15061': ( '10', None, 'Redstone 2', None, 'preview build'), - '15063': ( '10', 'v1703', 'Redstone 2', 'Creators Update', 'outdated'), - '16170': ( '10', None, 'Redstone 3', None, 'preview build'), - '16176': ( '10', None, 'Redstone 3', None, 'preview build'), - '16179': ( '10', None, 'Redstone 3', None, 'preview build'), - '16184': ( '10', None, 'Redstone 3', None, 'preview build'), - '16188': ( '10', None, 'Redstone 3', None, 'preview build'), - '16193': ( '10', None, 'Redstone 3', None, 'preview build'), - '16199': ( '10', None, 'Redstone 3', None, 'preview build'), - '16212': ( '10', None, 'Redstone 3', None, 'preview build'), - '16215': ( '10', None, 'Redstone 3', None, 'preview build'), - '16226': ( '10', None, 'Redstone 3', None, 'preview build'), - '16232': ( '10', None, 'Redstone 3', None, 'preview build'), - '16237': ( '10', None, 'Redstone 3', None, 'preview build'), - '16241': ( '10', None, 'Redstone 3', None, 'preview build'), - '16251': ( '10', None, 'Redstone 3', None, 'preview build'), - '16257': ( '10', None, 'Redstone 3', None, 'preview build'), - '16273': ( '10', None, 'Redstone 3', None, 'preview build'), - '16275': ( '10', None, 'Redstone 3', None, 'preview build'), - '16278': ( '10', None, 'Redstone 3', None, 'preview build'), - '16281': ( '10', None, 'Redstone 3', None, 'preview build'), - '16288': ( '10', None, 'Redstone 3', None, 'preview build'), - '16291': ( '10', None, 'Redstone 3', None, 'preview build'), - '16294': ( '10', None, 'Redstone 3', None, 'preview build'), - '16296': ( '10', None, 'Redstone 3', None, 'preview build'), - '16299': ( '10', 'v1709', 'Redstone 3', 'Fall Creators Update', 'outdated'), - '16353': ( '10', None, 'Redstone 4', None, 'preview build'), - '16362': ( '10', None, 'Redstone 4', None, 'preview build'), - '17004': ( '10', None, 'Redstone 4', None, 'preview build'), - '17017': ( '10', None, 'Redstone 4', None, 'preview build'), - '17025': ( '10', None, 'Redstone 4', None, 'preview build'), - '17035': ( '10', None, 'Redstone 4', None, 'preview build'), - '17040': ( '10', None, 'Redstone 4', None, 'preview build'), - '17046': ( '10', None, 'Redstone 4', None, 'preview build'), - '17063': ( '10', None, 'Redstone 4', None, 'preview build'), - '17074': ( '10', None, 'Redstone 4', None, 'preview build'), - '17083': ( '10', None, 'Redstone 4', None, 'preview build'), - '17093': ( '10', None, 'Redstone 4', None, 'preview build'), - '17101': ( '10', None, 'Redstone 4', None, 'preview build'), - '17107': ( '10', None, 'Redstone 4', None, 'preview build'), - '17110': ( '10', None, 'Redstone 4', None, 'preview build'), - '17112': ( '10', None, 'Redstone 4', None, 'preview build'), - '17115': ( '10', None, 'Redstone 4', None, 'preview build'), - '17120': ( '10', None, 'Redstone 4', None, 'preview build'), - '17123': ( '10', None, 'Redstone 4', None, 'preview build'), - '17127': ( '10', None, 'Redstone 4', None, 'preview build'), - '17128': ( '10', None, 'Redstone 4', None, 'preview build'), - '17133': ( '10', None, 'Redstone 4', None, 'preview build'), - '17134': ( '10', 'v1803', 'Redstone 4', 'April 2018 Update', None), - '17604': ( '10', None, 'Redstone 5', None, 'preview build'), - '17618': ( '10', None, 'Redstone 5', None, 'preview build'), - '17623': ( '10', None, 'Redstone 5', None, 'preview build'), - '17627': ( '10', None, 'Redstone 5', None, 'preview build'), - '17634': ( '10', None, 'Redstone 5', None, 'preview build'), - '17639': ( '10', None, 'Redstone 5', None, 'preview build'), - '17643': ( '10', None, 'Redstone 5', None, 'preview build'), - '17650': ( '10', None, 'Redstone 5', None, 'preview build'), - '17655': ( '10', None, 'Redstone 5', None, 'preview build'), - '17661': ( '10', None, 'Redstone 5', None, 'preview build'), - '17666': ( '10', None, 'Redstone 5', None, 'preview build'), - '17677': ( '10', None, 'Redstone 5', None, 'preview build'), - '17682': ( '10', None, 'Redstone 5', None, 'preview build'), - '17686': ( '10', None, 'Redstone 5', None, 'preview build'), - '17692': ( '10', None, 'Redstone 5', None, 'preview build'), - '17704': ( '10', None, 'Redstone 5', None, 'preview build'), - '17711': ( '10', None, 'Redstone 5', None, 'preview build'), - '17713': ( '10', None, 'Redstone 5', None, 'preview build'), - '17723': ( '10', None, 'Redstone 5', None, 'preview build'), - '17728': ( '10', None, 'Redstone 5', None, 'preview build'), - '17730': ( '10', None, 'Redstone 5', None, 'preview build'), - '17733': ( '10', None, 'Redstone 5', None, 'preview build'), - '17735': ( '10', None, 'Redstone 5', None, 'preview build'), - '17738': ( '10', None, 'Redstone 5', None, 'preview build'), - '17741': ( '10', None, 'Redstone 5', None, 'preview build'), - '17744': ( '10', None, 'Redstone 5', None, 'preview build'), - '17746': ( '10', None, 'Redstone 5', None, 'preview build'), - '17751': ( '10', None, 'Redstone 5', None, 'preview build'), - '17754': ( '10', None, 'Redstone 5', None, 'preview build'), - '17755': ( '10', None, 'Redstone 5', None, 'preview build'), - '17758': ( '10', None, 'Redstone 5', None, 'preview build'), - '17760': ( '10', None, 'Redstone 5', None, 'preview build'), - '17763': ( '10', 'v1809', 'Redstone 5', 'October 2018 Update', None), - '18204': ( '10', None, '19H1', None, 'preview build'), - '18214': ( '10', None, '19H1', None, 'preview build'), - '18219': ( '10', None, '19H1', None, 'preview build'), - '18234': ( '10', None, '19H1', None, 'preview build'), - '18237': ( '10', None, '19H1', None, 'preview build'), - '18242': ( '10', None, '19H1', None, 'preview build'), - '18247': ( '10', None, '19H1', None, 'preview build'), - '18252': ( '10', None, '19H1', None, 'preview build'), - '18262': ( '10', None, '19H1', None, 'preview build'), - '18267': ( '10', None, '19H1', None, 'preview build'), - '18272': ( '10', None, '19H1', None, 'preview build'), - '18277': ( '10', None, '19H1', None, 'preview build'), - '18282': ( '10', None, '19H1', None, 'preview build'), - '18290': ( '10', None, '19H1', None, 'preview build'), - '18298': ( '10', None, '19H1', None, 'preview build'), - '18305': ( '10', None, '19H1', None, 'preview build'), + '9841': ('10', None, 'Threshold 1', None, 'preview build'), + '9860': ('10', None, 'Threshold 1', None, 'preview build'), + '9879': ('10', None, 'Threshold 1', None, 'preview build'), + '9926': ('10', None, 'Threshold 1', None, 'preview build'), + '10041': ('10', None, 'Threshold 1', None, 'preview build'), + '10049': ('10', None, 'Threshold 1', None, 'preview build'), + '10061': ('10', None, 'Threshold 1', None, 'preview build'), + '10074': ('10', None, 'Threshold 1', None, 'preview build'), + '10122': ('10', None, 'Threshold 1', None, 'preview build'), + '10130': ('10', None, 'Threshold 1', None, 'preview build'), + '10158': ('10', None, 'Threshold 1', None, 'preview build'), + '10159': ('10', None, 'Threshold 1', None, 'preview build'), + '10162': ('10', None, 'Threshold 1', None, 'preview build'), + '10166': ('10', None, 'Threshold 1', None, 'preview build'), + '10240': ('10', 'v1507', 'Threshold 1', None, 'unsupported'), + '10525': ('10', None, 'Threshold 2', None, 'preview build'), + '10532': ('10', None, 'Threshold 2', None, 'preview build'), + '10547': ('10', None, 'Threshold 2', None, 'preview build'), + '10565': ('10', None, 'Threshold 2', None, 'preview build'), + '10576': ('10', None, 'Threshold 2', None, 'preview build'), + '10586': ('10', 'v1511', 'Threshold 2', 'November Update', 'unsupported'), + '11082': ('10', None, 'Redstone 1', None, 'preview build'), + '11099': ('10', None, 'Redstone 1', None, 'preview build'), + '11102': ('10', None, 'Redstone 1', None, 'preview build'), + '14251': ('10', None, 'Redstone 1', None, 'preview build'), + '14257': ('10', None, 'Redstone 1', None, 'preview build'), + '14271': ('10', None, 'Redstone 1', None, 'preview build'), + '14279': ('10', None, 'Redstone 1', None, 'preview build'), + '14291': ('10', None, 'Redstone 1', None, 'preview build'), + '14295': ('10', None, 'Redstone 1', None, 'preview build'), + '14316': ('10', None, 'Redstone 1', None, 'preview build'), + '14328': ('10', None, 'Redstone 1', None, 'preview build'), + '14332': ('10', None, 'Redstone 1', None, 'preview build'), + '14342': ('10', None, 'Redstone 1', None, 'preview build'), + '14352': ('10', None, 'Redstone 1', None, 'preview build'), + '14361': ('10', None, 'Redstone 1', None, 'preview build'), + '14366': ('10', None, 'Redstone 1', None, 'preview build'), + '14367': ('10', None, 'Redstone 1', None, 'preview build'), + '14371': ('10', None, 'Redstone 1', None, 'preview build'), + '14372': ('10', None, 'Redstone 1', None, 'preview build'), + '14376': ('10', None, 'Redstone 1', None, 'preview build'), + '14379': ('10', None, 'Redstone 1', None, 'preview build'), + '14383': ('10', None, 'Redstone 1', None, 'preview build'), + '14385': ('10', None, 'Redstone 1', None, 'preview build'), + '14388': ('10', None, 'Redstone 1', None, 'preview build'), + '14390': ('10', None, 'Redstone 1', None, 'preview build'), + '14393': ('10', 'v1607', 'Redstone 1', 'Anniversary Update', 'unsupported'), + '14901': ('10', None, 'Redstone 2', None, 'preview build'), + '14905': ('10', None, 'Redstone 2', None, 'preview build'), + '14915': ('10', None, 'Redstone 2', None, 'preview build'), + '14926': ('10', None, 'Redstone 2', None, 'preview build'), + '14931': ('10', None, 'Redstone 2', None, 'preview build'), + '14936': ('10', None, 'Redstone 2', None, 'preview build'), + '14942': ('10', None, 'Redstone 2', None, 'preview build'), + '14946': ('10', None, 'Redstone 2', None, 'preview build'), + '14951': ('10', None, 'Redstone 2', None, 'preview build'), + '14955': ('10', None, 'Redstone 2', None, 'preview build'), + '14959': ('10', None, 'Redstone 2', None, 'preview build'), + '14965': ('10', None, 'Redstone 2', None, 'preview build'), + '14971': ('10', None, 'Redstone 2', None, 'preview build'), + '14986': ('10', None, 'Redstone 2', None, 'preview build'), + '15002': ('10', None, 'Redstone 2', None, 'preview build'), + '15007': ('10', None, 'Redstone 2', None, 'preview build'), + '15014': ('10', None, 'Redstone 2', None, 'preview build'), + '15019': ('10', None, 'Redstone 2', None, 'preview build'), + '15025': ('10', None, 'Redstone 2', None, 'preview build'), + '15031': ('10', None, 'Redstone 2', None, 'preview build'), + '15042': ('10', None, 'Redstone 2', None, 'preview build'), + '15046': ('10', None, 'Redstone 2', None, 'preview build'), + '15048': ('10', None, 'Redstone 2', None, 'preview build'), + '15055': ('10', None, 'Redstone 2', None, 'preview build'), + '15058': ('10', None, 'Redstone 2', None, 'preview build'), + '15060': ('10', None, 'Redstone 2', None, 'preview build'), + '15061': ('10', None, 'Redstone 2', None, 'preview build'), + '15063': ('10', 'v1703', 'Redstone 2', 'Creators Update', 'unsupported'), + '16170': ('10', None, 'Redstone 3', None, 'preview build'), + '16176': ('10', None, 'Redstone 3', None, 'preview build'), + '16179': ('10', None, 'Redstone 3', None, 'preview build'), + '16184': ('10', None, 'Redstone 3', None, 'preview build'), + '16188': ('10', None, 'Redstone 3', None, 'preview build'), + '16193': ('10', None, 'Redstone 3', None, 'preview build'), + '16199': ('10', None, 'Redstone 3', None, 'preview build'), + '16212': ('10', None, 'Redstone 3', None, 'preview build'), + '16215': ('10', None, 'Redstone 3', None, 'preview build'), + '16226': ('10', None, 'Redstone 3', None, 'preview build'), + '16232': ('10', None, 'Redstone 3', None, 'preview build'), + '16237': ('10', None, 'Redstone 3', None, 'preview build'), + '16241': ('10', None, 'Redstone 3', None, 'preview build'), + '16251': ('10', None, 'Redstone 3', None, 'preview build'), + '16257': ('10', None, 'Redstone 3', None, 'preview build'), + '16273': ('10', None, 'Redstone 3', None, 'preview build'), + '16275': ('10', None, 'Redstone 3', None, 'preview build'), + '16278': ('10', None, 'Redstone 3', None, 'preview build'), + '16281': ('10', None, 'Redstone 3', None, 'preview build'), + '16288': ('10', None, 'Redstone 3', None, 'preview build'), + '16291': ('10', None, 'Redstone 3', None, 'preview build'), + '16294': ('10', None, 'Redstone 3', None, 'preview build'), + '16296': ('10', None, 'Redstone 3', None, 'preview build'), + '16299': ('10', 'v1709', 'Redstone 3', 'Fall Creators Update', 'outdated'), + '16353': ('10', None, 'Redstone 4', None, 'preview build'), + '16362': ('10', None, 'Redstone 4', None, 'preview build'), + '17004': ('10', None, 'Redstone 4', None, 'preview build'), + '17017': ('10', None, 'Redstone 4', None, 'preview build'), + '17025': ('10', None, 'Redstone 4', None, 'preview build'), + '17035': ('10', None, 'Redstone 4', None, 'preview build'), + '17040': ('10', None, 'Redstone 4', None, 'preview build'), + '17046': ('10', None, 'Redstone 4', None, 'preview build'), + '17063': ('10', None, 'Redstone 4', None, 'preview build'), + '17074': ('10', None, 'Redstone 4', None, 'preview build'), + '17083': ('10', None, 'Redstone 4', None, 'preview build'), + '17093': ('10', None, 'Redstone 4', None, 'preview build'), + '17101': ('10', None, 'Redstone 4', None, 'preview build'), + '17107': ('10', None, 'Redstone 4', None, 'preview build'), + '17110': ('10', None, 'Redstone 4', None, 'preview build'), + '17112': ('10', None, 'Redstone 4', None, 'preview build'), + '17115': ('10', None, 'Redstone 4', None, 'preview build'), + '17120': ('10', None, 'Redstone 4', None, 'preview build'), + '17123': ('10', None, 'Redstone 4', None, 'preview build'), + '17127': ('10', None, 'Redstone 4', None, 'preview build'), + '17128': ('10', None, 'Redstone 4', None, 'preview build'), + '17133': ('10', None, 'Redstone 4', None, 'preview build'), + '17134': ('10', 'v1803', 'Redstone 4', 'April 2018 Update', 'outdated'), + '17604': ('10', None, 'Redstone 5', None, 'preview build'), + '17618': ('10', None, 'Redstone 5', None, 'preview build'), + '17623': ('10', None, 'Redstone 5', None, 'preview build'), + '17627': ('10', None, 'Redstone 5', None, 'preview build'), + '17634': ('10', None, 'Redstone 5', None, 'preview build'), + '17639': ('10', None, 'Redstone 5', None, 'preview build'), + '17643': ('10', None, 'Redstone 5', None, 'preview build'), + '17650': ('10', None, 'Redstone 5', None, 'preview build'), + '17655': ('10', None, 'Redstone 5', None, 'preview build'), + '17661': ('10', None, 'Redstone 5', None, 'preview build'), + '17666': ('10', None, 'Redstone 5', None, 'preview build'), + '17677': ('10', None, 'Redstone 5', None, 'preview build'), + '17682': ('10', None, 'Redstone 5', None, 'preview build'), + '17686': ('10', None, 'Redstone 5', None, 'preview build'), + '17692': ('10', None, 'Redstone 5', None, 'preview build'), + '17704': ('10', None, 'Redstone 5', None, 'preview build'), + '17711': ('10', None, 'Redstone 5', None, 'preview build'), + '17713': ('10', None, 'Redstone 5', None, 'preview build'), + '17723': ('10', None, 'Redstone 5', None, 'preview build'), + '17728': ('10', None, 'Redstone 5', None, 'preview build'), + '17730': ('10', None, 'Redstone 5', None, 'preview build'), + '17733': ('10', None, 'Redstone 5', None, 'preview build'), + '17735': ('10', None, 'Redstone 5', None, 'preview build'), + '17738': ('10', None, 'Redstone 5', None, 'preview build'), + '17741': ('10', None, 'Redstone 5', None, 'preview build'), + '17744': ('10', None, 'Redstone 5', None, 'preview build'), + '17746': ('10', None, 'Redstone 5', None, 'preview build'), + '17751': ('10', None, 'Redstone 5', None, 'preview build'), + '17754': ('10', None, 'Redstone 5', None, 'preview build'), + '17755': ('10', None, 'Redstone 5', None, 'preview build'), + '17758': ('10', None, 'Redstone 5', None, 'preview build'), + '17760': ('10', None, 'Redstone 5', None, 'preview build'), + '17763': ('10', 'v1809', 'Redstone 5', 'October 2018 Update', None), + '18204': ('10', None, '19H1', None, 'preview build'), + '18214': ('10', None, '19H1', None, 'preview build'), + '18219': ('10', None, '19H1', None, 'preview build'), + '18234': ('10', None, '19H1', None, 'preview build'), + '18237': ('10', None, '19H1', None, 'preview build'), + '18242': ('10', None, '19H1', None, 'preview build'), + '18247': ('10', None, '19H1', None, 'preview build'), + '18252': ('10', None, '19H1', None, 'preview build'), + '18262': ('10', None, '19H1', None, 'preview build'), + '18267': ('10', None, '19H1', None, 'preview build'), + '18272': ('10', None, '19H1', None, 'preview build'), + '18277': ('10', None, '19H1', None, 'preview build'), + '18282': ('10', None, '19H1', None, 'preview build'), + '18290': ('10', None, '19H1', None, 'preview build'), + '18298': ('10', None, '19H1', None, 'preview build'), + '18305': ('10', None, '19H1', None, 'preview build'), } if __name__ == '__main__': - print("This file is not meant to be called directly.") + print("This file is not meant to be called directly.") + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/sfc_scan.py b/.bin/Scripts/sfc_scan.py index d7a3d3fc..9864306a 100644 --- a/.bin/Scripts/sfc_scan.py +++ b/.bin/Scripts/sfc_scan.py @@ -12,28 +12,30 @@ os.system('title {}: SFC Tool'.format(KIT_NAME_FULL)) set_log_file('SFC Tool.log') if __name__ == '__main__': - try: - stay_awake() - clear_screen() - print_info('{}: SFC Tool\n'.format(KIT_NAME_FULL)) - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - }} - if ask('Run a SFC scan now?'): - try_and_print(message='SFC scan...', - function=run_sfc_scan, other_results=other_results) - else: - abort() + try: + stay_awake() + clear_screen() + print_info('{}: SFC Tool\n'.format(KIT_NAME_FULL)) + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + }} + if ask('Run a SFC scan now?'): + try_and_print(message='SFC scan...', + function=run_sfc_scan, other_results=other_results) + else: + abort() - # Done - print_standard('\nDone.') - pause('Press Enter to exit...') - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + pause('Press Enter to exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/system_diagnostics.py b/.bin/Scripts/system_diagnostics.py index 9d3d00a4..3844ac38 100644 --- a/.bin/Scripts/system_diagnostics.py +++ b/.bin/Scripts/system_diagnostics.py @@ -3,6 +3,7 @@ import os import sys + # Init os.chdir(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.getcwd()) @@ -16,193 +17,195 @@ os.system('title {}: System Diagnostics Tool'.format(KIT_NAME_FULL)) set_log_file('System Diagnostics.log') D7_MODE = 'd7mode' in sys.argv + # Static Variables BLEACH_BIT_CLEANERS = { - 'Applications': ( - 'adobe_reader.cache', - 'adobe_reader.tmp', - 'amule.tmp', - 'flash.cache', - 'gimp.tmp', - 'hippo_opensim_viewer.cache', - 'java.cache', - 'libreoffice.cache', - 'liferea.cache', - 'miro.cache', - 'openofficeorg.cache', - 'pidgin.cache', - 'secondlife_viewer.Cache', - 'thunderbird.cache', - 'vuze.backup_files', - 'vuze.cache', - 'vuze.tmp', - 'yahoo_messenger.cache', - ), - 'Browsers': ( - 'chromium.cache', - 'chromium.current_session', - 'firefox.cache', - 'firefox.session_restore', - 'google_chrome.cache', - 'google_chrome.session', - 'google_earth.temporary_files', - 'internet_explorer.temporary_files', - 'opera.cache', - 'opera.current_session', - 'safari.cache', - 'seamonkey.cache', - ), - 'System': ( - 'system.clipboard', - 'system.tmp', - 'winapp2_windows.jump_lists', - 'winapp2_windows.ms_search', - 'windows_explorer.run', - 'windows_explorer.search_history', - 'windows_explorer.thumbnails', - ), + 'Applications': ( + 'adobe_reader.cache', + 'adobe_reader.tmp', + 'amule.tmp', + 'flash.cache', + 'gimp.tmp', + 'hippo_opensim_viewer.cache', + 'java.cache', + 'libreoffice.cache', + 'liferea.cache', + 'miro.cache', + 'openofficeorg.cache', + 'pidgin.cache', + 'secondlife_viewer.Cache', + 'thunderbird.cache', + 'vuze.backup_files', + 'vuze.cache', + 'vuze.tmp', + 'yahoo_messenger.cache', + ), + 'Browsers': ( + 'chromium.cache', + 'chromium.current_session', + 'firefox.cache', + 'firefox.session_restore', + 'google_chrome.cache', + 'google_chrome.session', + 'google_earth.temporary_files', + 'internet_explorer.temporary_files', + 'opera.cache', + 'opera.current_session', + 'safari.cache', + 'seamonkey.cache', + ), + 'System': ( + 'system.clipboard', + 'system.tmp', + 'winapp2_windows.jump_lists', + 'winapp2_windows.ms_search', + 'windows_explorer.run', + 'windows_explorer.search_history', + 'windows_explorer.thumbnails', + ), } def check_result(result, other_results): - """Check result for warnings and errors.""" - result_ok = True - if not result['CS']: - for warning in other_results.get('Warning', {}).keys(): - if warning in str(result['Error']): - # Ignore warnings and repair statements - return True - # Error is not a warning - result_ok = False - return result_ok + """Check result for warnings and errors.""" + result_ok = True + if not result['CS']: + for warning in other_results.get('Warning', {}).keys(): + if warning in str(result['Error']): + # Ignore warnings and repair statements + return True + # Error is not a warning + result_ok = False + return result_ok + if __name__ == '__main__': - try: - stay_awake() - clear_screen() - print_info('{}: System Diagnostics Tool\n'.format(KIT_NAME_FULL)) - ticket_number = get_ticket_number() - system_ok = True - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - 'FileNotFoundError': 'File not found', - }, - 'Warning': { - 'GenericRepair': 'Repaired', - 'UnsupportedOSError': 'Unsupported OS', - }} - if ENABLED_TICKET_NUMBERS: - print_info('Starting System Diagnostics for Ticket #{}\n'.format( - ticket_number)) + try: + stay_awake() + clear_screen() + print_info('{}: System Diagnostics Tool\n'.format(KIT_NAME_FULL)) + ticket_number = get_ticket_number() + system_ok = True + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + 'FileNotFoundError': 'File not found', + }, + 'Warning': { + 'GenericRepair': 'Repaired', + 'UnsupportedOSError': 'Unsupported OS', + }} + if ENABLED_TICKET_NUMBERS: + print_info('Starting System Diagnostics for Ticket #{}\n'.format( + ticket_number)) - # Sanitize Environment - print_info('Sanitizing Environment') - if not D7_MODE: - try_and_print(message='Running RKill...', - function=run_rkill, cs='Done', other_results=other_results) - try_and_print(message='Running TDSSKiller...', - function=run_tdsskiller, cs='Done', other_results=other_results) + # Sanitize Environment + print_info('Sanitizing Environment') + if not D7_MODE: + try_and_print(message='Running RKill...', + function=run_rkill, cs='Done', other_results=other_results) + try_and_print(message='Running TDSSKiller...', + function=run_tdsskiller, cs='Done', other_results=other_results) - # Re-run if earlier process was stopped. - stay_awake() + # Re-run if earlier process was stopped. + stay_awake() - # Start diags - if not D7_MODE: - print_info('Starting Background Scans') - check_connection() - try_and_print(message='Running HitmanPro...', - function=run_hitmanpro, cs='Started', other_results=other_results) - try_and_print(message='Running Autoruns...', - function=run_autoruns, cs='Started', other_results=other_results) + # Start diags + if not D7_MODE: + print_info('Starting Background Scans') + check_connection() + try_and_print(message='Running HitmanPro...', + function=run_hitmanpro, cs='Started', other_results=other_results) + try_and_print(message='Running Autoruns...', + function=run_autoruns, cs='Started', other_results=other_results) - # OS Health Checks - print_info('OS Health Checks') - result = try_and_print( - message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), - function=run_chkdsk, other_results=other_results) + # OS Health Checks + print_info('OS Health Checks') + result = try_and_print( + message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), + function=run_chkdsk, other_results=other_results) + system_ok &= check_result(result, other_results) + result = try_and_print(message='SFC scan...', + function=run_sfc_scan, other_results=other_results) + system_ok &= check_result(result, other_results) + if D7_MODE: + result = try_and_print(message='DISM RestoreHealth...', + function=run_dism, other_results=other_results, repair=True) + if global_vars['OS']['Version'] in ('8', '8.1', '10'): system_ok &= check_result(result, other_results) - result = try_and_print(message='SFC scan...', - function=run_sfc_scan, other_results=other_results) - system_ok &= check_result(result, other_results) - if D7_MODE: - result = try_and_print(message='DISM RestoreHealth...', - function=run_dism, other_results=other_results, repair=True) - if global_vars['OS']['Version'] in ('8', '8.1', '10'): - system_ok &= check_result(result, other_results) - else: - try_and_print(message='DISM CheckHealth...', - function=run_dism, other_results=other_results, repair=False) + else: + try_and_print(message='DISM CheckHealth...', + function=run_dism, other_results=other_results, repair=False) - if D7_MODE: - # Archive all browsers for all users - archive_all_users() - else: - # Scan for supported browsers - print_info('Scanning for browsers') - scan_for_browsers() + if D7_MODE: + # Archive all browsers for all users + archive_all_users() + else: + # Scan for supported browsers + print_info('Scanning for browsers') + scan_for_browsers() - # Run BleachBit cleaners - print_info('BleachBit Cleanup') - for k, v in sorted(BLEACH_BIT_CLEANERS.items()): - try_and_print(message='{}...'.format(k), - function=run_bleachbit, - cs='Done', other_results=other_results, - cleaners=v, preview=bool(not D7_MODE)) + # Run BleachBit cleaners + print_info('BleachBit Cleanup') + for k, v in sorted(BLEACH_BIT_CLEANERS.items()): + try_and_print(message='{}...'.format(k), + function=run_bleachbit, + cs='Done', other_results=other_results, + cleaners=v, preview=bool(not D7_MODE)) - # Export system info - print_info('Backup System Information') - try_and_print(message='AIDA64 reports...', - function=run_aida64, cs='Done', other_results=other_results) - if not D7_MODE: - backup_browsers() - try_and_print(message='File listing...', - function=backup_file_list, cs='Done', other_results=other_results) - try_and_print(message='Power plans...', - function=backup_power_plans, cs='Done') - try_and_print(message='Product Keys...', - function=run_produkey, cs='Done', other_results=other_results) - try_and_print(message='Registry...', - function=backup_registry, cs='Done', other_results=other_results, - overwrite=True) + # Export system info + print_info('Backup System Information') + try_and_print(message='AIDA64 reports...', + function=run_aida64, cs='Done', other_results=other_results) + if not D7_MODE: + backup_browsers() + try_and_print(message='File listing...', + function=backup_file_list, cs='Done', other_results=other_results) + try_and_print(message='Power plans...', + function=backup_power_plans, cs='Done') + try_and_print(message='Product Keys...', + function=run_produkey, cs='Done', other_results=other_results) + try_and_print(message='Registry...', + function=backup_registry, cs='Done', other_results=other_results, + overwrite=True) - # Summary - if not D7_MODE: - print_info('Summary') - try_and_print(message='Operating System:', - function=show_os_name, ns='Unknown', silent_function=False) - try_and_print(message='Activation:', - function=show_os_activation, ns='Unknown', silent_function=False) - try_and_print(message='Installed RAM:', - function=show_installed_ram, ns='Unknown', silent_function=False) - show_free_space() - try_and_print(message='Temp Size:', - function=show_temp_files_size, silent_function=False) - try_and_print(message='Installed Antivirus:', - function=get_installed_antivirus, ns='Unknown', - other_results=other_results, print_return=True) - try_and_print(message='Installed Office:', - function=get_installed_office, ns='Unknown', - other_results=other_results, print_return=True) - try_and_print(message='Product Keys:', - function=get_product_keys, ns='Unknown', print_return=True) + # Summary + if not D7_MODE: + print_info('Summary') + try_and_print(message='Operating System:', + function=show_os_name, ns='Unknown', silent_function=False) + try_and_print(message='Activation:', + function=show_os_activation, ns='Unknown', silent_function=False) + try_and_print(message='Installed RAM:', + function=show_installed_ram, ns='Unknown', silent_function=False) + show_free_space() + try_and_print(message='Temp Size:', + function=show_temp_files_size, silent_function=False) + try_and_print(message='Installed Antivirus:', + function=get_installed_antivirus, ns='Unknown', + other_results=other_results, print_return=True) + try_and_print(message='Installed Office:', + function=get_installed_office, ns='Unknown', + other_results=other_results, print_return=True) + try_and_print(message='Product Keys:', + function=get_product_keys, ns='Unknown', print_return=True) - # User data - if not D7_MODE: - print_info('User Data') - try: - show_user_data_summary() - except Exception: - print_error(' Unknown error.') + # User data + if not D7_MODE: + print_info('User Data') + try: + show_user_data_summary() + except Exception: + print_error(' Unknown error.') - # Done - if not D7_MODE or not system_ok: - print_standard('\nDone.') - pause('Press Enter to exit...') - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + if not D7_MODE or not system_ok: + print_standard('\nDone.') + pause('Press Enter to exit...') + exit_script() + except SystemExit: + pass + except: + major_exception() -# vim: sts=4 sw=4 ts=4 +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/transferred_keys.py b/.bin/Scripts/transferred_keys.py index b95ff3c9..3308844c 100644 --- a/.bin/Scripts/transferred_keys.py +++ b/.bin/Scripts/transferred_keys.py @@ -12,17 +12,19 @@ os.system('title {}: Transferred Key Finder'.format(KIT_NAME_FULL)) set_log_file('Transferred Keys.log') if __name__ == '__main__': - try: - stay_awake() - clear_screen() - print_info('{}: Transferred Key Finder\n'.format(KIT_NAME_FULL)) - try_and_print(message='Searching for keys...', - function=list_clientdir_keys, print_return=True) + try: + stay_awake() + clear_screen() + print_info('{}: Transferred Key Finder\n'.format(KIT_NAME_FULL)) + try_and_print(message='Searching for keys...', + function=list_clientdir_keys, print_return=True) - # Done - print_standard('\nDone.') - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/update_kit.py b/.bin/Scripts/update_kit.py index 63ed62c3..203736b6 100644 --- a/.bin/Scripts/update_kit.py +++ b/.bin/Scripts/update_kit.py @@ -11,141 +11,143 @@ init_global_vars() os.system('title {}: Kit Update Tool'.format(KIT_NAME_FULL)) if __name__ == '__main__': - try: - clear_screen() - print_info('{}: Kit Update Tool\n'.format(KIT_NAME_FULL)) - other_results = { - 'Error': { - 'CalledProcessError': 'Unknown Error', - }} + try: + clear_screen() + print_info('{}: Kit Update Tool\n'.format(KIT_NAME_FULL)) + other_results = { + 'Error': { + 'CalledProcessError': 'Unknown Error', + }} - ## Prep ## - update_sdio = ask('Update SDI Origin?') + ## Prep ## + update_sdio = ask('Update SDI Origin?') - ## Download ## - print_success('Downloading tools') + ## Download ## + print_success('Downloading tools') - # Data Recovery - print_info(' Data Recovery') - try_and_print(message='TestDisk / PhotoRec...', function=update_testdisk, other_results=other_results, width=40) + # Data Recovery + print_info(' Data Recovery') + try_and_print(message='TestDisk / PhotoRec...', function=update_testdisk, other_results=other_results, width=40) - # Data Transfers - print_info(' Data Transfers') - try_and_print(message='FastCopy...', function=update_fastcopy, other_results=other_results, width=40) - try_and_print(message='Linux Reader...', function=update_linux_reader, other_results=other_results, width=40) - try_and_print(message='wimlib...', function=update_wimlib, other_results=other_results, width=40) - try_and_print(message='XYplorer...', function=update_xyplorer, other_results=other_results, width=40) + # Data Transfers + print_info(' Data Transfers') + try_and_print(message='FastCopy...', function=update_fastcopy, other_results=other_results, width=40) + try_and_print(message='Linux Reader...', function=update_linux_reader, other_results=other_results, width=40) + try_and_print(message='wimlib...', function=update_wimlib, other_results=other_results, width=40) + try_and_print(message='XYplorer...', function=update_xyplorer, other_results=other_results, width=40) - # Diagnostics - print_info(' Diagnostics') - try_and_print(message='AIDA64...', function=update_aida64, other_results=other_results, width=40) - try_and_print(message='Autoruns...', function=update_autoruns, other_results=other_results, width=40) - try_and_print(message='BleachBit...', function=update_bleachbit, other_results=other_results, width=40) - try_and_print(message='Blue Screen View...', function=update_bluescreenview, other_results=other_results, width=40) - try_and_print(message='ERUNT...', function=update_erunt, other_results=other_results, width=40) - try_and_print(message='FurMark...', function=update_furmark, other_results=other_results, width=40) - try_and_print(message='Hitman Pro...', function=update_hitmanpro, other_results=other_results, width=40) - try_and_print(message='HWiNFO...', function=update_hwinfo, other_results=other_results, width=40) - try_and_print(message='NirCmd...', function=update_nircmd, other_results=other_results, width=40) - try_and_print(message='ProduKey...', function=update_produkey, other_results=other_results, width=40) + # Diagnostics + print_info(' Diagnostics') + try_and_print(message='AIDA64...', function=update_aida64, other_results=other_results, width=40) + try_and_print(message='Autoruns...', function=update_autoruns, other_results=other_results, width=40) + try_and_print(message='BleachBit...', function=update_bleachbit, other_results=other_results, width=40) + try_and_print(message='Blue Screen View...', function=update_bluescreenview, other_results=other_results, width=40) + try_and_print(message='ERUNT...', function=update_erunt, other_results=other_results, width=40) + try_and_print(message='FurMark...', function=update_furmark, other_results=other_results, width=40) + try_and_print(message='Hitman Pro...', function=update_hitmanpro, other_results=other_results, width=40) + try_and_print(message='HWiNFO...', function=update_hwinfo, other_results=other_results, width=40) + try_and_print(message='NirCmd...', function=update_nircmd, other_results=other_results, width=40) + try_and_print(message='ProduKey...', function=update_produkey, other_results=other_results, width=40) - # Drivers - print_info(' Drivers') - try_and_print(message='Intel RST...', function=update_intel_rst, other_results=other_results, width=40) - try_and_print(message='Intel SSD Toolbox...', function=update_intel_ssd_toolbox, other_results=other_results, width=40) - try_and_print(message='Samsing Magician...', function=update_samsung_magician, other_results=other_results, width=40) - if update_sdio: - try_and_print(message='Snappy Driver Installer Origin...', function=update_sdi_origin, other_results=other_results, width=40) + # Drivers + print_info(' Drivers') + try_and_print(message='Intel RST...', function=update_intel_rst, other_results=other_results, width=40) + try_and_print(message='Intel SSD Toolbox...', function=update_intel_ssd_toolbox, other_results=other_results, width=40) + try_and_print(message='Samsing Magician...', function=update_samsung_magician, other_results=other_results, width=40) + if update_sdio: + try_and_print(message='Snappy Driver Installer Origin...', function=update_sdi_origin, other_results=other_results, width=40) - # Installers - print_info(' Installers') - try_and_print(message='Adobe Reader DC...', function=update_adobe_reader_dc, other_results=other_results, width=40) - try_and_print(message='ESET Configs...', function=update_eset_config, other_results=other_results, width=40) - try_and_print(message='Macs Fan Control...', function=update_macs_fan_control, other_results=other_results, width=40) - try_and_print(message='MS Office...', function=update_office, other_results=other_results, width=40) - try_and_print(message='Visual C++ Runtimes...', function=update_vcredists, other_results=other_results, width=40) - update_all_ninite(other_results=other_results, width=40) + # Installers + print_info(' Installers') + try_and_print(message='Adobe Reader DC...', function=update_adobe_reader_dc, other_results=other_results, width=40) + try_and_print(message='ESET Configs...', function=update_eset_config, other_results=other_results, width=40) + try_and_print(message='Macs Fan Control...', function=update_macs_fan_control, other_results=other_results, width=40) + try_and_print(message='MS Office...', function=update_office, other_results=other_results, width=40) + try_and_print(message='Visual C++ Runtimes...', function=update_vcredists, other_results=other_results, width=40) + update_all_ninite(other_results=other_results, width=40) - # Misc - print_info(' Misc') - try_and_print(message='Caffeine...', function=update_caffeine, other_results=other_results, width=40) - try_and_print(message='Classic Start Skin...', function=update_classic_start_skin, other_results=other_results, width=40) - try_and_print(message='Du...', function=update_du, other_results=other_results, width=40) - try_and_print(message='Everything...', function=update_everything, other_results=other_results, width=40) - try_and_print(message='Firefox Extensions...', function=update_firefox_ublock_origin, other_results=other_results, width=40) - try_and_print(message='PuTTY...', function=update_putty, other_results=other_results, width=40) - try_and_print(message='ShutUp10...', function=update_shutup10, other_results=other_results, width=40) - try_and_print(message='Notepad++...', function=update_notepadplusplus, other_results=other_results, width=40) - try_and_print(message='WizTree...', function=update_wiztree, other_results=other_results, width=40) - try_and_print(message='XMPlay...', function=update_xmplay, other_results=other_results, width=40) + # Misc + print_info(' Misc') + try_and_print(message='Caffeine...', function=update_caffeine, other_results=other_results, width=40) + try_and_print(message='Classic Start Skin...', function=update_classic_start_skin, other_results=other_results, width=40) + try_and_print(message='Du...', function=update_du, other_results=other_results, width=40) + try_and_print(message='Everything...', function=update_everything, other_results=other_results, width=40) + try_and_print(message='Firefox Extensions...', function=update_firefox_ublock_origin, other_results=other_results, width=40) + try_and_print(message='PuTTY...', function=update_putty, other_results=other_results, width=40) + try_and_print(message='ShutUp10...', function=update_shutup10, other_results=other_results, width=40) + try_and_print(message='Notepad++...', function=update_notepadplusplus, other_results=other_results, width=40) + try_and_print(message='WizTree...', function=update_wiztree, other_results=other_results, width=40) + try_and_print(message='XMPlay...', function=update_xmplay, other_results=other_results, width=40) - # Repairs - print_info(' Repairs') - try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results, width=40) - try_and_print(message='ESET Online Scanner...', function=update_eset_online_scanner, other_results=other_results, width=40) - try_and_print(message='KVRT...', function=update_kvrt, other_results=other_results, width=40) - try_and_print(message='RKill...', function=update_rkill, other_results=other_results, width=40) - try_and_print(message='TDSS Killer...', function=update_tdsskiller, other_results=other_results, width=40) - try_and_print(message='WinAIO Repair...', function=update_winaiorepair, other_results=other_results, width=40) + # Repairs + print_info(' Repairs') + try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results, width=40) + try_and_print(message='ESET Online Scanner...', function=update_eset_online_scanner, other_results=other_results, width=40) + try_and_print(message='KVRT...', function=update_kvrt, other_results=other_results, width=40) + try_and_print(message='RKill...', function=update_rkill, other_results=other_results, width=40) + try_and_print(message='TDSS Killer...', function=update_tdsskiller, other_results=other_results, width=40) + try_and_print(message='WinAIO Repair...', function=update_winaiorepair, other_results=other_results, width=40) - # Uninstallers - print_info(' Uninstallers') - try_and_print(message='IObit Uninstaller...', function=update_iobit_uninstaller, other_results=other_results, width=40) + # Uninstallers + print_info(' Uninstallers') + try_and_print(message='IObit Uninstaller...', function=update_iobit_uninstaller, other_results=other_results, width=40) - ## Review ## - print_standard('Please review the results and download/extract any missing items to .cbin') - pause('Press Enter to compress the .cbin items') + ## Review ## + print_standard('Please review the results and download/extract any missing items to .cbin') + pause('Press Enter to compress the .cbin items') - ## Compress ## - print_success('Compressing tools') - print_info(' _Drivers') - for item in os.scandir(r'{}\_Drivers'.format(global_vars['CBinDir'])): - if not re.search(r'^(_Drivers|.*7z)$', item.name, re.IGNORECASE): - try_and_print( - message='{}...'.format(item.name), - function=compress_and_remove_item, - other_results = other_results, - width=40, - item = item) - print_info(' .cbin') - for item in os.scandir(global_vars['CBinDir']): - if not re.search(r'^(_Drivers|_include|.*7z)$', item.name, re.IGNORECASE): - try_and_print( - message='{}...'.format(item.name), - function=compress_and_remove_item, - other_results = other_results, - width=40, - item = item) + ## Compress ## + print_success('Compressing tools') + print_info(' _Drivers') + for item in os.scandir(r'{}\_Drivers'.format(global_vars['CBinDir'])): + if not re.search(r'^(_Drivers|.*7z)$', item.name, re.IGNORECASE): + try_and_print( + message='{}...'.format(item.name), + function=compress_and_remove_item, + other_results = other_results, + width=40, + item = item) + print_info(' .cbin') + for item in os.scandir(global_vars['CBinDir']): + if not re.search(r'^(_Drivers|_include|.*7z)$', item.name, re.IGNORECASE): + try_and_print( + message='{}...'.format(item.name), + function=compress_and_remove_item, + other_results = other_results, + width=40, + item = item) - ## Search for network Office/QuickBooks installers & add to LAUNCHERS - print_success('Scanning for network installers') - scan_for_net_installers(OFFICE_SERVER, 'Office', min_year=2010) - scan_for_net_installers(QUICKBOOKS_SERVER, 'QuickBooks', min_year=2015) + ## Search for network Office/QuickBooks installers & add to LAUNCHERS + print_success('Scanning for network installers') + scan_for_net_installers(OFFICE_SERVER, 'Office', min_year=2010) + scan_for_net_installers(QUICKBOOKS_SERVER, 'QuickBooks', min_year=2015) - ## Generate Launchers - print_success('Generating launchers') - for section in sorted(LAUNCHERS.keys()): - print_info(' {}'.format(section)) - for name, options in sorted(LAUNCHERS[section].items()): - try_and_print(message=name, function=generate_launcher, - section=section, name=name, options=options, - other_results=other_results, width=40) + ## Generate Launchers + print_success('Generating launchers') + for section in sorted(LAUNCHERS.keys()): + print_info(' {}'.format(section)) + for name, options in sorted(LAUNCHERS[section].items()): + try_and_print(message=name, function=generate_launcher, + section=section, name=name, options=options, + other_results=other_results, width=40) - # Rename "Copy WizardKit.cmd" (if necessary) - source = r'{}\Scripts\Copy WizardKit.cmd'.format(global_vars['BinDir']) - dest = r'{}\Copy {}.cmd'.format(global_vars['BaseDir'], KIT_NAME_FULL) - if os.path.exists(source): - try: - shutil.move(source, dest) - except Exception: - print_error(' Failed to rename "{}.cmd" to "{}.cmd"'.format( - 'Copy WizardKit', KIT_NAME_FULL)) + # Rename "Copy WizardKit.cmd" (if necessary) + source = r'{}\Scripts\Copy WizardKit.cmd'.format(global_vars['BinDir']) + dest = r'{}\Copy {}.cmd'.format(global_vars['BaseDir'], KIT_NAME_FULL) + if os.path.exists(source): + try: + shutil.move(source, dest) + except Exception: + print_error(' Failed to rename "{}.cmd" to "{}.cmd"'.format( + 'Copy WizardKit', KIT_NAME_FULL)) - # Done - print_standard('\nDone.') - pause("Press Enter to exit...") - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + print_standard('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/user_data_transfer.py b/.bin/Scripts/user_data_transfer.py index 981e235a..1fa06256 100644 --- a/.bin/Scripts/user_data_transfer.py +++ b/.bin/Scripts/user_data_transfer.py @@ -13,54 +13,56 @@ os.system('title {}: User Data Transfer Tool'.format(KIT_NAME_FULL)) set_log_file('User Data Transfer.log') if __name__ == '__main__': - try: - # Prep - stay_awake() - clear_screen() - print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL)) + try: + # Prep + stay_awake() + clear_screen() + print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL)) - # Get backup name prefix - ticket_number = get_ticket_number() - if ENABLED_TICKET_NUMBERS: - backup_prefix = ticket_number - else: - backup_prefix = get_simple_string(prompt='Enter backup name prefix') - backup_prefix = backup_prefix.replace(' ', '_') + # Get backup name prefix + ticket_number = get_ticket_number() + if ENABLED_TICKET_NUMBERS: + backup_prefix = ticket_number + else: + backup_prefix = get_simple_string(prompt='Enter backup name prefix') + backup_prefix = backup_prefix.replace(' ', '_') - # Set destination - folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT) - dest = select_destination(folder_path=folder_path, - prompt='Which disk are we transferring to?') + # Set destination + folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT) + dest = select_destination(folder_path=folder_path, + prompt='Which disk are we transferring to?') - # Set source items - source = select_source(backup_prefix) - items = scan_source(source, dest) + # Set source items + source = select_source(backup_prefix) + items = scan_source(source, dest) - # Transfer - clear_screen() - print_info('Transfer Details:\n') - if ENABLED_TICKET_NUMBERS: - show_data('Ticket:', ticket_number) - show_data('Source:', source.path) - show_data('Destination:', dest) + # Transfer + clear_screen() + print_info('Transfer Details:\n') + if ENABLED_TICKET_NUMBERS: + show_data('Ticket:', ticket_number) + show_data('Source:', source.path) + show_data('Destination:', dest) - if (not ask('Proceed with transfer?')): - umount_backup_shares() - abort() + if (not ask('Proceed with transfer?')): + umount_backup_shares() + abort() - print_info('Transferring Data') - transfer_source(source, dest, items) - try_and_print(message='Removing extra files...', - function=cleanup_transfer, cs='Done', dest_path=dest) - umount_backup_shares() + print_info('Transferring Data') + transfer_source(source, dest, items) + try_and_print(message='Removing extra files...', + function=cleanup_transfer, cs='Done', dest_path=dest) + umount_backup_shares() - # Done - try_and_print(message='Running KVRT...', - function=run_kvrt, cs='Started') - print_standard('\nDone.') - pause("Press Enter to exit...") - exit_script() - except SystemExit: - pass - except: - major_exception() + # Done + try_and_print(message='Running KVRT...', + function=run_kvrt, cs='Started') + print_standard('\nDone.') + pause("Press Enter to exit...") + exit_script() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2 diff --git a/.bin/Scripts/winpe_root_menu.py b/.bin/Scripts/winpe_root_menu.py index 743d987b..5a1f0f8b 100644 --- a/.bin/Scripts/winpe_root_menu.py +++ b/.bin/Scripts/winpe_root_menu.py @@ -14,9 +14,11 @@ set_title('{}: Root Menu'.format(KIT_NAME_FULL)) set_log_file('WinPE.log') if __name__ == '__main__': - try: - menu_root() - except SystemExit: - pass - except: - major_exception() + try: + menu_root() + except SystemExit: + pass + except: + major_exception() + +# vim: sts=2 sw=2 ts=2