大家好! 今天我向大家讲解如何在 Ubuntu 18.04 系统上安装微信桌面客户端。

This post describes how to install WeChat for PC on Ubuntu using Wine.
More specifically, I will be using Ubuntu 18.04, but the procedure should be similar for other releases.

Installing WineHQ

Install WineHQ according to the instruction in https://wiki.winehq.org/Ubuntu.
Install the staging branch for the most up-to-date packages.

Setup Wine

Open a terminal (Ctrl + Alt + T) and run the following commands:

export WINEARCH=win32
export WINEPREFIX=~/.wine32
winecfg

When you run the winecfg command for the first time, Wine will start to setup the required environment under the specified WINEPREFIX, which in this case we set to ~/.wine32.

You should be prompted with the dialogues below. Choose Install for both.

Wine Mono Installer Wine Gecko Installer

Finally, once both installers are finished, this window should appear:

winecfg

If you are using a HiDPI screen, it might be worth scaling the interface under Screen resolution, in the Graphics tab:

winecfg

Providing a Chinese font

For the Chinese characters to be rendered correctly we need to provide Wine with a Chinese font. We will use winetricks for this, which is a helper script to download and install extra Wine stuff.

Download winetricks:

wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks

Set the executable flag:

chmod +x winetricks

Some winetricks “packages” require a few external tools to be installed. We need cabextract:

sudo apt install cabextract

And now we install the fonts and some other libraries:

./winetricks corefonts gdiplus riched20 riched30 wenquanyi

Finally, we need to edit regedit to enable the font we just installed. Download this .reg file.

Open regedit with the command:

./winetricks regedit

The following window should show up:

winecfg

In the Menu bar, click Registry and select Import Registry File…

When the browser shows up, select the .reg file you have just downloaded. If successful, the following dialogue should greet you:

winecfg

Installing WeChat

We are now ready to install WeChat itself. Download the installer from here:

WeChat download page

Once the download has finished, install it by running:

wine ~/Downloads/WeChat_C1018.exe

Please note that your installer might be more recent than the version shown here. As such, you might need to change WeChat_C1018.exe to whichever installer you have downloaded.

The installer should start. Click on Install WeChat.

Installer

Final result

After the installation has completed, you may launch WeChat. The application should be listed in the Applications drawer:

Ubuntu dash icon

Stickers work too!

System Tray on Gnome

If you are using Gnome on Ubuntu 18.04 or a more recent release, chances are you will be greeted by this nasty windowed legacy system tray:

Installer

Install this Gnome Extension and the problem will be gone:

top-icons gnome extension