Commit e23c4d69 authored by Olivier Aubert's avatar Olivier Aubert

python-ctypes: improve win32 initialization (contrib from <mmuellen@gmx.de>)

parent 10d4cfc5
......@@ -46,6 +46,21 @@ elif sys.platform == 'win32':
plugin_path=None
path=ctypes.util.find_library('libvlc.dll')
if path is None:
# Try to use registry settings
import _winreg
plugin_path_found = None
subkey, name = 'Software\\VideoLAN\\VLC','InstallDir'
for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER:
try:
reg = _winreg.OpenKey(hkey, subkey)
plugin_path_found, type_id = _winreg.QueryValueEx(reg, name)
_winreg.CloseKey(reg)
break
except _winreg.error:
pass
if plugin_path_found:
plugin_path = plugin_path_found
else:
# Try a standard location.
p='c:\\Program Files\\VideoLAN\\VLC\\libvlc.dll'
if os.path.exists(p):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment