mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-09 10:37:36 +08:00
Fix: Add another uninstall registry path to search emulators
This commit is contained in:
parent
d3f3447afe
commit
1b65a919d5
@ -14,6 +14,7 @@ asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
|
||||
|
||||
class VirtualBoxEmulator:
|
||||
UNINSTALL_REG = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
|
||||
UNINSTALL_REG_2 = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
|
||||
|
||||
def __init__(self, name, root_path, adb_path, vbox_path, vbox_name):
|
||||
"""
|
||||
@ -39,7 +40,10 @@ class VirtualBoxEmulator:
|
||||
Raises:
|
||||
FileNotFoundError: If emulator not installed.
|
||||
"""
|
||||
reg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, f'{self.UNINSTALL_REG}\\{self.name}', 0)
|
||||
try:
|
||||
reg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, f'{self.UNINSTALL_REG}\\{self.name}', 0)
|
||||
except FileNotFoundError:
|
||||
reg = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, f'{self.UNINSTALL_REG_2}\\{self.name}', 0)
|
||||
res = winreg.QueryValueEx(reg, 'UninstallString')[0]
|
||||
|
||||
file = re.search('"(.*?)"', res)
|
||||
|
Loading…
Reference in New Issue
Block a user