Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
856 stars 155 forks source link

Patch failure shell32-Append-exe #1077

Closed mikeserv-git closed 11 months ago

mikeserv-git commented 11 months ago

This is for a current proton-tkg build, with Valve Bleeding Edge.

It's a good thing the patch failed on context, so it didn't cause a build failure or something.

This is ultimately the patch, something downloaded during the build:

/tmp/wine-tkg/src/wine-staging-git/patches/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch

I don't know how to override the patches that aren't downloaded yet, so disabled it with:

_staging_args=(-W shell32-registry-lookup-app)

and made a new patch. It jumped out at me that they were using wcscpy(buffer, L"Software\Microsoft\Windows\CurrentVersion\App Paths\"); and sanitizing it rather than lstrcpyW and lstrcatW so I did the following (.mypatch)

I chose .mypatch rather than staging, because I based it on what was already prepared in /tmp.

Don't know, works for me, hope it helps... somebody :-)

wine-tkg-git/wine-tkg-git/wine-tkg-userpatches/shell32-registry-lookup-app-new.mypatch

--- a/dlls/shell32/shlexec.c    2023-09-30 20:21:32.000000000 -0400
+++ b/dlls/shell32/shlexec.c    2023-09-30 21:05:29.000000000 -0400
@@ -437,8 +437,10 @@

     wcscat(buffer, szName);
     res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
-    if (res) goto end;
-
+    if (res)
+        res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wcscpy(buffer, L".exe"), 0, KEY_READ, &hkApp);
+    if(res)
+        goto end;
     len = MAX_PATH*sizeof(WCHAR);
     res = RegQueryValueW(hkApp, NULL, lpResult, &len);
     if (res) goto end;
TheComputerGuy96 commented 11 months ago

@mikeserv-git The latest staging commit already fixed this I think

Tk-Glitch commented 11 months ago

Valve trees are using a specific staging commit (v8.0 in this case) since there are far too many changes upstream for it to apply with, let's say, v8.17. Mikeserv-git's approach is right, and I'll add a hotfix for this. Thanks!