diff --git a/.bin/Scripts/functions/backup.py b/.bin/Scripts/functions/backup.py index fe0935fb..a787a0ed 100644 --- a/.bin/Scripts/functions/backup.py +++ b/.bin/Scripts/functions/backup.py @@ -32,7 +32,7 @@ def fix_path(path): """Replace invalid filename characters with underscores.""" return REGEX_BAD_PATH_NAMES.sub('_', path) -def prep_disk_for_backup(destination, disk, ticket_number): +def prep_disk_for_backup(destination, disk, backup_prefix): """Gather details about the disk and its partitions. This includes partitions that can't be backed up, @@ -71,10 +71,10 @@ def prep_disk_for_backup(destination, disk, ticket_number): par['Image Name'] = par['Name'] if par['Name'] else 'Unknown' if 'IP' in destination: par['Image Path'] = r'\\{}\{}\{}'.format( - destination['IP'], destination['Share'], ticket_number) + destination['IP'], destination['Share'], backup_prefix) else: par['Image Path'] = r'{}:\{}'.format( - ticket_number, destination['Letter']) + destination['Letter'], backup_prefix) par['Image Path'] += r'\{}_{}.wim'.format( par['Number'], par['Image Name']) par['Image Path'] = fix_path(par['Image Path']) diff --git a/.bin/Scripts/functions/winpe_menus.py b/.bin/Scripts/functions/winpe_menus.py index 750f88a0..c5d6dd99 100644 --- a/.bin/Scripts/functions/winpe_menus.py +++ b/.bin/Scripts/functions/winpe_menus.py @@ -75,10 +75,14 @@ def menu_backup(): }} set_title('{}: Backup Menu'.format(KIT_NAME_FULL)) - # Set ticket Number + # Set backup prefix clear_screen() print_standard('{}\n'.format(global_vars['Title'])) ticket_number = get_ticket_number() + if ENABLED_TICKET_NUMBERS: + backup_prefix = ticket_number + else: + backup_prefix = get_simple_string(prompt='Enter backup name prefix') # Mount backup shares mount_backup_shares(read_write=True) @@ -107,12 +111,13 @@ def menu_backup(): raise GenericAbort # "Prep" disk - prep_disk_for_backup(destination, disk, ticket_number) + prep_disk_for_backup(destination, disk, dest_prefix) # Display details for backup task clear_screen() print_info('Create Backup - Details:\n') - show_data(message='Ticket:', data=ticket_number) + if ENABLED_TICKET_NUMBERS: + show_data(message='Ticket:', data=ticket_number) show_data( message = 'Source:', data = '[{}] ({}) {} {}'.format( @@ -293,7 +298,8 @@ def menu_setup(): # Display details for setup task clear_screen() print_info('Setup Windows - Details:\n') - show_data(message='Ticket:', data=ticket_number) + if ENABLED_TICKET_NUMBERS: + show_data(message='Ticket:', data=ticket_number) show_data(message='Installing:', data=windows_version['Name']) show_data( message = 'Boot Method:',