Prevent registry reset when updating wine?

Questions about Wine on Linux
Locked
Mikko_H
Level 1
Level 1
Posts: 5
Joined: Wed Oct 21, 2020 10:02 am

Prevent registry reset when updating wine?

Post by Mikko_H »

Greetings,

I use wine-staging on arch so updates are common. Each update all my custom wine registry changes are gone. Any way to prevent this?
Mikko_H
Level 1
Level 1
Posts: 5
Joined: Wed Oct 21, 2020 10:02 am

Re: Prevent registry reset when updating wine?

Post by Mikko_H »

Potential fix:

I might have had wine applications open while making manual edits to registry, leading to system.reg not updating.

Now trying with a .reg file with no wine processes running. Hopefully edits stick next update.
madewokherd
Level 4
Level 4
Posts: 143
Joined: Mon Jun 02, 2008 5:03 pm

Re: Prevent registry reset when updating wine?

Post by madewokherd »

I recommend using reg.exe or regedit.exe to prevent this.
Mikko_H
Level 1
Level 1
Posts: 5
Joined: Wed Oct 21, 2020 10:02 am

Re: Prevent registry reset when updating wine?

Post by Mikko_H »

Sorry if I wasn't clear enough. Using regedit to edit the registry.

Wine updated and the issue is still present. I did notice though that only edits related to file types reset.

This didn't reset:

Code: Select all

[HKEY_CLASSES_ROOT\folder\shell]
[HKEY_CLASSES_ROOT\folder\shell\open]
[HKEY_CLASSES_ROOT\folder\shell\open\command]
@="\"C:\\windows\\system32\\winebrowser.exe\" -nohome \"%1\""
[-HKEY_CLASSES_ROOT\folder\shell\open\ddeexec]
But this one did:

Code: Select all

[HKEY_CLASSES_ROOT\.png]
@="pngfile"
"Content Type"="application/png"
[HKEY_CLASSES_ROOT\pngfile\shell\open\command]
@="C:\\windows\\system32\\winebrowser.exe \"%1\""
Disabling "Manage File Associations" in winecfg has no effect. Any ideas?
Bamm
Level 4
Level 4
Posts: 136
Joined: Thu May 22, 2008 3:18 am

Re: Prevent registry reset when updating wine?

Post by Bamm »

Create a "custom.reg" file containing everything you want. Then everytime you update the prefix, simply run "regedit custom.reg" to restore the changes you made. In fact it is much easier to do it this way than manually editing it in regedit.

Write a shell script with the following content:

Code: Select all

#!/bin/sh
echo "Shutting down wine..."
wineboot -s
wineserver -w
sleep 1
echo "Importing custom reg file..."
regedit "custom.reg"
This works for me for most cases, as I also had some issues before with wine updating the registry while I'm editing it. I noticed there are some registry keys, though, that editing don't work even using this method.
Locked