ModelTranslator: 修注册表 rizomuv 值无后缀致发现失效——拼回真实 exe(审查修复)

This commit is contained in:
ud18010
2026-07-17 16:43:24 +08:00
parent 53e4898a76
commit 9b22b270cc
2 changed files with 16 additions and 6 deletions
+4 -2
View File
@@ -33,8 +33,10 @@ def registry_rizom_path():
continue
key_path = "SOFTWARE\\Rizom Lab\\RizomUV VS RS 202%d.%d" % (i, j)
try:
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_path)
return winreg.QueryValue(key, "rizomuv.exe")
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_path) as key:
val = winreg.QueryValue(key, "rizomuv.exe")
# 注册表值是不带后缀的安装前缀(官方只取 dirname 用),拼回真实 exe
return os.path.join(os.path.dirname(val), "rizomuv.exe")
except OSError:
continue
return None