WizardKit/scripts/auto_setup.py
2021-09-15 09:56:09 -06:00

176 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',
),
'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': (
# Add checks for existing backups and skip if detected
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('ESET NOD32 Antivirus', no_op),
MenuEntry('LibreOffice', no_op),
MenuEntry('Open Shell Skin', no_op),
MenuEntry('uBlock Origin', no_op),
MenuEntry('Software Bundle', no_op), # include FF x32 -> x64 convertion?
),
'Configure System': (
MenuEntry('Chrome Notifications', no_op),
#MenuEntry('O&O ShutUp 10', no_op),
MenuEntry('Open Shell', no_op),
MenuEntry('uBlock Origin', no_op),
#MenuEntry('Disable Fast Startup', no_op),
MenuEntry('Enable BSoD MiniDumps', no_op),
#MenuEntry('Enable Hibernation', no_op),
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', no_op),
MenuEntry('Windows Activation', no_op),
MenuEntry('Windows Explorer', no_op),
MenuEntry(r'Windows\Temp Fix', no_op),
),
'System Information': (
MenuEntry('AIDA64 Reports', no_op),
MenuEntry('Backup Registry', 'auto_backup_registry'),
MenuEntry('Everything (File List)', no_op),
),
'System Summary': (
MenuEntry('Operating System', no_op),
MenuEntry('Windows Activation', no_op),
MenuEntry('Secure Boot', no_op),
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('Snappy Driver Installer', 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()