Skip to content

Commit

Permalink
umu_util: do not check if winetricks settings verbs are installed
Browse files Browse the repository at this point in the history
Umu would complain and refuse to go back and forth between settings,
such as `sound=alsa` and `sound=pulse`, as they were written in
`winetricks.log`
  • Loading branch information
loathingKernel committed Jan 6, 2025
1 parent 5442348 commit a37f60f
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 4 deletions.
130 changes: 130 additions & 0 deletions umu/umu_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,133 @@ class GamescopeAtom(Enum):
# Constant defined in prctl.h
# See prctl(2) for more details
PR_SET_CHILD_SUBREAPER = 36

# Winetricks settings verbs dumped from wintricks 20240105
# Script:
# --
# import sys
# from subprocess import PIPE, Popen
#
# with (Popen(["winetricks", "settings", "list"], stdout=PIPE) as wpt,
# Popen(["awk", "{print $1}"], stdout=PIPE, stdin=wpt.stdout) as awkp
# ):
# sys.stdout.write("WINETRICKS_SETTINGS_VERBS = {\n")
# for line in awkp.stdout:
# line = line.decode("utf-8").strip()
# sys.stdout.write(f" \"{line}\",\n")
# sys.stdout.write("}\n")
# --
WINETRICKS_SETTINGS_VERBS = {
"alldlls=builtin",
"alldlls=default",
"autostart_winedbg=disabled",
"autostart_winedbg=enabled",
"bad",
"cfc=disabled",
"cfc=enabled",
"csmt=force",
"csmt=off",
"csmt=on",
"fontfix",
"fontsmooth=bgr",
"fontsmooth=disable",
"fontsmooth=gray",
"fontsmooth=rgb",
"forcemono",
"good",
"grabfullscreen=n",
"grabfullscreen=y",
"gsm=0",
"gsm=1",
"gsm=2",
"gsm=3",
"heapcheck",
"hidewineexports=disable",
"hidewineexports=enable",
"hosts",
"isolate_home",
"macdriver=mac",
"macdriver=x11",
"mackeyremap=both",
"mackeyremap=left",
"mackeyremap=none",
"mimeassoc=off",
"mimeassoc=on",
"mwo=disable",
"mwo=enabled",
"mwo=force",
"native_mdac",
"native_oleaut32",
"nocrashdialog",
"npm=repack",
"nt351",
"nt40",
"orm=backbuffer",
"orm=fbo",
"psm=0",
"psm=1",
"psm=2",
"psm=3",
"remove_mono",
"renderer=gdi",
"renderer=gl",
"renderer=no3d",
"renderer=vulkan",
"rtlm=auto",
"rtlm=disabled",
"rtlm=readdraw",
"rtlm=readtex",
"rtlm=texdraw",
"rtlm=textex",
"sandbox",
"set_mididevice",
"set_userpath",
"shader_backend=arb",
"shader_backend=glsl",
"shader_backend=none",
"sound=alsa",
"sound=coreaudio",
"sound=disabled",
"sound=oss",
"sound=pulse",
"ssm=disabled",
"ssm=enabled",
"usetakefocus=n",
"usetakefocus=y",
"vd=1024x768",
"vd=1280x1024",
"vd=1440x900",
"vd=640x480",
"vd=800x600",
"vd=off",
"videomemorysize=1024",
"videomemorysize=2048",
"videomemorysize=512",
"videomemorysize=default",
"vista",
"vsm=0",
"vsm=1",
"vsm=2",
"vsm=3",
"win10",
"win11",
"win20",
"win2k3",
"win2k8r2",
"win2k8",
"win2k",
"win30",
"win31",
"win7",
"win81",
"win8",
"win95",
"win98",
"windowmanagerdecorated=n",
"windowmanagerdecorated=y",
"windowmanagermanaged=n",
"windowmanagermanaged=y",
"winme",
"winver=",
"winxp",
}
8 changes: 4 additions & 4 deletions umu/umu_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from urllib3.response import BaseHTTPResponse
from Xlib import display

from umu.umu_consts import UMU_LOCAL
from umu.umu_consts import UMU_LOCAL, WINETRICKS_SETTINGS_VERBS
from umu.umu_log import log


Expand Down Expand Up @@ -176,10 +176,10 @@ def is_installed_verb(verb: list[str], pfx: Path) -> bool:

with wt_log.open(mode="r", encoding="utf-8") as file:
for line in file:
_: str = line.strip()
if _ in verbs:
line: str = line.strip()
if line in verbs and line not in WINETRICKS_SETTINGS_VERBS:
is_installed = True
err: str = f"winetricks verb '{_}' is already installed in '{pfx}'"
err: str = f"winetricks verb '{line}' is already installed in '{pfx}'"
log.error(err)
break

Expand Down

0 comments on commit a37f60f

Please sign in to comment.