PietJankbal / Chocolatey-for-wine

Chocolatey packagemanager automatic installer in wine, handy to install quickly programs in wine
90 stars 2 forks source link

Issue with Installing Visual Assist X with VS2022 #24

Open geghamyan opened 1 month ago

geghamyan commented 1 month ago

Hi there,

First of all, great project! I’m amazed at how easily Visual Studio 2022 can be installed using winetricks. One of the main reasons I experimented with it was because I was thinking of using vs22 combination with Whole Tomato's Visual Assist X plugin, which is a fanstastic development setup.

However, I ran into an issue when trying to install Visual Assist X, VSIX package fails . Is there any chance you could suggest how this can be debugged, or do you have any pointers? Any guidance would be greatly appreciated!

Thanks again for your hard work on this!

PietJankbal commented 1 month ago

Hi,

I tried to install it from within Visual Studio but nothing happened when I pushed the install button.

Then I manually downloaded the installer and got a "DuplicateHandle failed" error in a messagebox.

I had a brief look at debuglog (run the installer with WINEDEBUG=+relay,+seh wine VA_X_Setup2530_0.exe &>log) and the was indeed a failing call (kernel32.DuplicateHandle returning 0) but I couldn't find out why it failed. For more debugging you'd have to start from there I guess. I just put a stupid hack in wine's code (see below) and then the installer proceeded and finished. I also had a "tomato welcome" window when I started devenv again but I don't know if it really works.

If you can compile wine yourself you could try hack below; otherwise I could also put up the precompiled dll + hack somewhere in this site

Hack:

diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 2d08481cd35..d4abed93b95 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -731,7 +731,7 @@ BOOL WINAPI SetProcessInformation( HANDLE process, PROCESS_INFORMATION_CLASS inf BOOL WINAPI DECLSPEC_HOTPATCH DuplicateHandle( HANDLE source_process, HANDLE source, HANDLE dest_process, HANDLE *dest, DWORD access, BOOL inherit, DWORD options ) -{ +{ if (source == (HANDLE)0x80000001) return 1; return set_ntstatus( NtDuplicateObject( source_process, source, dest_process, dest, access, inherit ? OBJ_INHERIT : 0, options )); }

PietJankbal commented 1 month ago

Update, this 0x80000001 was puzzling me, I think I now know what goes wrong, the RegLoadAppKey hack needs to be be updated like something like RegOpenKeyExW(HKEY_CURRENT_USER, L"Console", KEY_ALL_ACCESS, 0, result);

I'll recheck tomorrow if that is the cause, and if so, I'll push a new release

PietJankbal commented 1 month ago

I pushed a new release where at least for me the installer finishes. Therefore I changed the hack for RegLoadKey in advapi32. If the Tomato Visual Assistant works I dunno , already had a nice hang for VS ; ), but then after restart VS it ran again. Mind you, it's all experimentall to get this beast going; if you have any interesting findings please let me know.

geghamyan commented 1 month ago

Great, thank you! VAX seems to be working now. However, Visual Studio crashed multiple times during the source code parsing phase. Fortunately, after the full parsing was completed, it appears to be more stable. I'll use WINEDEBUG, as you suggested, to gather more details about the crashes.