Hi all,
I'm just getting started with wine and I had a quick question - how can I access Wine' registry from a python program? Will winreg work, or do I have to use something else?
Thanks
John
Access Wine registry from python
Re: Access Wine registry from python
I did a simple test and it seems to work.
- Install python 3.10 in Wine 6.20
- Create a python file (C:\WinREG.py):
- Run: python C:\WinREG.py in cmd
- Install python 3.10 in Wine 6.20
- Create a python file (C:\WinREG.py):
Code: Select all
import winreg
#connecting to key in registry
access_registry = winreg.ConnectRegistry(None,winreg.HKEY_LOCAL_MACHINE)
access_key = winreg.OpenKey(access_registry,r"SOFTWARE\Microsoft\Windows\CurrentVersion")
#accessing the key to open the registry directories under
for n in range(20):
try:
x =winreg.EnumKey(access_key,n)
print(x)
except:
break
Code: Select all
python C:\WinREG.py
App Paths
Control Panel
Controls Folder
Explorer
Fonts
Group Policy
Installer
Internet Settings
Policies
PreviewHandlers
Run
RunOnce
RunServices
RunServicesOnce
Setup
Shell Extensions
Telephony
Time Zones
Uninstall
URL
Re: Access Wine registry from python
Perfect - thank you!