Added more missing file warnings

* Part of the fix for #27
This commit is contained in:
2Shirt 2018-05-14 07:54:33 -06:00
parent 17dc572c4a
commit ebffd2a2dd
4 changed files with 23 additions and 8 deletions

View file

@ -5,6 +5,12 @@ from functions.common import *
# STATIC VARIABLES # STATIC VARIABLES
HKCU = winreg.HKEY_CURRENT_USER HKCU = winreg.HKEY_CURRENT_USER
HKLM = winreg.HKEY_LOCAL_MACHINE HKLM = winreg.HKEY_LOCAL_MACHINE
OTHER_RESULTS = {
'Error': {
'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found',
},
'Warning': {}}
SETTINGS_CLASSIC_START = { SETTINGS_CLASSIC_START = {
r'Software\IvoSoft\ClassicShell\Settings': {}, r'Software\IvoSoft\ClassicShell\Settings': {},
r'Software\IvoSoft\ClassicStartMenu': { r'Software\IvoSoft\ClassicStartMenu': {
@ -212,7 +218,7 @@ def install_adobe_reader():
'/msi', '/norestart', '/quiet', '/msi', '/norestart', '/quiet',
'ALLUSERS=1', 'ALLUSERS=1',
'EULA_ACCEPT=YES'] 'EULA_ACCEPT=YES']
try_and_print(message='Adobe Reader DC...', function=run_program, cmd=cmd) run_program(cmd)
def install_chrome_extensions(): def install_chrome_extensions():
"""Update registry to 'install' Google Chrome extensions for all users.""" """Update registry to 'install' Google Chrome extensions for all users."""
@ -235,12 +241,16 @@ def install_firefox_extensions():
"""Extract Firefox extensions to installation folder.""" """Extract Firefox extensions to installation folder."""
dist_path = r'{PROGRAMFILES}\Mozilla Firefox\distribution\extensions'.format( dist_path = r'{PROGRAMFILES}\Mozilla Firefox\distribution\extensions'.format(
**global_vars['Env']) **global_vars['Env'])
source_path = r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars)
if not os.path.exists(source_path):
raise FileNotFoundError
# Extract extension(s) to distribution folder # Extract extension(s) to distribution folder
cmd = [ cmd = [
global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0', global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0',
'-p{ArchivePassword}'.format(**global_vars), '-p{ArchivePassword}'.format(**global_vars),
'-o{dist_path}'.format(dist_path=dist_path), '-o{dist_path}'.format(dist_path=dist_path),
r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars)] source_path]
run_program(cmd) run_program(cmd)
def install_ninite_bundle(mse=False): def install_ninite_bundle(mse=False):
@ -264,7 +274,8 @@ def install_vcredists():
prev_dir = os.getcwd() prev_dir = os.getcwd()
os.chdir(r'{BinDir}\_vcredists'.format(**global_vars)) os.chdir(r'{BinDir}\_vcredists'.format(**global_vars))
for vcr in VCR_REDISTS: for vcr in VCR_REDISTS:
try_and_print(message=vcr['Name'], function=run_program, cmd=vcr['Cmd']) try_and_print(message=vcr['Name'], function=run_program,
cmd=vcr['Cmd'], other_results=OTHER_RESULTS)
os.chdir(prev_dir) os.chdir(prev_dir)

View file

@ -19,6 +19,7 @@ if __name__ == '__main__':
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'File not found',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',
@ -36,12 +37,14 @@ if __name__ == '__main__':
print_info('Installing Programs') print_info('Installing Programs')
if answer_adobe_reader: if answer_adobe_reader:
install_adobe_reader() try_and_print(message='Adobe Reader DC...',
function=install_adobe_reader, other_results=other_results)
if answer_vcr: if answer_vcr:
install_vcredists() install_vcredists()
if answer_ninite: if answer_ninite:
try_and_print(message='Ninite bundle...', try_and_print(message='Ninite bundle...',
function=install_ninite_bundle, cs='Started', mse=answer_mse) function=install_ninite_bundle, cs='Started',
mse=answer_mse, other_results=other_results)
if answer_extensions: if answer_extensions:
wait_for_process('ninite.exe') wait_for_process('ninite.exe')
print_info('Installing Extensions') print_info('Installing Extensions')
@ -51,7 +54,8 @@ if __name__ == '__main__':
try_and_print(message='Google Chrome extensions...', try_and_print(message='Google Chrome extensions...',
function=install_chrome_extensions) function=install_chrome_extensions)
try_and_print(message='Mozilla Firefox extensions...', try_and_print(message='Mozilla Firefox extensions...',
function=install_firefox_extensions) function=install_firefox_extensions,
other_results=other_results)
print_standard('\nDone.') print_standard('\nDone.')
exit_script() exit_script()
except SystemExit: except SystemExit:

View file

@ -26,7 +26,7 @@ if __name__ == '__main__':
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
'BIOSKeyNotFoundError': 'BIOS key not found', 'BIOSKeyNotFoundError': 'BIOS key not found',
'FileNotFoundError': 'Program not found', 'FileNotFoundError': 'File not found',
}, },
'Warning': {}} 'Warning': {}}
print_info('Starting System Checklist for Ticket #{}\n'.format( print_info('Starting System Checklist for Ticket #{}\n'.format(

View file

@ -25,7 +25,7 @@ if __name__ == '__main__':
other_results = { other_results = {
'Error': { 'Error': {
'CalledProcessError': 'Unknown Error', 'CalledProcessError': 'Unknown Error',
'FileNotFoundError': 'Program not found', 'FileNotFoundError': 'File not found',
}, },
'Warning': { 'Warning': {
'GenericRepair': 'Repaired', 'GenericRepair': 'Repaired',