New reset_browsers script for use in d7ii
* Adjusted user_checklist as well
This commit is contained in:
parent
b42f393a1a
commit
9f77b532b6
2 changed files with 77 additions and 10 deletions
61
.bin/Scripts/reset_browsers.py
Normal file
61
.bin/Scripts/reset_browsers.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# Wizard Kit: Reset Browsers
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
sys.path.append(os.getcwd())
|
||||
from functions.browsers import *
|
||||
from functions.cleanup import *
|
||||
from functions.setup import *
|
||||
init_global_vars()
|
||||
os.system('title {}: Browser Reset Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\Browser Reset ({USERNAME}).log'.format(
|
||||
**global_vars, **global_vars['Env'])
|
||||
D7_MODE = 'd7mode' in sys.argv
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
stay_awake()
|
||||
clear_screen()
|
||||
print_info('{}: Browser Reset\n'.format(KIT_NAME_FULL))
|
||||
other_results = {
|
||||
'Warning': {
|
||||
'NotInstalledError': 'Not installed',
|
||||
'NoProfilesError': 'No profiles found',
|
||||
}}
|
||||
|
||||
# Bail early
|
||||
if not D7_MODE or ask('Reset browsers to safe defaults first?'):
|
||||
exit_script()
|
||||
|
||||
# Scan for supported browsers
|
||||
print_info('Scanning for browsers')
|
||||
scan_for_browsers()
|
||||
|
||||
# Homepages
|
||||
print_info('Current homepages')
|
||||
list_homepages()
|
||||
|
||||
# Backup
|
||||
print_info('Backing up browsers')
|
||||
backup_browsers()
|
||||
|
||||
# Reset
|
||||
print_info('Resetting browsers')
|
||||
reset_browsers()
|
||||
|
||||
# Configure
|
||||
print_info('Installing uBlock Origin')
|
||||
install_adblock()
|
||||
|
||||
# Done
|
||||
if not D7_MODE:
|
||||
print_standard('\nDone.')
|
||||
pause('Press Enter to exit...')
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
|
|
@ -28,38 +28,44 @@ if __name__ == '__main__':
|
|||
#answer_config_browsers = ask('Install adblock?')
|
||||
answer_config_browsers = True
|
||||
if answer_config_browsers:
|
||||
if D7_MODE:
|
||||
# This is handled by another script option in d7ii
|
||||
answer_reset_browsers = False
|
||||
else:
|
||||
answer_reset_browsers = ask(
|
||||
'Reset browsers to safe defaults first?')
|
||||
answer_reset_browsers = ask(
|
||||
'Reset browsers to safe defaults first?')
|
||||
if global_vars['OS']['Version'] == '10':
|
||||
#answer_config_classicshell = ask('Configure ClassicShell?')
|
||||
#answer_config_explorer_user = ask('Configure Explorer?')
|
||||
answer_config_classicshell = True
|
||||
answer_config_explorer_user = True
|
||||
|
||||
|
||||
# Cleanup
|
||||
print_info('Cleanup')
|
||||
try_and_print(message='Desktop...',
|
||||
function=cleanup_desktop, cs='Done')
|
||||
|
||||
|
||||
# Scan for supported browsers
|
||||
print_info('Scanning for browsers')
|
||||
scan_for_browsers()
|
||||
|
||||
|
||||
# Homepages
|
||||
print_info('Current homepages')
|
||||
list_homepages()
|
||||
|
||||
if not D7_MODE:
|
||||
print_info('Current homepages')
|
||||
list_homepages()
|
||||
|
||||
# Backup
|
||||
if not D7_MODE:
|
||||
# Done during system_diagnostics
|
||||
print_info('Backing up browsers')
|
||||
backup_browsers()
|
||||
|
||||
|
||||
# Reset
|
||||
if answer_config_browsers and answer_reset_browsers:
|
||||
print_info('Resetting browsers')
|
||||
reset_browsers()
|
||||
|
||||
|
||||
# Configure
|
||||
print_info('Configuring programs')
|
||||
if answer_config_browsers:
|
||||
|
|
@ -81,7 +87,7 @@ if __name__ == '__main__':
|
|||
|
||||
# Run speedtest
|
||||
popen_program(['start', '', 'https://fast.com'], shell=True)
|
||||
|
||||
|
||||
# Done
|
||||
if not D7_MODE:
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue