Windows Setup working
This commit is contained in:
parent
d075f17bfa
commit
dce31bf5dd
3 changed files with 26 additions and 14 deletions
|
|
@ -372,10 +372,17 @@ def set_title(title='~Some Title~'):
|
||||||
global_vars['Title'] = title
|
global_vars['Title'] = title
|
||||||
os.system('title {}'.format(title))
|
os.system('title {}'.format(title))
|
||||||
|
|
||||||
def show_info(message='~Some message~', info='~Some info~', indent=8, width=32):
|
def show_info(message='~Some message~', info='~Some info~', indent=8, width=32,
|
||||||
|
warning=False, error=False):
|
||||||
"""Display info with formatting."""
|
"""Display info with formatting."""
|
||||||
print_standard('{indent}{message:<{width}}{info}'.format(
|
message = '{indent}{message:<{width}}{info}'.format(
|
||||||
indent=' '*indent, width=width, message=message, info=info))
|
indent=' '*indent, width=width, message=message, info=info)
|
||||||
|
if error:
|
||||||
|
print_error(message)
|
||||||
|
elif warning:
|
||||||
|
print_warning(message)
|
||||||
|
else:
|
||||||
|
print_standard(message)
|
||||||
|
|
||||||
def sleep(seconds=2):
|
def sleep(seconds=2):
|
||||||
"""Wait for a while."""
|
"""Wait for a while."""
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ def prep_disk_for_formatting(disk=None):
|
||||||
if len(disk['Partitions']) == 0:
|
if len(disk['Partitions']) == 0:
|
||||||
disk['Format Warnings'] += 'No partitions found\n'
|
disk['Format Warnings'] += 'No partitions found\n'
|
||||||
for partition in disk['Partitions']:
|
for partition in disk['Partitions']:
|
||||||
display = ' Partition {num:>{width}}:\t{size} {fs}'.format(
|
display = '{size} {fs}'.format(
|
||||||
num = partition['Number'],
|
num = partition['Number'],
|
||||||
width = width,
|
width = width,
|
||||||
size = partition['Size'],
|
size = partition['Size'],
|
||||||
|
|
@ -344,10 +344,10 @@ def select_disk(title='Which disk?', disks=[]):
|
||||||
|
|
||||||
# Show unsupported partition(s)
|
# Show unsupported partition(s)
|
||||||
if is_bad_partition(partition):
|
if is_bad_partition(partition):
|
||||||
p_display_name = '{YELLOW}{display}{CLEAR}'.format(
|
p_name = '{YELLOW}{p_name}{CLEAR}'.format(
|
||||||
display=p_name, **COLORS)
|
p_name=p_name, **COLORS)
|
||||||
|
|
||||||
display_name += '\n\t\t\t{}'.format(display_name)
|
display_name += '\n\t\t\t{}'.format(p_name)
|
||||||
if not disk['Partitions']:
|
if not disk['Partitions']:
|
||||||
display_name += '\n\t\t\t{}No partitions found.{}'.format(
|
display_name += '\n\t\t\t{}No partitions found.{}'.format(
|
||||||
COLORS['YELLOW'], COLORS['CLEAR'])
|
COLORS['YELLOW'], COLORS['CLEAR'])
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ def menu_setup():
|
||||||
|
|
||||||
# Select disk to use as the OS disk
|
# Select disk to use as the OS disk
|
||||||
dest_disk = select_disk('To which disk are we installing Windows?', disks)
|
dest_disk = select_disk('To which disk are we installing Windows?', disks)
|
||||||
if not disk:
|
if not dest_disk:
|
||||||
raise GenericAbort
|
raise GenericAbort
|
||||||
|
|
||||||
# "Prep" disk
|
# "Prep" disk
|
||||||
|
|
@ -277,11 +277,16 @@ def menu_setup():
|
||||||
show_info(
|
show_info(
|
||||||
message = 'Boot Method:',
|
message = 'Boot Method:',
|
||||||
info = 'UEFI (GPT)' if dest_disk['Use GPT'] else 'Legacy (MBR)')
|
info = 'UEFI (GPT)' if dest_disk['Use GPT'] else 'Legacy (MBR)')
|
||||||
show_info(message='Using Image:', info=windows_version['Path'])
|
show_info(message='Using Image:', info=windows_image['Path'])
|
||||||
print_warning(' ERASING: \t[{Table}] ({Type}) {Name} {Size}\n'.format(
|
show_info(
|
||||||
**dest_disk))
|
message = 'ERASING:',
|
||||||
|
info = '[{Table}] ({Type}) {Name} {Size}\n'.format(**dest_disk),
|
||||||
|
warning = True)
|
||||||
for par in dest_disk['Partitions']:
|
for par in dest_disk['Partitions']:
|
||||||
print_warning(par['Display String'])
|
show_info(
|
||||||
|
message = 'Partition {:>2}:'.format(par['Number']),
|
||||||
|
info = par['Display String'],
|
||||||
|
warning = True)
|
||||||
print_warning(dest_disk['Format Warnings'])
|
print_warning(dest_disk['Format Warnings'])
|
||||||
|
|
||||||
if (not ask('Is this correct?')):
|
if (not ask('Is this correct?')):
|
||||||
|
|
@ -290,7 +295,7 @@ def menu_setup():
|
||||||
# Safety check
|
# Safety check
|
||||||
print_standard('\nSAFETY CHECK')
|
print_standard('\nSAFETY CHECK')
|
||||||
print_warning('All data will be DELETED from the '
|
print_warning('All data will be DELETED from the '
|
||||||
'disk & partition(s) listed above.')
|
'disk and partition(s) listed above.')
|
||||||
print_warning('This is irreversible and will lead '
|
print_warning('This is irreversible and will lead '
|
||||||
'to {CLEAR}{RED}DATA LOSS.'.format(**COLORS))
|
'to {CLEAR}{RED}DATA LOSS.'.format(**COLORS))
|
||||||
if (not ask('Asking again to confirm, is this correct?')):
|
if (not ask('Asking again to confirm, is this correct?')):
|
||||||
|
|
@ -357,7 +362,7 @@ def menu_tools():
|
||||||
if (selection.isnumeric()):
|
if (selection.isnumeric()):
|
||||||
name = tools[int(selection)-1]['Name']
|
name = tools[int(selection)-1]['Name']
|
||||||
cmd = [PE_TOOLS[name]['Path']] + PE_TOOLS[name].get('Args', [])
|
cmd = [PE_TOOLS[name]['Path']] + PE_TOOLS[name].get('Args', [])
|
||||||
if tool == 'Blue Screen View':
|
if name == 'Blue Screen View':
|
||||||
# Select path to scan
|
# Select path to scan
|
||||||
minidump_path = select_minidump_path()
|
minidump_path = select_minidump_path()
|
||||||
if minidump_path:
|
if minidump_path:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue