WizardKit/scripts/auto_setup.py

172 lines
5.2 KiB
Python

"""Wizard Kit: Auto System Setup Tool"""
# vim: sts=2 sw=2 ts=2
import os
import sys
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
# STATIC VARIABLES
PRESETS = {
'Additional User': {
'Configure System': (
'Chrome Notifications',
'Open Shell',
'uBlock Origin',
'Enable BSoD MiniDumps',
'Enable RegBack',
'Enable System Restore',
'Set System Restore Size',
'Enable Windows Updates',
'Windows Explorer',
),
'Install Software': (
'Firefox', # Needed to handle profile upgrade nonsense
),
'System Summary': (
'Operating System',
'Windows Activation',
'Secure Boot',
'Installed RAM',
'Storage Volumes',
'Virus Protection',
'Partitions 4K Aligned',
),
},
'Hardware': {
'Configure System': (
'Enable BSoD MiniDumps',
'Enable RegBack',
'Enable System Restore',
'Set System Restore Size',
'Enable Windows Updates',
),
'System Information': (
'Backup Registry',
),
'System Summary': (
'Operating System',
'Windows Activation',
'Secure Boot',
'Installed RAM',
'Storage Volumes',
'Virus Protection',
'Partitions 4K Aligned',
),
'Run Programs': (
'Device Manager',
'HWiNFO Sensors',
'XMPlay',
),
},
'Verify': {
'Configure System': (
'Enable BSoD MiniDumps',
'Enable RegBack',
'Enable System Restore',
'Set System Restore Size',
'Enable Windows Updates',
'Windows Explorer',
),
'System Summary': (
'Operating System',
'Windows Activation',
'Secure Boot',
'Installed RAM',
'Storage Volumes',
'Virus Protection',
'Installed Office',
'Partitions 4K Aligned',
),
},
}
# Classes
class MenuEntry():
# pylint: disable=too-few-public-methods
"""Simple class to allow cleaner code below."""
def __init__(self, name, function=None, **kwargs):
self.name = name
self.details = {
'Function': function,
'Selected': True,
**kwargs,
}
# TODO: DELETEME
def no_op(*args):
"""No Op"""
# STATIC VARIABLES
BASE_MENUS = {
'Groups': {
'Backup Settings': (
MenuEntry('Backup Browsers', 'auto_backup_browser_profiles'),
MenuEntry('Backup Power Plans', 'auto_backup_power_plans'),
MenuEntry('Reset Power Plans', 'auto_reset_power_plans'),
MenuEntry('Set Custom Power Plan', 'auto_set_custom_power_plan'),
),
'Install Software': (
MenuEntry('Visual C++ Runtimes', 'auto_install_vcredists'),
MenuEntry('Firefox', 'auto_install_firefox'),
MenuEntry('LibreOffice', 'auto_install_libreoffice'),
MenuEntry('Open Shell', 'auto_install_open_shell'),
MenuEntry('Software Bundle', 'auto_install_software_bundle'),
),
'Configure System': (
MenuEntry('Chrome Notifications', 'auto_disable_chrome_notifications'),
MenuEntry('Open Shell', 'auto_config_open_shell'),
MenuEntry('uBlock Origin', 'auto_enable_ublock_origin'),
MenuEntry('Enable BSoD MiniDumps', 'auto_enable_bsod_minidumps'),
MenuEntry('Enable RegBack', 'auto_enable_regback'),
MenuEntry('Enable System Restore', 'auto_system_restore_enable'),
MenuEntry('Set System Restore Size', 'auto_system_restore_set_size'),
MenuEntry('Create System Restore', 'auto_system_restore_create'),
MenuEntry('Enable Windows Updates', 'auto_windows_updates_enable'),
MenuEntry('User Account Control', 'auto_restore_default_uac'),
MenuEntry('Windows Activation', 'auto_activate_windows'),
MenuEntry('Windows Explorer', 'auto_config_explorer'),
MenuEntry(r'Windows\Temp Fix', 'auto_windows_temp_fix'),
),
'System Information': (
MenuEntry('AIDA64 Report', 'auto_export_aida64_report'),
MenuEntry('Backup Registry', 'auto_backup_registry'),
),
'System Summary': (
MenuEntry('Operating System', 'auto_show_os_name'),
MenuEntry('Windows Activation', 'auto_show_activation'),
MenuEntry('Secure Boot', 'auto_show_secure_boot_status'),
MenuEntry('Installed RAM', no_op),
MenuEntry('Storage Volumes', no_op),
MenuEntry('Virus Protection', no_op),
MenuEntry('Partitions 4K Aligned', no_op),
),
'Run Programs': (
MenuEntry('Device Manager', no_op),
MenuEntry('HWiNFO Sensors', no_op),
MenuEntry('Windows Updates', no_op),
MenuEntry('Windows Activation', no_op),
MenuEntry('XMPlay', no_op),
),
},
'Actions': (
MenuEntry('Load Preset'),
MenuEntry('Start', Separator=True),
MenuEntry('Quit'),
),
}
if __name__ == '__main__':
try:
wk.setup.win.run_auto_setup(BASE_MENUS, PRESETS)
except KeyboardInterrupt:
wk.std.abort()
except SystemExit:
raise
except: #pylint: disable=bare-except
wk.std.major_exception()