Skip to content

Commit aaeec51

Browse files
committed
Handle missing exe path and update StartController
DeviceManager.get_exe_path now returns None early if a device has no full_path or if the referenced path does not exist, preventing incorrect fall-through to the emulator branch. StartController's start_device check no longer requires device['full_path'] before enforcing the Windows admin privilege prompt, so disconnected Windows devices will trigger the admin check regardless of full_path. These changes avoid incorrect exe resolution and potential errors when full_path is missing.
1 parent 488531a commit aaeec51

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

ok/device/DeviceManager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,8 @@ def device_connected(self):
708708

709709
def get_exe_path(self, device):
710710
path = device.get('full_path')
711+
if not path:
712+
return None
711713
if device.get(
712714
'device') == 'windows' and self.windows_capture_config:
713715
if path == "none":
@@ -724,6 +726,7 @@ def get_exe_path(self, device):
724726
return path
725727
if os.path.exists(path):
726728
return path
729+
return None
727730
elif emulator := device.get('emulator'):
728731
from ok.alas.platform_windows import get_emulator_exe
729732
return get_emulator_exe(emulator)

ok/gui/StartController.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def start_device(self):
5757
device = og.device_manager.get_preferred_device()
5858
logger.info(f'start_device: {device}')
5959

60-
if device and not device['connected'] and device.get('full_path'):
60+
if device and not device['connected']:
6161
if device['device'] == "windows" and not is_admin():
6262
communicate.starting_emulator.emit(True,
6363
"PC version requires admin privileges, Please restart this app with admin privileges!",

0 commit comments

Comments
 (0)