Add Hiberboot and hibernation sections

This commit is contained in:
2Shirt 2021-10-02 17:44:59 -06:00
parent 6db1be4046
commit 1168e8b0dd
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 30 additions and 3 deletions

View file

@ -120,10 +120,10 @@ BASE_MENUS = {
'Configure System': ( 'Configure System': (
MenuEntry('Configure Browsers', 'auto_config_browsers'), MenuEntry('Configure Browsers', 'auto_config_browsers'),
MenuEntry('Open Shell', 'auto_config_open_shell'), MenuEntry('Open Shell', 'auto_config_open_shell'),
#MenuEntry('Disable Fast Startup', no_op), MenuEntry('Disable Fast Startup', 'auto_disable_fast_startup', selected=False),
#MenuEntry('Disable Telemetry', no_op), # O&O ShutUp 10 #MenuEntry('Disable Telemetry', no_op), # O&O ShutUp 10
MenuEntry('Enable BSoD MiniDumps', 'auto_enable_bsod_minidumps'), MenuEntry('Enable BSoD MiniDumps', 'auto_enable_bsod_minidumps'),
#MenuEntry('Enable Hibernation', no_op), MenuEntry('Enable Hibernation', 'auto_enable_hibernation', selected=False),
MenuEntry('Enable RegBack', 'auto_enable_regback'), MenuEntry('Enable RegBack', 'auto_enable_regback'),
MenuEntry('Enable System Restore', 'auto_system_restore_enable'), MenuEntry('Enable System Restore', 'auto_system_restore_enable'),
MenuEntry('Set System Restore Size', 'auto_system_restore_set_size'), MenuEntry('Set System Restore Size', 'auto_system_restore_set_size'),

View file

@ -388,11 +388,22 @@ def load_preset(menus, presets, title, enable_menu_exit=True):
print_standard(f'{title}') print_standard(f'{title}')
print('') print('')
if selection[0] == 'Default': if selection[0] == 'Default':
# LibreOffice
if ask('Install LibreOffice?'): if ask('Install LibreOffice?'):
menus['Install Software'].options['LibreOffice']['Selected'] = True menus['Install Software'].options['LibreOffice']['Selected'] = True
# Hiberboot & Hibernation
print('')
msg = 'Disable Fast Startup and enable Hibernation? (Recommended for SSDs)'
if ask(msg):
for option in ('Disable Fast Startup', 'Enable Hibernation'):
menus['Configure System'].options[option]['Selected'] = True
# ESET NOD32 AV
print('')
if ask('Install ESET NOD32 AV?'): if ask('Install ESET NOD32 AV?'):
option = 'ESET NOD32 AV' option = 'ESET NOD32 AV'
if ask(' Use MSP settings?'): if ask(' For ITS/VIP?'):
option = f'{option} (MSP)' option = f'{option} (MSP)'
menus['Install Software'].options[option]['Selected'] = True menus['Install Software'].options[option]['Selected'] = True
@ -532,11 +543,27 @@ def auto_set_custom_power_plan():
TRY_PRINT.run('Set Custom Power Plan...', create_custom_power_plan) TRY_PRINT.run('Set Custom Power Plan...', create_custom_power_plan)
def auto_disable_fast_startup():
"""Disable fast startup (i.e. Hiberboot)."""
TRY_PRINT.run(
'Disable Fast Startup...', reg_set_value, 'HKLM',
r'SOFTWARE\Policies\Microsoft\Windows\System',
'HiberbootEnabled', 0, 'DWORD',
)
def auto_enable_bsod_minidumps(): def auto_enable_bsod_minidumps():
"""Enable saving minidumps during BSoDs.""" """Enable saving minidumps during BSoDs."""
TRY_PRINT.run('Enable BSoD mini dumps...', enable_bsod_minidumps) TRY_PRINT.run('Enable BSoD mini dumps...', enable_bsod_minidumps)
def auto_enable_hibernation():
"""Enable Hibernation."""
TRY_PRINT.run(
'Enable Hibernation...', run_program, ['powercfg', '/hibernate', 'on'],
)
def auto_enable_regback(): def auto_enable_regback():
"""Enable RegBack.""" """Enable RegBack."""
TRY_PRINT.run( TRY_PRINT.run(