mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +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:
|
class VirtualBoxEmulator:
|
||||||
UNINSTALL_REG = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
|
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):
|
def __init__(self, name, root_path, adb_path, vbox_path, vbox_name):
|
||||||
"""
|
"""
|
||||||
@ -39,7 +40,10 @@ class VirtualBoxEmulator:
|
|||||||
Raises:
|
Raises:
|
||||||
FileNotFoundError: If emulator not installed.
|
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]
|
res = winreg.QueryValueEx(reg, 'UninstallString')[0]
|
||||||
|
|
||||||
file = re.search('"(.*?)"', res)
|
file = re.search('"(.*?)"', res)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user