banner
Xavier Wang

鸟之言语

到墙外,听鸟的声音
twitter
jike
bilibili
github

Use RemoteApp to "fancy implement" WeChat dual opening.

I have two WeChat accounts, one for personal use and one for work. According to WeChat, chat records are only saved on the user's devices such as computers and phones. When logging in to the same WeChat account on different computers, the chat records saved on each device cannot be synchronized, which is a bit inconvenient.

The common practice in the past was to use the "start" command to run multiple instances or use a combination of UWP and Win32 clients to achieve WeChat "multi-opening". However, both of these methods would affect WeChat's automatic login function and cannot solve the problem of synchronizing chat records on different computers.

Since it is not possible to log in to two WeChat accounts on one computer at the same time, why not try a different approach - log in to the work account and personal account on two separate computers, and then "project" WeChat from one device to another, thus achieving "dual-opening" and bypassing the synchronization of chat records and automatic login?

Most people should have heard of remote desktop systems, such as Microsoft Remote Desktop, Sunflower, TeamViewer, and other tools that provide complete desktop connection and remote control experience. What we need is RemoteApp, which was introduced by Microsoft in Windows Server 2008 R2 in 2009. It can provide a similar experience to using local applications and meet the requirements of "application projection".

Network Topology

Preparations#

Device Requirements#

RemoteApp requires a computer running Windows to act as the server, and the system version should be Windows XP ~ 11 Professional, Enterprise, or Ultimate edition. For detailed compatibility information, please refer to Microsoft's Remote Desktop Services documentation.

Client devices can be Windows, macOS, Android, iOS, or other devices capable of connecting to remote desktops, used to connect to RemoteApp.

Network Environment#

To ensure smooth usage, it is recommended that the server has an upstream bandwidth of ≥10Mbps. Since Microsoft's remote desktop does not have a server relay function, directly exposing the server's port 3389 poses a higher security risk. To ensure security, it is recommended to use a proxy tunnel network or tools like Zerotier or TailScale to deploy a virtual LAN. Additionally, you can configure SSL encryption for the remote desktop service to reduce the possibility of unauthorized access.

The school's internal LAN does not have an IPv6 address, so it is not possible to directly connect to a computer in the dormitory with a public IPv6 address through the public network. Therefore, I chose to use Zerotier to build a Site-to-Site virtual LAN here. For detailed instructions, you can refer to articles like "Guide to Remote LAN Access". This article will not go into detail.

After the setup is complete, we can test the virtual network by pinging the IP address of the virtual LAN and attempting to connect to the remote desktop.

Enable Remote Desktop Services#

Microsoft RemoteApp is based on the RDP (Remote Desktop Protocol). We need to enable "Remote Desktop" on the server. This feature is only available on Windows XP ~ 11 Professional, Enterprise, or Ultimate editions. For compatible system versions, please refer to Microsoft's Remote Desktop Services documentation. Go to Settings - System - Remote Desktop, enable the Remote Desktop feature, and then click Remote Desktop Users to set the users allowed to log in to the remote desktop.

Enable Remote Desktop

After the settings are complete, you can try to connect to the remote desktop from a device on the same LAN. One thing to note is that personal editions of Windows, which are not part of the Server series, can only keep one active connection. After connecting to the remote desktop, the logged-in account will enter the lock screen and cannot be used temporarily.

Deploy RemoteApp#

Download and Install RemoteApp Tool, Wix Toolset#

RemoteApp Tool

RemoteApp Tool is a tool that can create and manage RemoteApp on non-Windows Server systems. First, go to the GitHub page to download the installation package of RemoteApp Tool and install it on the server.

If you need to generate an MSI installation package for RemoteApp, you also need to install the WiX Toolset environment. The advantage of an MSI installation package is that after the client is installed, the RemoteApp can be accessed like a local program through the Start menu or desktop shortcuts.

Import Programs and Modify Configuration#

RemoteApp Tool - Main Interface

After the installation is complete, open RemoteApp Tool and click the ➕ Add a new RemoteApp button in the lower-left corner of the main interface. Taking WeChat client as an example, select the path of WeChat.exe C:\Program Files (x86)\Tencent\WeChat\WeChat.exe in the file dialog box that pops up, and then set the name, icon, and file association of the RemoteApp to complete the program addition.

Generate RDP File / MSI Installation Package#

After adding the program, select WeChat in the list and click the 💿 Create Client Connection button in the lower-right corner of the main interface to generate the RDP connection file. There are 6 configuration options - Host (server address), Options (type of connection file to generate), Gateway (remote desktop connection gateway), File types (file association), MSI options (related settings for generating MSI installation packages), and Signing (RDP signature).

RemoteApp Tool - Host Configuration

The configuration items that need attention are Host and Options. In the Host configuration item, you need to enter the IP address of the server. In RemoteApp Tool (version: v6.0.0.0), the default remote desktop port of the server is 3389. If the remote desktop port opened in the port forwarding or firewall settings is not 3389, you need to modify the full address configuration item in the generated RDP connection file. In the Options configuration item, you can select the type of connection file to generate, such as RDP file or MSI installation package.

RemoteApp Tool - Options Configuration

RemoteApp Tool - MSI options Configuration

After completing the settings, click the 💿 Create button in the lower-right corner of the main interface to generate the connection file for RemoteApp. After sending the RDP file or MSI installation package to the client, you can connect to RemoteApp.

RemoteApp Usage Experience#

Dual-Opening Effect

With RemoteApp, I can "log in and use" both my personal WeChat and work WeChat on my office computer at the same time. Both sides use the Win32 version client, and the usage experience in terms of mini-programs and automatic login is better than the UWP version of WeChat. When using RemoteApp to connect to WeChat, there is not much difference in replying to messages, participating in group chats, or slacking off compared to the local client, except for files. Text and images can be copied and pasted between the client and the server.

During the experience, I found several issues with RemoteApp: If a third-party input method is used (I use Sogou input method), both the default input method and the third-party input method will be displayed on the client, and it is not possible to switch input methods using the Win + Space shortcut. The only solution is to close or hide the status bar of the third-party input method.

Shadow Residual Problem

Secondly, there is a chance that the RemoteApp window will have residual shadows, and the cursor may be displayed with an offset from its actual position. If the cursor position is offset, you can minimize RemoteApp and then restore it to fix the issue. As for the window shadow, I have not found a good solution yet.

For WeChat, which has low bandwidth requirements, the usage is smooth, and there is no obvious lag during the experience. However, applications like Cities: Skylines and Adobe Photoshop, which involve large-scale content changes, have higher bandwidth requirements for both the server and the client.

Overall, RemoteApp allows access to applications remotely without storing data on the client, providing a usage experience comparable to local programs when the network is good. The client connecting to RemoteApp is not limited to Windows computers. Devices such as macOS, iOS, Android, or Linux can connect to the remote RemoteApp using the generated RDP file.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.