From 5e5d5834d9b3bf49600d294a754a2365d3b22292 Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Fri, 1 Dec 2017 13:15:56 -0800 Subject: [PATCH] Bugfix: PE_TOOLS paths --- .bin/Scripts/functions/winpe_menus.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.bin/Scripts/functions/winpe_menus.py b/.bin/Scripts/functions/winpe_menus.py index dcd0ba18..d22827ed 100644 --- a/.bin/Scripts/functions/winpe_menus.py +++ b/.bin/Scripts/functions/winpe_menus.py @@ -175,6 +175,11 @@ def menu_backup(): pause('\nPress Enter to return to main menu... ') def menu_root(): + # Fix PE_TOOLS paths + for k in PE_TOOLS.keys(): + PE_TOOLS[k]['Path'] = r'{}\{}'.format( + global_vars['BinDir'], PE_TOOLS[k]['Path']) + menus = [ {'Name': 'Create Backups', 'Menu': menu_backup}, {'Name': 'Setup Windows', 'Menu': menu_setup}, @@ -344,8 +349,8 @@ def menu_tools(): main_entries = tools, action_entries = actions) if (selection.isnumeric()): - tool = tools[int(selection)-1] - cmd = [PE_TOOLS[tool]['Path']] + PE_TOOLS[tool].get('Args', []) + name = tools[int(selection)-1]['Name'] + cmd = [PE_TOOLS[name]['Path']] + PE_TOOLS[name].get('Args', []) if tool == 'Blue Screen View': # Select path to scan minidump_path = select_minidump_path() @@ -354,7 +359,7 @@ def menu_tools(): try: popen_program(cmd) except Exception: - print_error('Failed to run {prog}'.format(prog=tool['Name'])) + print_error('Failed to run {}'.format(name)) time.sleep(2) pause() elif (selection == 'M'):