Wine installs 64-bit WeChat

Every January, wine will release a new stable version. Since wine9.0 contains major changes to the WoW64 part, you can manually turn on the compilation option. The Wayland driver also has experimental support. The atmosphere has been set here. You don’t need to install WeChat 64 Bit of WeChat is itchy.

The latest minor version is wine9.1. The experience process is recorded as follows.

1. Compile and install the latest version of Wine

Download address: https://dl.winehq.org/wine/source/9.x/wine-9.1.tar.xz

Unzip after downloading

1tar -xvf wine-9.1.tar.xz

Modify source code

Why it is necessary to modify the source code has been explained in the previous article and will not be repeated here.

Picture explanation:

wine-source-code-diff.webp

code segment:

1     if (exStyle == 0x080800a0 && style != 0x80000000 ) // WeChat/WxWork shadow hwnd ; fix can not open chat info
2     {
3         FIXME("hack %x\n", cs.dwExStyle);
4         return NULL;
5     }

vscode screenshot (ctrl + p, enter win.c to locate the corresponding line, well-intentioned):

wine-patch

Enter the installation directory

 1➜ wine-9.1 ./configure --enable-archs=i386,x86_64
 2... Omit 10,000 lines here ...
 3creating Makefile rules... done
 4configure: creating ./config.status
 5config.status: creating include/config.h
 6config.status: include/config.h is unchanged
 7config.status: linking tools/winewrapper to wine
 8config.status: executing include/stamp-h commands
 9config.status: executing tools/makedep commands
10config.status: executing Makefile commands
11
12configure: Finished. Do 'make' to compile Wine.
13➜wine-9.1

Judging from the final output above, all warnings have been eliminated. Only those who have compiled understand this hardship.

Note: WoW64 mode is not enabled by default. You can manually enable --enable-archs=i386,x86_64. The advantage is that you can delete a bunch of previous 32-bit dependency packages. Who doesn’t want the system to be clean and tidy? This is also one of the motivations for writing this article.

Compile and install

1➜ wine-9.1 make -j4

The author's 4-core tractor 🚜 has insufficient horsepower and takes about 50 minutes to compile.

1sudo make install

By default, wine related programs are installed to:

 1➜ wine-9.1 ls -al /usr/local/bin/wine*
 2-rwxr-xr-x 1 root root 25544 Jan 29 14:45 /usr/local/bin/wine*
 3-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/wineboot*
 4-rwxr-xr-x 1 root root 950208 Jan 29 14:49 /usr/local/bin/winebuild*
 5-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/winecfg*
 6-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/wineconsole*
 7lrwxrwxrwx 1 root root 7 Jan 29 14:49 /usr/local/bin/winecpp -> winegcc*
 8-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/winedbg*
 9-rwxr-xr-x 1 root root 1292800 Jan 29 14:49 /usr/local/bin/winedump*
10-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/winefile*
11lrwxrwxrwx 1 root root 7 Jan 29 14:49 /usr/local/bin/wineg++ -> winegcc*
12-rwxr-xr-x 1 root root 277608 Jan 29 14:49 /usr/local/bin/winegcc*
13-rwxr-xr-x 1 root root 95127 Jan 29 14:49 /usr/local/bin/winemaker*
14-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/winemine*
15-rwxr-xr-x 1 root root 1973 Jan 29 14:45 /usr/local/bin/winepath*
16-rwxr-xr-x 1 root root 49800 Jan 29 14:45 /usr/local/bin/wine-preloader*
17-rwxr-xr-x 1 root root 4264728 Jan 29 14:45 /usr/local/bin/wineserver*

2. Install 64-bit WeChat in wine

Go to the WeChat official website to download the WeChat installation package

Downloaded the windows version

download-wechat-step1

This time I chose 64-bit. There is no problem. I have tested it with Lei Lei Pioneer, so I choose it boldly.

download-wechat-step2

Direct installation

1➜ Downloads wine WeChatSetup.exe

The rest is normal operation, and you should be able to do the next step along the way.

At this point, 64-bit WeChat can run normally, but there is a problem with input in the input box.

3. Solve the input abnormality in the input box

Install winetricks

1sudo apt install winetricks

Upgrade winetricks. To be honest, I didn’t know this could be upgraded by myself before. After the upgrade, the problem of invalid download addresses will be solved.

1sudo winetricks --self-update

Install riched20 riched30 richtx32 msftedit. I haven’t tested whether it is possible if one of them is missing.

1winetricks riched20 riched30 richtx32 msftedit

After installing the above package, the WeChat input box will be normal, and it can be deleted, the cursor can be positioned normally, and emojis can be sent.

Whether the process is painful or not, I can only ask xxx that xxx, it must be civilized, everyone is busy making money, who is to blame?

4. Others

Open Wayland driver

1wine reg.exe add HKCU\\Software\\Wine\\Drivers /v Graphics /d x11,wayland

Didn’t find any effect 😅.

To fix waybar icon error, please search my previous article.

Post pictures to prove that the latest version works

newest wechat
wechat type

Some readers have asked whether the CPU usage is normal. It does freeze for a while when starting WeChat and clicking on settings, but there are no problems after that. The resource usage is not as high as that of Firefox, and it is 👌 for daily use.

wechat cpu

5. How to delete 32-bit dependent packages

Refer to this article: https://askubuntu.com/questions/113301/how-to-remove-all-i386-packages-from-ubuntu-64bit

If you find that it cannot be deleted, add the allow-remove-essential -f parameter. You are responsible for the consequences and do not bear any joint and several liability. I deleted it anyway and there is no problem. After all, 64-bit is now mainstream. Readers can make their own judgment.

5. Summary

Why do you need to compile it manually?

  • Make enough food and clothing by yourself, and you can use new functions and new versions at any time;
  • Help newcomers to Linux. After all, many people saw that WeChat could not be used and directly persuaded them to quit.

Residual problems: Various places where WeChat’s built-in browser is used, such as search, video account, mini program panel, and screenshots, cannot work. Generally, these functions are not used on Linux. They are irrelevant and are mainly used for chat and Moments. , public account and other functions.

Lastmod: Friday, February 2, 2024

See Also:

Translations: