Ensure tinc-gui running in 64 bits mode can find tinc's 32 bit registry key.
This commit is contained in:
parent
ab583f7e8c
commit
c10f3105b3
1 changed files with 7 additions and 1 deletions
|
@ -234,9 +234,15 @@ class VPN:
|
||||||
|
|
||||||
def __init__(self, netname = None, pidfile = None):
|
def __init__(self, netname = None, pidfile = None):
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
|
sam = _winreg.KEY_READ
|
||||||
|
if platform.machine().endswith('64'):
|
||||||
|
sam = sam | _winreg.KEY_WOW64_64KEY
|
||||||
try:
|
try:
|
||||||
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||||
key = _winreg.OpenKey(reg, "SOFTWARE\\tinc")
|
try:
|
||||||
|
key = _winreg.OpenKey(reg, "SOFTWARE\\tinc", 0, sam)
|
||||||
|
except WindowsError:
|
||||||
|
key = _winreg.OpenKey(reg, "SOFTWARE\\Wow6432Node\\tinc", 0, sam)
|
||||||
VPN.confdir = _winreg.QueryValue(key, None)
|
VPN.confdir = _winreg.QueryValue(key, None)
|
||||||
except WindowsError:
|
except WindowsError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue