Merged more upstream PEP8 updates

This commit is contained in:
2Shirt 2018-12-27 23:17:54 -07:00
commit 816ebd4d49
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
14 changed files with 786 additions and 761 deletions

View file

@ -11,52 +11,54 @@ init_global_vars()
os.system('title {}: Windows Activation Tool'.format(KIT_NAME_FULL)) os.system('title {}: Windows Activation Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
print_info('{}: Windows Activation Tool\n'.format(KIT_NAME_FULL)) print_info('{}: Windows Activation Tool\n'.format(KIT_NAME_FULL))
# Bail early if already activated # Bail early if already activated
if windows_is_activated(): if windows_is_activated():
print_info('This system is already activated') print_info('This system is already activated')
sleep(5) sleep(5)
exit_script() exit_script()
other_results = { other_results = {
'Error': { 'Error': {
'BIOSKeyNotFoundError': 'BIOS key not found.', 'BIOSKeyNotFoundError': 'BIOS key not found.',
}} }}
# Determine activation method # Determine activation method
activation_methods = [ activation_methods = [
{'Name': 'Activate with BIOS key', 'Function': activate_with_bios}, {'Name': 'Activate with BIOS key', 'Function': activate_with_bios},
] ]
if global_vars['OS']['Version'] not in ('8', '8.1', '10'): if global_vars['OS']['Version'] not in ('8', '8.1', '10'):
activation_methods[0]['Disabled'] = True activation_methods[0]['Disabled'] = True
actions = [ actions = [
{'Name': 'Quit', 'Letter': 'Q'}, {'Name': 'Quit', 'Letter': 'Q'},
] ]
while True: while True:
selection = menu_select( selection = menu_select(
'{}: Windows Activation Menu'.format(KIT_NAME_FULL), '{}: Windows Activation Menu'.format(KIT_NAME_FULL),
main_entries=activation_methods, action_entries=actions) main_entries=activation_methods, action_entries=actions)
if (selection.isnumeric()): if (selection.isnumeric()):
result = try_and_print( result = try_and_print(
message = activation_methods[int(selection)-1]['Name'], message = activation_methods[int(selection)-1]['Name'],
function = activation_methods[int(selection)-1]['Function'], function = activation_methods[int(selection)-1]['Function'],
other_results=other_results) other_results=other_results)
if result['CS']: if result['CS']:
break break
else: else:
sleep(2) sleep(2)
elif selection == 'Q': elif selection == 'Q':
exit_script()
# Done
print_success('\nDone.')
pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit:
pass # Done
except: print_success('\nDone.')
major_exception() pause("Press Enter to exit...")
exit_script()
except SystemExit:
pass
except:
major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -13,30 +13,32 @@ os.system('title {}: CBS Cleanup'.format(KIT_NAME_FULL))
set_log_file('CBS Cleanup.log') set_log_file('CBS Cleanup.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
# Prep # Prep
stay_awake() stay_awake()
clear_screen() clear_screen()
folder_path = r'{}\Backups'.format(KIT_NAME_SHORT) folder_path = r'{}\Backups'.format(KIT_NAME_SHORT)
dest = select_destination(folder_path=folder_path, dest = select_destination(folder_path=folder_path,
prompt='Which disk are we using for temp data and backup?') prompt='Which disk are we using for temp data and backup?')
# Show details # Show details
print_info('{}: CBS Cleanup Tool\n'.format(KIT_NAME_FULL)) print_info('{}: CBS Cleanup Tool\n'.format(KIT_NAME_FULL))
show_data('Backup / Temp path:', dest) show_data('Backup / Temp path:', dest)
print_standard('\n') print_standard('\n')
if (not ask('Proceed with CBS cleanup?')): if (not ask('Proceed with CBS cleanup?')):
abort() abort()
# Run Cleanup # Run Cleanup
try_and_print(message='Running cleanup...', function=cleanup_cbs, try_and_print(message='Running cleanup...', function=cleanup_cbs,
cs='Done', dest_folder=dest) cs='Done', dest_folder=dest)
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
pause("Press Enter to exit...") pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -12,45 +12,47 @@ os.system('title {}: Check Disk Tool'.format(KIT_NAME_FULL))
set_log_file('Check Disk.log') set_log_file('Check Disk.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',
'UnsupportedOSError': 'Unsupported OS', 'UnsupportedOSError': 'Unsupported OS',
}} }}
options = [ options = [
{'Name': 'Run CHKDSK scan (read-only)', 'Repair': False}, {'Name': 'Run CHKDSK scan (read-only)', 'Repair': False},
{'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}] {'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}]
actions = [{'Name': 'Quit', 'Letter': 'Q'}] actions = [{'Name': 'Quit', 'Letter': 'Q'}]
selection = menu_select( selection = menu_select(
'{}: Check Disk Menu\n'.format(KIT_NAME_FULL), '{}: Check Disk Menu\n'.format(KIT_NAME_FULL),
main_entries=options, main_entries=options,
action_entries=actions) action_entries=actions)
print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL)) print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL))
if selection == 'Q': if selection == 'Q':
abort() abort()
elif selection.isnumeric(): elif selection.isnumeric():
repair = options[int(selection)-1]['Repair'] repair = options[int(selection)-1]['Repair']
if repair: if repair:
cs = 'Scheduled' cs = 'Scheduled'
else: else:
cs = 'CS' cs = 'CS'
message = 'CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']) message = 'CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env'])
try_and_print(message=message, function=run_chkdsk, try_and_print(message=message, function=run_chkdsk,
cs=cs, other_results=other_results, repair=repair) cs=cs, other_results=other_results, repair=repair)
else: else:
abort() abort()
# Done # Done
print_success('Done.') print_success('Done.')
pause("Press Enter to exit...") pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -12,46 +12,48 @@ os.system('title {}: DISM helper Tool'.format(KIT_NAME_FULL))
set_log_file('DISM Helper.log') set_log_file('DISM Helper.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',
'UnsupportedOSError': 'Unsupported OS', 'UnsupportedOSError': 'Unsupported OS',
}} }}
disabled = bool(global_vars['OS']['Version'] not in ('8', '8.1', '10')) disabled = bool(global_vars['OS']['Version'] not in ('8', '8.1', '10'))
options = [ options = [
{'Name': 'Check Health', 'Repair': False, 'Disabled': disabled}, {'Name': 'Check Health', 'Repair': False, 'Disabled': disabled},
{'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}] {'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}]
actions = [{'Name': 'Quit', 'Letter': 'Q'}] actions = [{'Name': 'Quit', 'Letter': 'Q'}]
selection = menu_select( selection = menu_select(
'{}: DISM Menu\n'.format(KIT_NAME_FULL), '{}: DISM Menu\n'.format(KIT_NAME_FULL),
main_entries=options, main_entries=options,
action_entries=actions) action_entries=actions)
print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL)) print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL))
if selection == 'Q': if selection == 'Q':
abort() abort()
elif selection.isnumeric(): elif selection.isnumeric():
repair = options[int(selection)-1]['Repair'] repair = options[int(selection)-1]['Repair']
if repair: if repair:
message='DISM RestoreHealth...' message='DISM RestoreHealth...'
else: else:
message='DISM ScanHealth...' message='DISM ScanHealth...'
try_and_print(message=message, function=run_dism, try_and_print(message=message, function=run_dism,
cs='No corruption', ns='Corruption detected', cs='No corruption', ns='Corruption detected',
other_results=other_results, repair=repair) other_results=other_results, repair=repair)
else: else:
abort() abort()
# Done # Done
print_success('Done.') print_success('Done.')
pause("Press Enter to exit...") pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -1,6 +1,4 @@
#!/bin/python3 # Wizard Kit: Functions - Network
#
## Wizard Kit: Functions - Network
import os import os
import shutil import shutil

View file

@ -11,28 +11,30 @@ init_global_vars()
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL)) os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__': if __name__ == '__main__':
try: try:
clear_screen() clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
other_results = { other_results = {
'Error': {'CalledProcessError': 'Unknown Error'}, 'Error': {'CalledProcessError': 'Unknown Error'},
'Warning': {}} 'Warning': {}}
if not ask('Enable booting to SafeMode (with Networking)?'): if not ask('Enable booting to SafeMode (with Networking)?'):
abort() abort()
# Configure SafeMode # Configure SafeMode
try_and_print(message='Set BCD option...', try_and_print(message='Set BCD option...',
function=enable_safemode, other_results=other_results) function=enable_safemode, other_results=other_results)
try_and_print(message='Enable MSI in SafeMode...', try_and_print(message='Enable MSI in SafeMode...',
function=enable_safemode_msi, other_results=other_results) function=enable_safemode_msi, other_results=other_results)
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
pause('Press Enter to reboot...') pause('Press Enter to reboot...')
reboot() reboot()
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -11,28 +11,30 @@ init_global_vars()
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL)) os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__': if __name__ == '__main__':
try: try:
clear_screen() clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL)) print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
other_results = { other_results = {
'Error': {'CalledProcessError': 'Unknown Error'}, 'Error': {'CalledProcessError': 'Unknown Error'},
'Warning': {}} 'Warning': {}}
if not ask('Disable booting to SafeMode?'): if not ask('Disable booting to SafeMode?'):
abort() abort()
# Configure SafeMode # Configure SafeMode
try_and_print(message='Remove BCD option...', try_and_print(message='Remove BCD option...',
function=disable_safemode, other_results=other_results) function=disable_safemode, other_results=other_results)
try_and_print(message='Disable MSI in SafeMode...', try_and_print(message='Disable MSI in SafeMode...',
function=disable_safemode_msi, other_results=other_results) function=disable_safemode_msi, other_results=other_results)
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
pause('Press Enter to reboot...') pause('Press Enter to reboot...')
reboot() reboot()
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -1,193 +1,195 @@
# Wizard Kit: Settings - Windows Builds # Wizard Kit: Settings - Windows Builds
WINDOWS_BUILDS = { WINDOWS_BUILDS = {
# Build Version Release Codename Marketing Name Notes # Build, Version, Release, Codename, Marketing Name, Notes
'6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'), '6000': ('Vista', 'RTM', 'Longhorn', None, 'unsupported'),
'6000': ( 'Vista', 'RTM', 'Longhorn', None, 'unsupported'), '6000': ('Vista', 'RTM', 'Longhorn', None, 'unsupported'),
'6001': ( 'Vista', 'SP1', 'Longhorn', None, 'unsupported'), '6001': ('Vista', 'SP1', 'Longhorn', None, 'unsupported'),
'6002': ( 'Vista', 'SP2', 'Longhorn', None, 'unsupported'), '6002': ('Vista', 'SP2', 'Longhorn', None, 'unsupported'),
'7600': ( '7', 'RTM', 'Vienna', None, 'unsupported'), '7600': ('7', 'RTM', 'Vienna', None, 'unsupported'),
'7601': ( '7', 'SP1', 'Vienna', None, 'outdated'), '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 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': ('8', 'RTM', None, None, 'unsupported'),
'9200': ( '8.1', None, 'Blue', None, 'outdated'), '9200': ('8.1', None, 'Blue', None, 'outdated'),
'9600': ( '8.1', None, 'Update', None, None), '9600': ('8.1', None, 'Update', None, None),
'9841': ( '10', None, 'Threshold 1', None, 'preview build'), '9841': ('10', None, 'Threshold 1', None, 'preview build'),
'9860': ( '10', None, 'Threshold 1', None, 'preview build'), '9860': ('10', None, 'Threshold 1', None, 'preview build'),
'9879': ( '10', None, 'Threshold 1', None, 'preview build'), '9879': ('10', None, 'Threshold 1', None, 'preview build'),
'9926': ( '10', None, 'Threshold 1', None, 'preview build'), '9926': ('10', None, 'Threshold 1', None, 'preview build'),
'10041': ( '10', None, 'Threshold 1', None, 'preview build'), '10041': ('10', None, 'Threshold 1', None, 'preview build'),
'10049': ( '10', None, 'Threshold 1', None, 'preview build'), '10049': ('10', None, 'Threshold 1', None, 'preview build'),
'10061': ( '10', None, 'Threshold 1', None, 'preview build'), '10061': ('10', None, 'Threshold 1', None, 'preview build'),
'10074': ( '10', None, 'Threshold 1', None, 'preview build'), '10074': ('10', None, 'Threshold 1', None, 'preview build'),
'10122': ( '10', None, 'Threshold 1', None, 'preview build'), '10122': ('10', None, 'Threshold 1', None, 'preview build'),
'10130': ( '10', None, 'Threshold 1', None, 'preview build'), '10130': ('10', None, 'Threshold 1', None, 'preview build'),
'10158': ( '10', None, 'Threshold 1', None, 'preview build'), '10158': ('10', None, 'Threshold 1', None, 'preview build'),
'10159': ( '10', None, 'Threshold 1', None, 'preview build'), '10159': ('10', None, 'Threshold 1', None, 'preview build'),
'10162': ( '10', None, 'Threshold 1', None, 'preview build'), '10162': ('10', None, 'Threshold 1', None, 'preview build'),
'10166': ( '10', None, 'Threshold 1', None, 'preview build'), '10166': ('10', None, 'Threshold 1', None, 'preview build'),
'10240': ( '10', 'v1507', 'Threshold 1', None, 'unsupported'), '10240': ('10', 'v1507', 'Threshold 1', None, 'unsupported'),
'10525': ( '10', None, 'Threshold 2', None, 'preview build'), '10525': ('10', None, 'Threshold 2', None, 'preview build'),
'10532': ( '10', None, 'Threshold 2', None, 'preview build'), '10532': ('10', None, 'Threshold 2', None, 'preview build'),
'10547': ( '10', None, 'Threshold 2', None, 'preview build'), '10547': ('10', None, 'Threshold 2', None, 'preview build'),
'10565': ( '10', None, 'Threshold 2', None, 'preview build'), '10565': ('10', None, 'Threshold 2', None, 'preview build'),
'10576': ( '10', None, 'Threshold 2', None, 'preview build'), '10576': ('10', None, 'Threshold 2', None, 'preview build'),
'10586': ( '10', 'v1511', 'Threshold 2', 'November Update', 'unsupported'), '10586': ('10', 'v1511', 'Threshold 2', 'November Update', 'unsupported'),
'11082': ( '10', None, 'Redstone 1', None, 'preview build'), '11082': ('10', None, 'Redstone 1', None, 'preview build'),
'11099': ( '10', None, 'Redstone 1', None, 'preview build'), '11099': ('10', None, 'Redstone 1', None, 'preview build'),
'11102': ( '10', None, 'Redstone 1', None, 'preview build'), '11102': ('10', None, 'Redstone 1', None, 'preview build'),
'14251': ( '10', None, 'Redstone 1', None, 'preview build'), '14251': ('10', None, 'Redstone 1', None, 'preview build'),
'14257': ( '10', None, 'Redstone 1', None, 'preview build'), '14257': ('10', None, 'Redstone 1', None, 'preview build'),
'14271': ( '10', None, 'Redstone 1', None, 'preview build'), '14271': ('10', None, 'Redstone 1', None, 'preview build'),
'14279': ( '10', None, 'Redstone 1', None, 'preview build'), '14279': ('10', None, 'Redstone 1', None, 'preview build'),
'14291': ( '10', None, 'Redstone 1', None, 'preview build'), '14291': ('10', None, 'Redstone 1', None, 'preview build'),
'14295': ( '10', None, 'Redstone 1', None, 'preview build'), '14295': ('10', None, 'Redstone 1', None, 'preview build'),
'14316': ( '10', None, 'Redstone 1', None, 'preview build'), '14316': ('10', None, 'Redstone 1', None, 'preview build'),
'14328': ( '10', None, 'Redstone 1', None, 'preview build'), '14328': ('10', None, 'Redstone 1', None, 'preview build'),
'14332': ( '10', None, 'Redstone 1', None, 'preview build'), '14332': ('10', None, 'Redstone 1', None, 'preview build'),
'14342': ( '10', None, 'Redstone 1', None, 'preview build'), '14342': ('10', None, 'Redstone 1', None, 'preview build'),
'14352': ( '10', None, 'Redstone 1', None, 'preview build'), '14352': ('10', None, 'Redstone 1', None, 'preview build'),
'14361': ( '10', None, 'Redstone 1', None, 'preview build'), '14361': ('10', None, 'Redstone 1', None, 'preview build'),
'14366': ( '10', None, 'Redstone 1', None, 'preview build'), '14366': ('10', None, 'Redstone 1', None, 'preview build'),
'14367': ( '10', None, 'Redstone 1', None, 'preview build'), '14367': ('10', None, 'Redstone 1', None, 'preview build'),
'14371': ( '10', None, 'Redstone 1', None, 'preview build'), '14371': ('10', None, 'Redstone 1', None, 'preview build'),
'14372': ( '10', None, 'Redstone 1', None, 'preview build'), '14372': ('10', None, 'Redstone 1', None, 'preview build'),
'14376': ( '10', None, 'Redstone 1', None, 'preview build'), '14376': ('10', None, 'Redstone 1', None, 'preview build'),
'14379': ( '10', None, 'Redstone 1', None, 'preview build'), '14379': ('10', None, 'Redstone 1', None, 'preview build'),
'14383': ( '10', None, 'Redstone 1', None, 'preview build'), '14383': ('10', None, 'Redstone 1', None, 'preview build'),
'14385': ( '10', None, 'Redstone 1', None, 'preview build'), '14385': ('10', None, 'Redstone 1', None, 'preview build'),
'14388': ( '10', None, 'Redstone 1', None, 'preview build'), '14388': ('10', None, 'Redstone 1', None, 'preview build'),
'14390': ( '10', None, 'Redstone 1', None, 'preview build'), '14390': ('10', None, 'Redstone 1', None, 'preview build'),
'14393': ( '10', 'v1607', 'Redstone 1', 'Anniversary Update', 'unsupported'), '14393': ('10', 'v1607', 'Redstone 1', 'Anniversary Update', 'unsupported'),
'14901': ( '10', None, 'Redstone 2', None, 'preview build'), '14901': ('10', None, 'Redstone 2', None, 'preview build'),
'14905': ( '10', None, 'Redstone 2', None, 'preview build'), '14905': ('10', None, 'Redstone 2', None, 'preview build'),
'14915': ( '10', None, 'Redstone 2', None, 'preview build'), '14915': ('10', None, 'Redstone 2', None, 'preview build'),
'14926': ( '10', None, 'Redstone 2', None, 'preview build'), '14926': ('10', None, 'Redstone 2', None, 'preview build'),
'14931': ( '10', None, 'Redstone 2', None, 'preview build'), '14931': ('10', None, 'Redstone 2', None, 'preview build'),
'14936': ( '10', None, 'Redstone 2', None, 'preview build'), '14936': ('10', None, 'Redstone 2', None, 'preview build'),
'14942': ( '10', None, 'Redstone 2', None, 'preview build'), '14942': ('10', None, 'Redstone 2', None, 'preview build'),
'14946': ( '10', None, 'Redstone 2', None, 'preview build'), '14946': ('10', None, 'Redstone 2', None, 'preview build'),
'14951': ( '10', None, 'Redstone 2', None, 'preview build'), '14951': ('10', None, 'Redstone 2', None, 'preview build'),
'14955': ( '10', None, 'Redstone 2', None, 'preview build'), '14955': ('10', None, 'Redstone 2', None, 'preview build'),
'14959': ( '10', None, 'Redstone 2', None, 'preview build'), '14959': ('10', None, 'Redstone 2', None, 'preview build'),
'14965': ( '10', None, 'Redstone 2', None, 'preview build'), '14965': ('10', None, 'Redstone 2', None, 'preview build'),
'14971': ( '10', None, 'Redstone 2', None, 'preview build'), '14971': ('10', None, 'Redstone 2', None, 'preview build'),
'14986': ( '10', None, 'Redstone 2', None, 'preview build'), '14986': ('10', None, 'Redstone 2', None, 'preview build'),
'15002': ( '10', None, 'Redstone 2', None, 'preview build'), '15002': ('10', None, 'Redstone 2', None, 'preview build'),
'15007': ( '10', None, 'Redstone 2', None, 'preview build'), '15007': ('10', None, 'Redstone 2', None, 'preview build'),
'15014': ( '10', None, 'Redstone 2', None, 'preview build'), '15014': ('10', None, 'Redstone 2', None, 'preview build'),
'15019': ( '10', None, 'Redstone 2', None, 'preview build'), '15019': ('10', None, 'Redstone 2', None, 'preview build'),
'15025': ( '10', None, 'Redstone 2', None, 'preview build'), '15025': ('10', None, 'Redstone 2', None, 'preview build'),
'15031': ( '10', None, 'Redstone 2', None, 'preview build'), '15031': ('10', None, 'Redstone 2', None, 'preview build'),
'15042': ( '10', None, 'Redstone 2', None, 'preview build'), '15042': ('10', None, 'Redstone 2', None, 'preview build'),
'15046': ( '10', None, 'Redstone 2', None, 'preview build'), '15046': ('10', None, 'Redstone 2', None, 'preview build'),
'15048': ( '10', None, 'Redstone 2', None, 'preview build'), '15048': ('10', None, 'Redstone 2', None, 'preview build'),
'15055': ( '10', None, 'Redstone 2', None, 'preview build'), '15055': ('10', None, 'Redstone 2', None, 'preview build'),
'15058': ( '10', None, 'Redstone 2', None, 'preview build'), '15058': ('10', None, 'Redstone 2', None, 'preview build'),
'15060': ( '10', None, 'Redstone 2', None, 'preview build'), '15060': ('10', None, 'Redstone 2', None, 'preview build'),
'15061': ( '10', None, 'Redstone 2', None, 'preview build'), '15061': ('10', None, 'Redstone 2', None, 'preview build'),
'15063': ( '10', 'v1703', 'Redstone 2', 'Creators Update', 'outdated'), '15063': ('10', 'v1703', 'Redstone 2', 'Creators Update', 'unsupported'),
'16170': ( '10', None, 'Redstone 3', None, 'preview build'), '16170': ('10', None, 'Redstone 3', None, 'preview build'),
'16176': ( '10', None, 'Redstone 3', None, 'preview build'), '16176': ('10', None, 'Redstone 3', None, 'preview build'),
'16179': ( '10', None, 'Redstone 3', None, 'preview build'), '16179': ('10', None, 'Redstone 3', None, 'preview build'),
'16184': ( '10', None, 'Redstone 3', None, 'preview build'), '16184': ('10', None, 'Redstone 3', None, 'preview build'),
'16188': ( '10', None, 'Redstone 3', None, 'preview build'), '16188': ('10', None, 'Redstone 3', None, 'preview build'),
'16193': ( '10', None, 'Redstone 3', None, 'preview build'), '16193': ('10', None, 'Redstone 3', None, 'preview build'),
'16199': ( '10', None, 'Redstone 3', None, 'preview build'), '16199': ('10', None, 'Redstone 3', None, 'preview build'),
'16212': ( '10', None, 'Redstone 3', None, 'preview build'), '16212': ('10', None, 'Redstone 3', None, 'preview build'),
'16215': ( '10', None, 'Redstone 3', None, 'preview build'), '16215': ('10', None, 'Redstone 3', None, 'preview build'),
'16226': ( '10', None, 'Redstone 3', None, 'preview build'), '16226': ('10', None, 'Redstone 3', None, 'preview build'),
'16232': ( '10', None, 'Redstone 3', None, 'preview build'), '16232': ('10', None, 'Redstone 3', None, 'preview build'),
'16237': ( '10', None, 'Redstone 3', None, 'preview build'), '16237': ('10', None, 'Redstone 3', None, 'preview build'),
'16241': ( '10', None, 'Redstone 3', None, 'preview build'), '16241': ('10', None, 'Redstone 3', None, 'preview build'),
'16251': ( '10', None, 'Redstone 3', None, 'preview build'), '16251': ('10', None, 'Redstone 3', None, 'preview build'),
'16257': ( '10', None, 'Redstone 3', None, 'preview build'), '16257': ('10', None, 'Redstone 3', None, 'preview build'),
'16273': ( '10', None, 'Redstone 3', None, 'preview build'), '16273': ('10', None, 'Redstone 3', None, 'preview build'),
'16275': ( '10', None, 'Redstone 3', None, 'preview build'), '16275': ('10', None, 'Redstone 3', None, 'preview build'),
'16278': ( '10', None, 'Redstone 3', None, 'preview build'), '16278': ('10', None, 'Redstone 3', None, 'preview build'),
'16281': ( '10', None, 'Redstone 3', None, 'preview build'), '16281': ('10', None, 'Redstone 3', None, 'preview build'),
'16288': ( '10', None, 'Redstone 3', None, 'preview build'), '16288': ('10', None, 'Redstone 3', None, 'preview build'),
'16291': ( '10', None, 'Redstone 3', None, 'preview build'), '16291': ('10', None, 'Redstone 3', None, 'preview build'),
'16294': ( '10', None, 'Redstone 3', None, 'preview build'), '16294': ('10', None, 'Redstone 3', None, 'preview build'),
'16296': ( '10', None, 'Redstone 3', None, 'preview build'), '16296': ('10', None, 'Redstone 3', None, 'preview build'),
'16299': ( '10', 'v1709', 'Redstone 3', 'Fall Creators Update', 'outdated'), '16299': ('10', 'v1709', 'Redstone 3', 'Fall Creators Update', 'outdated'),
'16353': ( '10', None, 'Redstone 4', None, 'preview build'), '16353': ('10', None, 'Redstone 4', None, 'preview build'),
'16362': ( '10', None, 'Redstone 4', None, 'preview build'), '16362': ('10', None, 'Redstone 4', None, 'preview build'),
'17004': ( '10', None, 'Redstone 4', None, 'preview build'), '17004': ('10', None, 'Redstone 4', None, 'preview build'),
'17017': ( '10', None, 'Redstone 4', None, 'preview build'), '17017': ('10', None, 'Redstone 4', None, 'preview build'),
'17025': ( '10', None, 'Redstone 4', None, 'preview build'), '17025': ('10', None, 'Redstone 4', None, 'preview build'),
'17035': ( '10', None, 'Redstone 4', None, 'preview build'), '17035': ('10', None, 'Redstone 4', None, 'preview build'),
'17040': ( '10', None, 'Redstone 4', None, 'preview build'), '17040': ('10', None, 'Redstone 4', None, 'preview build'),
'17046': ( '10', None, 'Redstone 4', None, 'preview build'), '17046': ('10', None, 'Redstone 4', None, 'preview build'),
'17063': ( '10', None, 'Redstone 4', None, 'preview build'), '17063': ('10', None, 'Redstone 4', None, 'preview build'),
'17074': ( '10', None, 'Redstone 4', None, 'preview build'), '17074': ('10', None, 'Redstone 4', None, 'preview build'),
'17083': ( '10', None, 'Redstone 4', None, 'preview build'), '17083': ('10', None, 'Redstone 4', None, 'preview build'),
'17093': ( '10', None, 'Redstone 4', None, 'preview build'), '17093': ('10', None, 'Redstone 4', None, 'preview build'),
'17101': ( '10', None, 'Redstone 4', None, 'preview build'), '17101': ('10', None, 'Redstone 4', None, 'preview build'),
'17107': ( '10', None, 'Redstone 4', None, 'preview build'), '17107': ('10', None, 'Redstone 4', None, 'preview build'),
'17110': ( '10', None, 'Redstone 4', None, 'preview build'), '17110': ('10', None, 'Redstone 4', None, 'preview build'),
'17112': ( '10', None, 'Redstone 4', None, 'preview build'), '17112': ('10', None, 'Redstone 4', None, 'preview build'),
'17115': ( '10', None, 'Redstone 4', None, 'preview build'), '17115': ('10', None, 'Redstone 4', None, 'preview build'),
'17120': ( '10', None, 'Redstone 4', None, 'preview build'), '17120': ('10', None, 'Redstone 4', None, 'preview build'),
'17123': ( '10', None, 'Redstone 4', None, 'preview build'), '17123': ('10', None, 'Redstone 4', None, 'preview build'),
'17127': ( '10', None, 'Redstone 4', None, 'preview build'), '17127': ('10', None, 'Redstone 4', None, 'preview build'),
'17128': ( '10', None, 'Redstone 4', None, 'preview build'), '17128': ('10', None, 'Redstone 4', None, 'preview build'),
'17133': ( '10', None, 'Redstone 4', None, 'preview build'), '17133': ('10', None, 'Redstone 4', None, 'preview build'),
'17134': ( '10', 'v1803', 'Redstone 4', 'April 2018 Update', None), '17134': ('10', 'v1803', 'Redstone 4', 'April 2018 Update', 'outdated'),
'17604': ( '10', None, 'Redstone 5', None, 'preview build'), '17604': ('10', None, 'Redstone 5', None, 'preview build'),
'17618': ( '10', None, 'Redstone 5', None, 'preview build'), '17618': ('10', None, 'Redstone 5', None, 'preview build'),
'17623': ( '10', None, 'Redstone 5', None, 'preview build'), '17623': ('10', None, 'Redstone 5', None, 'preview build'),
'17627': ( '10', None, 'Redstone 5', None, 'preview build'), '17627': ('10', None, 'Redstone 5', None, 'preview build'),
'17634': ( '10', None, 'Redstone 5', None, 'preview build'), '17634': ('10', None, 'Redstone 5', None, 'preview build'),
'17639': ( '10', None, 'Redstone 5', None, 'preview build'), '17639': ('10', None, 'Redstone 5', None, 'preview build'),
'17643': ( '10', None, 'Redstone 5', None, 'preview build'), '17643': ('10', None, 'Redstone 5', None, 'preview build'),
'17650': ( '10', None, 'Redstone 5', None, 'preview build'), '17650': ('10', None, 'Redstone 5', None, 'preview build'),
'17655': ( '10', None, 'Redstone 5', None, 'preview build'), '17655': ('10', None, 'Redstone 5', None, 'preview build'),
'17661': ( '10', None, 'Redstone 5', None, 'preview build'), '17661': ('10', None, 'Redstone 5', None, 'preview build'),
'17666': ( '10', None, 'Redstone 5', None, 'preview build'), '17666': ('10', None, 'Redstone 5', None, 'preview build'),
'17677': ( '10', None, 'Redstone 5', None, 'preview build'), '17677': ('10', None, 'Redstone 5', None, 'preview build'),
'17682': ( '10', None, 'Redstone 5', None, 'preview build'), '17682': ('10', None, 'Redstone 5', None, 'preview build'),
'17686': ( '10', None, 'Redstone 5', None, 'preview build'), '17686': ('10', None, 'Redstone 5', None, 'preview build'),
'17692': ( '10', None, 'Redstone 5', None, 'preview build'), '17692': ('10', None, 'Redstone 5', None, 'preview build'),
'17704': ( '10', None, 'Redstone 5', None, 'preview build'), '17704': ('10', None, 'Redstone 5', None, 'preview build'),
'17711': ( '10', None, 'Redstone 5', None, 'preview build'), '17711': ('10', None, 'Redstone 5', None, 'preview build'),
'17713': ( '10', None, 'Redstone 5', None, 'preview build'), '17713': ('10', None, 'Redstone 5', None, 'preview build'),
'17723': ( '10', None, 'Redstone 5', None, 'preview build'), '17723': ('10', None, 'Redstone 5', None, 'preview build'),
'17728': ( '10', None, 'Redstone 5', None, 'preview build'), '17728': ('10', None, 'Redstone 5', None, 'preview build'),
'17730': ( '10', None, 'Redstone 5', None, 'preview build'), '17730': ('10', None, 'Redstone 5', None, 'preview build'),
'17733': ( '10', None, 'Redstone 5', None, 'preview build'), '17733': ('10', None, 'Redstone 5', None, 'preview build'),
'17735': ( '10', None, 'Redstone 5', None, 'preview build'), '17735': ('10', None, 'Redstone 5', None, 'preview build'),
'17738': ( '10', None, 'Redstone 5', None, 'preview build'), '17738': ('10', None, 'Redstone 5', None, 'preview build'),
'17741': ( '10', None, 'Redstone 5', None, 'preview build'), '17741': ('10', None, 'Redstone 5', None, 'preview build'),
'17744': ( '10', None, 'Redstone 5', None, 'preview build'), '17744': ('10', None, 'Redstone 5', None, 'preview build'),
'17746': ( '10', None, 'Redstone 5', None, 'preview build'), '17746': ('10', None, 'Redstone 5', None, 'preview build'),
'17751': ( '10', None, 'Redstone 5', None, 'preview build'), '17751': ('10', None, 'Redstone 5', None, 'preview build'),
'17754': ( '10', None, 'Redstone 5', None, 'preview build'), '17754': ('10', None, 'Redstone 5', None, 'preview build'),
'17755': ( '10', None, 'Redstone 5', None, 'preview build'), '17755': ('10', None, 'Redstone 5', None, 'preview build'),
'17758': ( '10', None, 'Redstone 5', None, 'preview build'), '17758': ('10', None, 'Redstone 5', None, 'preview build'),
'17760': ( '10', None, 'Redstone 5', None, 'preview build'), '17760': ('10', None, 'Redstone 5', None, 'preview build'),
'17763': ( '10', 'v1809', 'Redstone 5', 'October 2018 Update', None), '17763': ('10', 'v1809', 'Redstone 5', 'October 2018 Update', None),
'18204': ( '10', None, '19H1', None, 'preview build'), '18204': ('10', None, '19H1', None, 'preview build'),
'18214': ( '10', None, '19H1', None, 'preview build'), '18214': ('10', None, '19H1', None, 'preview build'),
'18219': ( '10', None, '19H1', None, 'preview build'), '18219': ('10', None, '19H1', None, 'preview build'),
'18234': ( '10', None, '19H1', None, 'preview build'), '18234': ('10', None, '19H1', None, 'preview build'),
'18237': ( '10', None, '19H1', None, 'preview build'), '18237': ('10', None, '19H1', None, 'preview build'),
'18242': ( '10', None, '19H1', None, 'preview build'), '18242': ('10', None, '19H1', None, 'preview build'),
'18247': ( '10', None, '19H1', None, 'preview build'), '18247': ('10', None, '19H1', None, 'preview build'),
'18252': ( '10', None, '19H1', None, 'preview build'), '18252': ('10', None, '19H1', None, 'preview build'),
'18262': ( '10', None, '19H1', None, 'preview build'), '18262': ('10', None, '19H1', None, 'preview build'),
'18267': ( '10', None, '19H1', None, 'preview build'), '18267': ('10', None, '19H1', None, 'preview build'),
'18272': ( '10', None, '19H1', None, 'preview build'), '18272': ('10', None, '19H1', None, 'preview build'),
'18277': ( '10', None, '19H1', None, 'preview build'), '18277': ('10', None, '19H1', None, 'preview build'),
'18282': ( '10', None, '19H1', None, 'preview build'), '18282': ('10', None, '19H1', None, 'preview build'),
'18290': ( '10', None, '19H1', None, 'preview build'), '18290': ('10', None, '19H1', None, 'preview build'),
'18298': ( '10', None, '19H1', None, 'preview build'), '18298': ('10', None, '19H1', None, 'preview build'),
'18305': ( '10', None, '19H1', None, 'preview build'), '18305': ('10', None, '19H1', None, 'preview build'),
} }
if __name__ == '__main__': 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

View file

@ -12,28 +12,30 @@ os.system('title {}: SFC Tool'.format(KIT_NAME_FULL))
set_log_file('SFC Tool.log') set_log_file('SFC Tool.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
print_info('{}: SFC Tool\n'.format(KIT_NAME_FULL)) print_info('{}: SFC Tool\n'.format(KIT_NAME_FULL))
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',
}} }}
if ask('Run a SFC scan now?'): if ask('Run a SFC scan now?'):
try_and_print(message='SFC scan...', try_and_print(message='SFC scan...',
function=run_sfc_scan, other_results=other_results) function=run_sfc_scan, other_results=other_results)
else: else:
abort() abort()
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
pause('Press Enter to exit...') pause('Press Enter to exit...')
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -3,6 +3,7 @@
import os import os
import sys import sys
# Init # Init
os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd()) 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') set_log_file('System Diagnostics.log')
D7_MODE = 'd7mode' in sys.argv D7_MODE = 'd7mode' in sys.argv
# Static Variables # Static Variables
BLEACH_BIT_CLEANERS = { BLEACH_BIT_CLEANERS = {
'Applications': ( 'Applications': (
'adobe_reader.cache', 'adobe_reader.cache',
'adobe_reader.tmp', 'adobe_reader.tmp',
'amule.tmp', 'amule.tmp',
'flash.cache', 'flash.cache',
'gimp.tmp', 'gimp.tmp',
'hippo_opensim_viewer.cache', 'hippo_opensim_viewer.cache',
'java.cache', 'java.cache',
'libreoffice.cache', 'libreoffice.cache',
'liferea.cache', 'liferea.cache',
'miro.cache', 'miro.cache',
'openofficeorg.cache', 'openofficeorg.cache',
'pidgin.cache', 'pidgin.cache',
'secondlife_viewer.Cache', 'secondlife_viewer.Cache',
'thunderbird.cache', 'thunderbird.cache',
'vuze.backup_files', 'vuze.backup_files',
'vuze.cache', 'vuze.cache',
'vuze.tmp', 'vuze.tmp',
'yahoo_messenger.cache', 'yahoo_messenger.cache',
), ),
'Browsers': ( 'Browsers': (
'chromium.cache', 'chromium.cache',
'chromium.current_session', 'chromium.current_session',
'firefox.cache', 'firefox.cache',
'firefox.session_restore', 'firefox.session_restore',
'google_chrome.cache', 'google_chrome.cache',
'google_chrome.session', 'google_chrome.session',
'google_earth.temporary_files', 'google_earth.temporary_files',
'internet_explorer.temporary_files', 'internet_explorer.temporary_files',
'opera.cache', 'opera.cache',
'opera.current_session', 'opera.current_session',
'safari.cache', 'safari.cache',
'seamonkey.cache', 'seamonkey.cache',
), ),
'System': ( 'System': (
'system.clipboard', 'system.clipboard',
'system.tmp', 'system.tmp',
'winapp2_windows.jump_lists', 'winapp2_windows.jump_lists',
'winapp2_windows.ms_search', 'winapp2_windows.ms_search',
'windows_explorer.run', 'windows_explorer.run',
'windows_explorer.search_history', 'windows_explorer.search_history',
'windows_explorer.thumbnails', 'windows_explorer.thumbnails',
), ),
} }
def check_result(result, other_results): def check_result(result, other_results):
"""Check result for warnings and errors.""" """Check result for warnings and errors."""
result_ok = True result_ok = True
if not result['CS']: if not result['CS']:
for warning in other_results.get('Warning', {}).keys(): for warning in other_results.get('Warning', {}).keys():
if warning in str(result['Error']): if warning in str(result['Error']):
# Ignore warnings and repair statements # Ignore warnings and repair statements
return True return True
# Error is not a warning # Error is not a warning
result_ok = False result_ok = False
return result_ok return result_ok
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
print_info('{}: System Diagnostics Tool\n'.format(KIT_NAME_FULL)) print_info('{}: System Diagnostics Tool\n'.format(KIT_NAME_FULL))
ticket_number = get_ticket_number() ticket_number = get_ticket_number()
system_ok = True system_ok = True
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found', 'FileNotFoundError': 'File not found',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',
'UnsupportedOSError': 'Unsupported OS', 'UnsupportedOSError': 'Unsupported OS',
}} }}
if ENABLED_TICKET_NUMBERS: if ENABLED_TICKET_NUMBERS:
print_info('Starting System Diagnostics for Ticket #{}\n'.format( print_info('Starting System Diagnostics for Ticket #{}\n'.format(
ticket_number)) ticket_number))
# Sanitize Environment # Sanitize Environment
print_info('Sanitizing Environment') print_info('Sanitizing Environment')
if not D7_MODE: if not D7_MODE:
try_and_print(message='Running RKill...', try_and_print(message='Running RKill...',
function=run_rkill, cs='Done', other_results=other_results) function=run_rkill, cs='Done', other_results=other_results)
try_and_print(message='Running TDSSKiller...', try_and_print(message='Running TDSSKiller...',
function=run_tdsskiller, cs='Done', other_results=other_results) function=run_tdsskiller, cs='Done', other_results=other_results)
# Re-run if earlier process was stopped. # Re-run if earlier process was stopped.
stay_awake() stay_awake()
# Start diags # Start diags
if not D7_MODE: if not D7_MODE:
print_info('Starting Background Scans') print_info('Starting Background Scans')
check_connection() check_connection()
try_and_print(message='Running HitmanPro...', try_and_print(message='Running HitmanPro...',
function=run_hitmanpro, cs='Started', other_results=other_results) function=run_hitmanpro, cs='Started', other_results=other_results)
try_and_print(message='Running Autoruns...', try_and_print(message='Running Autoruns...',
function=run_autoruns, cs='Started', other_results=other_results) function=run_autoruns, cs='Started', other_results=other_results)
# OS Health Checks # OS Health Checks
print_info('OS Health Checks') print_info('OS Health Checks')
result = try_and_print( result = try_and_print(
message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']),
function=run_chkdsk, other_results=other_results) 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) system_ok &= check_result(result, other_results)
result = try_and_print(message='SFC scan...', else:
function=run_sfc_scan, other_results=other_results) try_and_print(message='DISM CheckHealth...',
system_ok &= check_result(result, other_results) function=run_dism, other_results=other_results, repair=False)
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)
if D7_MODE: if D7_MODE:
# Archive all browsers for all users # Archive all browsers for all users
archive_all_users() archive_all_users()
else: else:
# Scan for supported browsers # Scan for supported browsers
print_info('Scanning for browsers') print_info('Scanning for browsers')
scan_for_browsers() scan_for_browsers()
# Run BleachBit cleaners # Run BleachBit cleaners
print_info('BleachBit Cleanup') print_info('BleachBit Cleanup')
for k, v in sorted(BLEACH_BIT_CLEANERS.items()): for k, v in sorted(BLEACH_BIT_CLEANERS.items()):
try_and_print(message='{}...'.format(k), try_and_print(message='{}...'.format(k),
function=run_bleachbit, function=run_bleachbit,
cs='Done', other_results=other_results, cs='Done', other_results=other_results,
cleaners=v, preview=bool(not D7_MODE)) cleaners=v, preview=bool(not D7_MODE))
# Export system info # Export system info
print_info('Backup System Information') print_info('Backup System Information')
try_and_print(message='AIDA64 reports...', try_and_print(message='AIDA64 reports...',
function=run_aida64, cs='Done', other_results=other_results) function=run_aida64, cs='Done', other_results=other_results)
if not D7_MODE: if not D7_MODE:
backup_browsers() backup_browsers()
try_and_print(message='File listing...', try_and_print(message='File listing...',
function=backup_file_list, cs='Done', other_results=other_results) function=backup_file_list, cs='Done', other_results=other_results)
try_and_print(message='Power plans...', try_and_print(message='Power plans...',
function=backup_power_plans, cs='Done') function=backup_power_plans, cs='Done')
try_and_print(message='Product Keys...', try_and_print(message='Product Keys...',
function=run_produkey, cs='Done', other_results=other_results) function=run_produkey, cs='Done', other_results=other_results)
try_and_print(message='Registry...', try_and_print(message='Registry...',
function=backup_registry, cs='Done', other_results=other_results, function=backup_registry, cs='Done', other_results=other_results,
overwrite=True) overwrite=True)
# Summary # Summary
if not D7_MODE: if not D7_MODE:
print_info('Summary') print_info('Summary')
try_and_print(message='Operating System:', try_and_print(message='Operating System:',
function=show_os_name, ns='Unknown', silent_function=False) function=show_os_name, ns='Unknown', silent_function=False)
try_and_print(message='Activation:', try_and_print(message='Activation:',
function=show_os_activation, ns='Unknown', silent_function=False) function=show_os_activation, ns='Unknown', silent_function=False)
try_and_print(message='Installed RAM:', try_and_print(message='Installed RAM:',
function=show_installed_ram, ns='Unknown', silent_function=False) function=show_installed_ram, ns='Unknown', silent_function=False)
show_free_space() show_free_space()
try_and_print(message='Temp Size:', try_and_print(message='Temp Size:',
function=show_temp_files_size, silent_function=False) function=show_temp_files_size, silent_function=False)
try_and_print(message='Installed Antivirus:', try_and_print(message='Installed Antivirus:',
function=get_installed_antivirus, ns='Unknown', function=get_installed_antivirus, ns='Unknown',
other_results=other_results, print_return=True) other_results=other_results, print_return=True)
try_and_print(message='Installed Office:', try_and_print(message='Installed Office:',
function=get_installed_office, ns='Unknown', function=get_installed_office, ns='Unknown',
other_results=other_results, print_return=True) other_results=other_results, print_return=True)
try_and_print(message='Product Keys:', try_and_print(message='Product Keys:',
function=get_product_keys, ns='Unknown', print_return=True) function=get_product_keys, ns='Unknown', print_return=True)
# User data # User data
if not D7_MODE: if not D7_MODE:
print_info('User Data') print_info('User Data')
try: try:
show_user_data_summary() show_user_data_summary()
except Exception: except Exception:
print_error(' Unknown error.') print_error(' Unknown error.')
# Done # Done
if not D7_MODE or not system_ok: if not D7_MODE or not system_ok:
print_standard('\nDone.') print_standard('\nDone.')
pause('Press Enter to exit...') pause('Press Enter to exit...')
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=4 sw=4 ts=4 # vim: sts=2 sw=2 ts=2

View file

@ -12,17 +12,19 @@ os.system('title {}: Transferred Key Finder'.format(KIT_NAME_FULL))
set_log_file('Transferred Keys.log') set_log_file('Transferred Keys.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
stay_awake() stay_awake()
clear_screen() clear_screen()
print_info('{}: Transferred Key Finder\n'.format(KIT_NAME_FULL)) print_info('{}: Transferred Key Finder\n'.format(KIT_NAME_FULL))
try_and_print(message='Searching for keys...', try_and_print(message='Searching for keys...',
function=list_clientdir_keys, print_return=True) function=list_clientdir_keys, print_return=True)
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -11,141 +11,143 @@ init_global_vars()
os.system('title {}: Kit Update Tool'.format(KIT_NAME_FULL)) os.system('title {}: Kit Update Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__': if __name__ == '__main__':
try: try:
clear_screen() clear_screen()
print_info('{}: Kit Update Tool\n'.format(KIT_NAME_FULL)) print_info('{}: Kit Update Tool\n'.format(KIT_NAME_FULL))
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
}} }}
## Prep ## ## Prep ##
update_sdio = ask('Update SDI Origin?') update_sdio = ask('Update SDI Origin?')
## Download ## ## Download ##
print_success('Downloading tools') print_success('Downloading tools')
# Data Recovery # Data Recovery
print_info(' Data Recovery') print_info(' Data Recovery')
try_and_print(message='TestDisk / PhotoRec...', function=update_testdisk, other_results=other_results, width=40) try_and_print(message='TestDisk / PhotoRec...', function=update_testdisk, other_results=other_results, width=40)
# Data Transfers # Data Transfers
print_info(' Data Transfers') print_info(' Data Transfers')
try_and_print(message='FastCopy...', function=update_fastcopy, other_results=other_results, width=40) 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='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='wimlib...', function=update_wimlib, other_results=other_results, width=40)
try_and_print(message='XYplorer...', function=update_xyplorer, other_results=other_results, width=40) try_and_print(message='XYplorer...', function=update_xyplorer, other_results=other_results, width=40)
# Diagnostics # Diagnostics
print_info(' Diagnostics') print_info(' Diagnostics')
try_and_print(message='AIDA64...', function=update_aida64, other_results=other_results, width=40) 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='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='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='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='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='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='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='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='NirCmd...', function=update_nircmd, other_results=other_results, width=40)
try_and_print(message='ProduKey...', function=update_produkey, other_results=other_results, width=40) try_and_print(message='ProduKey...', function=update_produkey, other_results=other_results, width=40)
# Drivers # Drivers
print_info(' 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 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='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) try_and_print(message='Samsing Magician...', function=update_samsung_magician, other_results=other_results, width=40)
if update_sdio: if update_sdio:
try_and_print(message='Snappy Driver Installer Origin...', function=update_sdi_origin, other_results=other_results, width=40) try_and_print(message='Snappy Driver Installer Origin...', function=update_sdi_origin, other_results=other_results, width=40)
# Installers # Installers
print_info(' 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='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='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='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='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) 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) update_all_ninite(other_results=other_results, width=40)
# Misc # Misc
print_info(' Misc') print_info(' Misc')
try_and_print(message='Caffeine...', function=update_caffeine, other_results=other_results, width=40) 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='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='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='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='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='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='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='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='WizTree...', function=update_wiztree, other_results=other_results, width=40)
try_and_print(message='XMPlay...', function=update_xmplay, other_results=other_results, width=40) try_and_print(message='XMPlay...', function=update_xmplay, other_results=other_results, width=40)
# Repairs # Repairs
print_info(' Repairs') print_info(' Repairs')
try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results, width=40) 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='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='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='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='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) try_and_print(message='WinAIO Repair...', function=update_winaiorepair, other_results=other_results, width=40)
# Uninstallers # Uninstallers
print_info(' Uninstallers') print_info(' Uninstallers')
try_and_print(message='IObit Uninstaller...', function=update_iobit_uninstaller, other_results=other_results, width=40) try_and_print(message='IObit Uninstaller...', function=update_iobit_uninstaller, other_results=other_results, width=40)
## Review ## ## Review ##
print_standard('Please review the results and download/extract any missing items to .cbin') print_standard('Please review the results and download/extract any missing items to .cbin')
pause('Press Enter to compress the .cbin items') pause('Press Enter to compress the .cbin items')
## Compress ## ## Compress ##
print_success('Compressing tools') print_success('Compressing tools')
print_info(' _Drivers') print_info(' _Drivers')
for item in os.scandir(r'{}\_Drivers'.format(global_vars['CBinDir'])): for item in os.scandir(r'{}\_Drivers'.format(global_vars['CBinDir'])):
if not re.search(r'^(_Drivers|.*7z)$', item.name, re.IGNORECASE): if not re.search(r'^(_Drivers|.*7z)$', item.name, re.IGNORECASE):
try_and_print( try_and_print(
message='{}...'.format(item.name), message='{}...'.format(item.name),
function=compress_and_remove_item, function=compress_and_remove_item,
other_results = other_results, other_results = other_results,
width=40, width=40,
item = item) item = item)
print_info(' .cbin') print_info(' .cbin')
for item in os.scandir(global_vars['CBinDir']): for item in os.scandir(global_vars['CBinDir']):
if not re.search(r'^(_Drivers|_include|.*7z)$', item.name, re.IGNORECASE): if not re.search(r'^(_Drivers|_include|.*7z)$', item.name, re.IGNORECASE):
try_and_print( try_and_print(
message='{}...'.format(item.name), message='{}...'.format(item.name),
function=compress_and_remove_item, function=compress_and_remove_item,
other_results = other_results, other_results = other_results,
width=40, width=40,
item = item) item = item)
## Search for network Office/QuickBooks installers & add to LAUNCHERS ## Search for network Office/QuickBooks installers & add to LAUNCHERS
print_success('Scanning for network installers') print_success('Scanning for network installers')
scan_for_net_installers(OFFICE_SERVER, 'Office', min_year=2010) scan_for_net_installers(OFFICE_SERVER, 'Office', min_year=2010)
scan_for_net_installers(QUICKBOOKS_SERVER, 'QuickBooks', min_year=2015) scan_for_net_installers(QUICKBOOKS_SERVER, 'QuickBooks', min_year=2015)
## Generate Launchers ## Generate Launchers
print_success('Generating launchers') print_success('Generating launchers')
for section in sorted(LAUNCHERS.keys()): for section in sorted(LAUNCHERS.keys()):
print_info(' {}'.format(section)) print_info(' {}'.format(section))
for name, options in sorted(LAUNCHERS[section].items()): for name, options in sorted(LAUNCHERS[section].items()):
try_and_print(message=name, function=generate_launcher, try_and_print(message=name, function=generate_launcher,
section=section, name=name, options=options, section=section, name=name, options=options,
other_results=other_results, width=40) other_results=other_results, width=40)
# Rename "Copy WizardKit.cmd" (if necessary) # Rename "Copy WizardKit.cmd" (if necessary)
source = r'{}\Scripts\Copy WizardKit.cmd'.format(global_vars['BinDir']) source = r'{}\Scripts\Copy WizardKit.cmd'.format(global_vars['BinDir'])
dest = r'{}\Copy {}.cmd'.format(global_vars['BaseDir'], KIT_NAME_FULL) dest = r'{}\Copy {}.cmd'.format(global_vars['BaseDir'], KIT_NAME_FULL)
if os.path.exists(source): if os.path.exists(source):
try: try:
shutil.move(source, dest) shutil.move(source, dest)
except Exception: except Exception:
print_error(' Failed to rename "{}.cmd" to "{}.cmd"'.format( print_error(' Failed to rename "{}.cmd" to "{}.cmd"'.format(
'Copy WizardKit', KIT_NAME_FULL)) 'Copy WizardKit', KIT_NAME_FULL))
# Done # Done
print_standard('\nDone.') print_standard('\nDone.')
pause("Press Enter to exit...") pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -13,54 +13,56 @@ os.system('title {}: User Data Transfer Tool'.format(KIT_NAME_FULL))
set_log_file('User Data Transfer.log') set_log_file('User Data Transfer.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
# Prep # Prep
stay_awake() stay_awake()
clear_screen() clear_screen()
print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL)) print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL))
# Get backup name prefix # Get backup name prefix
ticket_number = get_ticket_number() ticket_number = get_ticket_number()
if ENABLED_TICKET_NUMBERS: if ENABLED_TICKET_NUMBERS:
backup_prefix = ticket_number backup_prefix = ticket_number
else: else:
backup_prefix = get_simple_string(prompt='Enter backup name prefix') backup_prefix = get_simple_string(prompt='Enter backup name prefix')
backup_prefix = backup_prefix.replace(' ', '_') backup_prefix = backup_prefix.replace(' ', '_')
# Set destination # Set destination
folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT) folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT)
dest = select_destination(folder_path=folder_path, dest = select_destination(folder_path=folder_path,
prompt='Which disk are we transferring to?') prompt='Which disk are we transferring to?')
# Set source items # Set source items
source = select_source(backup_prefix) source = select_source(backup_prefix)
items = scan_source(source, dest) items = scan_source(source, dest)
# Transfer # Transfer
clear_screen() clear_screen()
print_info('Transfer Details:\n') print_info('Transfer Details:\n')
if ENABLED_TICKET_NUMBERS: if ENABLED_TICKET_NUMBERS:
show_data('Ticket:', ticket_number) show_data('Ticket:', ticket_number)
show_data('Source:', source.path) show_data('Source:', source.path)
show_data('Destination:', dest) show_data('Destination:', dest)
if (not ask('Proceed with transfer?')): if (not ask('Proceed with transfer?')):
umount_backup_shares() umount_backup_shares()
abort() abort()
print_info('Transferring Data') print_info('Transferring Data')
transfer_source(source, dest, items) transfer_source(source, dest, items)
try_and_print(message='Removing extra files...', try_and_print(message='Removing extra files...',
function=cleanup_transfer, cs='Done', dest_path=dest) function=cleanup_transfer, cs='Done', dest_path=dest)
umount_backup_shares() umount_backup_shares()
# Done # Done
try_and_print(message='Running KVRT...', try_and_print(message='Running KVRT...',
function=run_kvrt, cs='Started') function=run_kvrt, cs='Started')
print_standard('\nDone.') print_standard('\nDone.')
pause("Press Enter to exit...") pause("Press Enter to exit...")
exit_script() exit_script()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2

View file

@ -14,9 +14,11 @@ set_title('{}: Root Menu'.format(KIT_NAME_FULL))
set_log_file('WinPE.log') set_log_file('WinPE.log')
if __name__ == '__main__': if __name__ == '__main__':
try: try:
menu_root() menu_root()
except SystemExit: except SystemExit:
pass pass
except: except:
major_exception() major_exception()
# vim: sts=2 sw=2 ts=2