## MAJOR refactoring in progress ##
# BROKEN SCRIPTS #
(These scripts need updated to use the new global_vars & try_and_print)
* user_data_transfer.py
* install_sw_bundle.py
* All Python scripts
* PLAN: Replace vars_wk with global_vars
* functions.py
* PLAN: Will hold (nearly?) all functions going forward
* Should simplify the remaining scripts
* (e.g. reset_browsers and sw_diagnostics both had a backup_browsers())
* PLAN: Move all program definitions to functions.py
* (e.g. vars_wk['SevenZip'] --> global_vars['Programs']['SevenZip'])
* Added major_exception()
* Should be called if anything goes wrong to alert user and provide info
* Added non_clobber_rename()
* Appends a number (if necessary) to avoid overwriting data
* Added popen_program()
* Removes subprocess req for sw_checklist
* Added try_and_print()
* Run a function and show CS/NS/etc
* Can add additional "result" strings via Exception classes
* Passes unrecognized args/kwargs to the function
* Used by scripts to standardize message formatting and error handling
* exit_script() now handles opening the log (if set) and killing caffeine.exe
* Refactored init_vars_wk/os code to work with global_vars
* Uses the try_and_print function for better formatting and error handling
* BREAKING: 'OS' vars now located in global_vars['OS'] (including 'Arch')
* OS labeled as 'outdated', 'very outdated', and 'unrecognized' as needed
* BREAKING: renamed PROGRAMS to TOOLS
* Expanded TOOLS
* Removed log_file as a required argument from all functions
* Removed vars_wk/global_vars as a required argument from all functions
* Removed unused WinPE functions
* Sorted functions
* user_checklist() (formerly reset_browsers())
* Most functions moved to functions.py (see above)
* Browsers
* Work has been split into backup, reset, and config sections
* Script now asks all questions before starting backup/reset/config
* Script now forces the homepage to DEFAULT_HOMEPAGE (set in functions.py)
* (i.e. it no longer asks first, it just does it)
* Current homepages are listed where possible before backup/reset/config
* Launch/Launchers
* Added QuickBooks support
* Removed launchers
* CPU-Z
* HWMonitor
* PerfMonitor2
* SanDisk Express Cache
* Shortcut Cleaner
* SuperAntiSpyware (SAS)
* Replaced Notepad2-Mod with Notepad++
87 lines
5.3 KiB
Python
87 lines
5.3 KiB
Python
# Wizard Kit: User Checklist
|
|
|
|
import os
|
|
|
|
# Init
|
|
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
|
os.system('title Wizard Kit: User Checklist Tool')
|
|
from functions import *
|
|
init_global_vars()
|
|
set_global_vars(LogFile='{LogDir}\\User Checklist ({USERNAME}).log'.format(**global_vars, **global_vars['Env']))
|
|
|
|
def abort():
|
|
print_warning('Aborted.')
|
|
exit_script()
|
|
|
|
if __name__ == '__main__':
|
|
stay_awake()
|
|
os.system('cls')
|
|
other_results = {
|
|
'Warning': {
|
|
'NotInstalledError': 'Not installed',
|
|
'NoProfilesError': 'No profiles found',
|
|
}}
|
|
answer_config_browsers = ask('Configure Browsers to WK Standards?')
|
|
if answer_config_browsers:
|
|
answer_reset_browsers = ask('Reset browsers to safe defaults?')
|
|
if global_vars['OS']['Version'] == '10':
|
|
answer_config_classicshell = ask('Configure ClassicShell to WK Standards?')
|
|
answer_config_explorer = ask('Configure Explorer to WK Standards?')
|
|
|
|
# Cleanup
|
|
print_info('Cleanup')
|
|
try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done')
|
|
|
|
# Homepages
|
|
print_info('Current homepages')
|
|
list_homepages()
|
|
|
|
# Backup
|
|
print_info('Backing up browsers')
|
|
try_and_print(message='Chromium...', function=backup_chromium, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Google Chrome...', function=backup_chrome, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Google Chrome Canary...', function=backup_chrome_canary, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Internet Explorer...', function=backup_internet_explorer, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Mozilla Firefox (All)...', function=backup_firefox, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera...', function=backup_opera, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera Beta...', function=backup_opera_beta, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera Dev...', function=backup_opera_dev, cs='CS', ns='NS', other_results=other_results)
|
|
|
|
# Reset
|
|
if answer_config_browsers and answer_reset_browsers:
|
|
print_info('Resetting browsers')
|
|
try_and_print(message='Internet Explorer...', function=clean_internet_explorer, cs='Done')
|
|
try_and_print(message='Google Chrome...', function=reset_google_chrome, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Google Chrome Canary...', function=reset_google_chrome_canary, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Mozilla Firefox...', function=reset_mozilla_firefox, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera...', function=reset_opera, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera Beta...', function=reset_opera_beta, cs='CS', ns='NS', other_results=other_results)
|
|
try_and_print(message='Opera Dev...', function=reset_opera_dev, cs='CS', ns='NS', other_results=other_results)
|
|
|
|
# Configure
|
|
print_info('Configuring programs')
|
|
if answer_config_browsers:
|
|
try_and_print(message='Internet Explorer...', function=config_internet_explorer, cs='Done')
|
|
try_and_print(message='Google Chrome...', function=config_google_chrome, cs='Done', other_results=other_results)
|
|
try_and_print(message='Google Chrome Canary...', function=config_google_chrome_canary, cs='Done', other_results=other_results)
|
|
try_and_print(message='Mozilla Firefox...', function=config_mozilla_firefox, cs='Done', other_results=other_results)
|
|
try_and_print(message='Mozilla Firefox Dev...', function=config_mozilla_firefox_dev, cs='Done', other_results=other_results)
|
|
try_and_print(message='Opera...', function=config_opera, cs='Done', other_results=other_results)
|
|
try_and_print(message='Opera Beta...', function=config_opera_beta, cs='Done', other_results=other_results)
|
|
try_and_print(message='Opera Dev...', function=config_opera_dev, cs='Done', other_results=other_results)
|
|
try_and_print(message='Set default browser...', function=set_chrome_as_default, cs='Done', other_results=other_results)
|
|
if global_vars['OS']['Version'] == '10':
|
|
if answer_config_classicshell:
|
|
try_and_print(message='ClassicStart...', function=config_classicstart, cs='Done')
|
|
# if answer_config_explorer:
|
|
# try_and_print(message='Explorer...', function=config_explorer, cs='Done')
|
|
if not answer_config_browsers and not answer_config_classicshell and not answer_config_explorer:
|
|
print_warning(' Skipped')
|
|
else:
|
|
if not answer_config_browsers:
|
|
print_warning(' Skipped')
|
|
|
|
# Done
|
|
print_standard('\nDone.')
|
|
pause('Press Enter to exit...')
|
|
exit_script()
|