Wait for installations
This commit is contained in:
parent
f5f4c79326
commit
c30e30232f
3 changed files with 46 additions and 28 deletions
|
|
@ -126,7 +126,7 @@ def enable_system_restore():
|
||||||
|
|
||||||
def update_clock():
|
def update_clock():
|
||||||
"""Set Timezone and sync clock."""
|
"""Set Timezone and sync clock."""
|
||||||
run_program(['tzutil' ,'/s', WINDOWS_TIME_ZONE], check=False)
|
run_program(['tzutil', '/s', WINDOWS_TIME_ZONE], check=False)
|
||||||
run_program(['net', 'stop', 'w32ime'], check=False)
|
run_program(['net', 'stop', 'w32ime'], check=False)
|
||||||
run_program(
|
run_program(
|
||||||
['w32tm', '/config', '/syncfromflags:manual',
|
['w32tm', '/config', '/syncfromflags:manual',
|
||||||
|
|
@ -294,9 +294,9 @@ def install_libreoffice(
|
||||||
run_program(cmd, check=True)
|
run_program(cmd, check=True)
|
||||||
|
|
||||||
def install_ninite_bundle(
|
def install_ninite_bundle(
|
||||||
|
# pylint: disable=too-many-arguments,too-many-branches
|
||||||
base=True,
|
base=True,
|
||||||
browsers_only=False,
|
browsers_only=False,
|
||||||
current=False,
|
|
||||||
libreoffice=False,
|
libreoffice=False,
|
||||||
missing=False,
|
missing=False,
|
||||||
mse=False,
|
mse=False,
|
||||||
|
|
@ -317,32 +317,43 @@ def install_ninite_bundle(
|
||||||
# Bail
|
# Bail
|
||||||
return popen_objects
|
return popen_objects
|
||||||
|
|
||||||
# Main bundle
|
# Main selections
|
||||||
selections = []
|
main_selections = []
|
||||||
if base:
|
if base:
|
||||||
selections.append('base')
|
main_selections.append('base')
|
||||||
if standard and not missing:
|
|
||||||
selections.append('browsers')
|
|
||||||
if standard:
|
if standard:
|
||||||
if global_vars['OS']['Version'] in ('8', '8.1', '10'):
|
if global_vars['OS']['Version'] in ('8', '8.1', '10'):
|
||||||
selections.append('standard')
|
main_selections.append('standard')
|
||||||
else:
|
else:
|
||||||
selections.append('standard7')
|
main_selections.append('standard7')
|
||||||
cmd = r'{}\Installers\Extras\Bundles\{}.exe'.format(
|
cmd = r'{}\Installers\Extras\Bundles\{}.exe'.format(
|
||||||
global_vars['BaseDir'],
|
global_vars['BaseDir'],
|
||||||
'-'.join(selections),
|
'-'.join(main_selections),
|
||||||
)
|
)
|
||||||
popen_objects.append(popen_program([cmd]))
|
popen_objects.append(popen_program([cmd]))
|
||||||
|
|
||||||
# Current
|
# Extra selections
|
||||||
if current:
|
extra_selections = {}
|
||||||
for cmd in find_current_software():
|
for cmd in find_current_software():
|
||||||
popen_objects.append(popen_program([cmd]))
|
extra_selections[cmd] = True
|
||||||
|
|
||||||
# Missing
|
|
||||||
if missing:
|
if missing:
|
||||||
for cmd in find_missing_software():
|
for cmd in find_missing_software():
|
||||||
popen_objects.append(popen_program([cmd]))
|
extra_selections[cmd] = True
|
||||||
|
|
||||||
|
# Remove overlapping selections
|
||||||
|
regex = []
|
||||||
|
for n_name, n_group in NINITE_REGEX.items():
|
||||||
|
if n_name in main_selections:
|
||||||
|
regex.extend(n_group)
|
||||||
|
regex = '({})'.format('|'.join(regex))
|
||||||
|
extra_selections = {
|
||||||
|
cmd: True for cmd in extra_selections
|
||||||
|
if not re.search(regex, cmd, re.IGNORECASE)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Start extra selections
|
||||||
|
for cmd in extra_selections:
|
||||||
|
popen_objects.append(popen_program([cmd]))
|
||||||
|
|
||||||
# Microsoft Security Essentials
|
# Microsoft Security Essentials
|
||||||
if mse:
|
if mse:
|
||||||
|
|
|
||||||
|
|
@ -73,19 +73,18 @@ VCREDIST_SOURCES = {
|
||||||
'64': 'https://aka.ms/vs/15/release/vc_redist.x64.exe',
|
'64': 'https://aka.ms/vs/15/release/vc_redist.x64.exe',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
NINITE_REGEX = {
|
||||||
|
'base': ['7-Zip', 'VLC'],
|
||||||
|
'standard': ['Google Chrome', 'Mozilla Firefox', 'SumatraPDF'],
|
||||||
|
'standard7': ['Google Chrome', 'Mozilla Firefox', 'SumatraPDF'],
|
||||||
|
}
|
||||||
NINITE_SOURCES = {
|
NINITE_SOURCES = {
|
||||||
'Bundles': {
|
'Bundles': {
|
||||||
'base-browsers-standard.exe': '.net4.7.2-7zip-chrome-classicstart-firefox-sumatrapdf-vlc',
|
|
||||||
'base-browsers-standard7.exe': '.net4.7.2-7zip-chrome-firefox-sumatrapdf-vlc',
|
|
||||||
'base-browsers.exe': '.net4.7.2-7zip-chrome-firefox-vlc',
|
|
||||||
'base-standard.exe': '.net4.7.2-7zip-classicstart-sumatrapdf-vlc',
|
|
||||||
'base-standard7.exe': '.net4.7.2-7zip-sumatrapdf-vlc',
|
|
||||||
'base.exe': '.net4.7.2-7zip-vlc',
|
'base.exe': '.net4.7.2-7zip-vlc',
|
||||||
'browsers-standard.exe': 'chrome-classicstart-firefox-sumatrapdf',
|
'base-standard.exe': '.net4.7.2-7zip-chrome-classicstart-firefox-sumatrapdf-vlc',
|
||||||
'browsers-standard7.exe': 'chrome-firefox-sumatrapdf',
|
'base-standard7.exe': '.net4.7.2-7zip-chrome-firefox-sumatrapdf-vlc',
|
||||||
'browsers.exe': 'chrome-firefox',
|
'standard.exe': 'chrome-classicstart-firefox-sumatrapdf',
|
||||||
'standard.exe': 'classicstart-sumatrapdf',
|
'standard7.exe': 'chrome-firefox-sumatrapdf',
|
||||||
'standard7.exe': 'sumatrapdf',
|
|
||||||
},
|
},
|
||||||
'Audio-Video': {
|
'Audio-Video': {
|
||||||
'AIMP.exe': 'aimp',
|
'AIMP.exe': 'aimp',
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,6 @@ SETUP_QUESTIONS = {
|
||||||
|
|
||||||
# Ninite
|
# Ninite
|
||||||
'Base': {'New': True, 'Fab': True, 'Cur': True, 'HW': False},
|
'Base': {'New': True, 'Fab': True, 'Cur': True, 'HW': False},
|
||||||
'Current': {'New': False, 'Fab': False, 'Cur': True, 'HW': False},
|
|
||||||
'Missing': {'New': False, 'Fab': True, 'Cur': False, 'HW': False},
|
'Missing': {'New': False, 'Fab': True, 'Cur': False, 'HW': False},
|
||||||
'Standard': {'New': True, 'Fab': True, 'Cur': False, 'HW': False},
|
'Standard': {'New': True, 'Fab': True, 'Cur': False, 'HW': False},
|
||||||
}
|
}
|
||||||
|
|
@ -321,6 +320,15 @@ def main():
|
||||||
other_results=OTHER_RESULTS,
|
other_results=OTHER_RESULTS,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
# Wait for Ninite proc(s)
|
||||||
|
if action == 'Ninite bundle':
|
||||||
|
print_standard('Waiting for installations to finish...')
|
||||||
|
try:
|
||||||
|
for proc in result['Out']:
|
||||||
|
proc.wait()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
# Pause
|
# Pause
|
||||||
if values.get('Pause', False):
|
if values.get('Pause', False):
|
||||||
print_standard(values['Pause'])
|
print_standard(values['Pause'])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue