Setting Up MS Comic Chat in Wine

Published: 2022/05/14

Last updated: 2024/03/07

There’s not a whole lot of consolidated information on how to get MS Comic Chat running in Wine out there. This was kind of annoying until I realised that I have a Web site and can do just that, so here we are.

First Steps

In order to make this work, you need, initially, two pieces of software: wine and winetricks. Both of these are in every package manager out there, so they’re easy to get. If you’re running a Debian-based system, don’t forget to enable “contrib” and multiarch support (sudo dpkg --add-architecture i386), as you’ll also need the “wine32” package. Debian-based users would also be highly advised to follow the instructions on WineHQ and use their PPA.

The somewhat tricky part, however, is that wine needs to run from a 32-bit prefix, and on a 64-bit system, that’s not the default. In order to make one, run the following command:

$ WINEARCH=win32 WINEPREFIX=~/.wine32 wine wineboot

You can replace “.wine32” with whatever you want. Afterwards, make sure that WINEPREFIX is set, just like above, before running any wine-related commands.

If all of that is too much hassle, you might consider using a tool like Lutris to manage your prefixes instead, but I’m not going to write a how-to for any of them.

Once both are installed, you’ll need to set the default version of Windows to Windows XP via winecfg:

$ WINEPREFIX=~/.wine32 winecfg

After that, you’ll need to get some additional packages via winetricks:

$ WINEPREFIX=~/.wine32 winetricks riched20 comicsans corefonts wmp9

The known (or believed) reasons for each:

If your version of wine is older, you may need to also install “ie6” in order to automatically download avatars. You’re probably better off updating Wine, though.

Once all of that is set up, you can then download Comic Chat. The best – indeed, nearly only – resource for all things Comic Chat is Mermeliz’s Comic Chat page. There are two versions available: the normal version and one that has been hexedited to allow mp3 playback for IRC sounds in addition to WAV, MID, and RMI files. If you intend to do this, note you’ll need to install the normal version first.

You may also notice that Mermeliz’s site offers a character editor. At this point in time, I am unaware of any way to make it run correctly under Wine, so don’t get your hopes up. Your best bet is to import what you need into a Windows 9x or XP VM and work from there.

After downloading the Comic Chat installer, run it:

$ WINEPREFIX=~/.wine32 wine ~/Downloads/mschat25.exe

It will most likely crash at the end, but you should still find that it was successfully installed as “MS Comic Chat” under “Program Files” in your wine directory, which you can run like so:

$ WINEPREFIX=~/.wine32 wine "$HOME/.wine32/drive_c/Program Files/Microsoft Chat/CChat.exe"

Don’t forget to click the button on the toolbar to change from the default text view to the comic strip view. This also enables a number of related options in the main “Options” window.

Fine-Tuning

At this point, it might be helpful to do a little fine-tuning.

To make links (usually) clickable, and launch them in your default browser, you need to invoke winecfg:

WINEPREFIX=~/.wine32 winecfg

From there, click the “Libraries” tab and then set “urlmon” to “(builtin)”, then click “OK”.

More Avatars and Backgrounds

Avatars of people you chat with (at least those that are kept up to date) will auto-download as you need them, provided you have enabled the relevant options under “View->Options->Comic View”, or on-demand by right-clicking the user in the nicklist and selecting “Download Comic Character”.

You can get more avatars and backgrounds at Mermeliz’s site; they go in the “ComicArt” subdirectory. While the ones there are up to date, avatars obtained elsewhere with outdated URLs must be recreated (Meremliz’s site has utilities for dumping poses) or hexedited to correct the URL. The file structure isn’t really documented, so the only “safe” edits are those that take up the exact same amount of characters as were present originally – for instance, changing a “.net” to a “.com”. It is also worth noting that, experimentally, the maximum file size for an auto-downloadable avatar seems to be about 1 MB.

Of course, it is always possible to just ask people to upload their avatars for you and download them manually.

Unfortunately, I’m not aware of any mechanism for easily updating avatars that have been altered since they were downloaded; in such cases it’s simplest to delete and re-download them manually. Due to caching, it may be necessary to restart the client afterwards.

IRC Sounds

IRC Sounds are a little tricky in that all recipients need to have a copy, as the files are played locally. By default MS Comic Chat should search in “C:\Windows\media” for applicable files, but this can be changed in the settings. There are no checks performed aside from a filename check, so keep that in mind.

MIDI Files

As stated before, Comic Chat is natively capable of playing WAV files, and a patch allows for for MP3 playback. For MIDI files, however, you need to run timidity++ as a daemon. Your package manager will probably automatically pull in a fairly dull set of patches by default; there are better ones out there, but it’ll work for now. You’ll need to ensure that timidity++ is running as a daemon before you launch Comic Chat.

HTTPS Proxy

By default, Comic Chat probably won’t be able to connect to any SSL ports. To do so reliably, a proxy is required. A python2 script allowing this can be found on GitHub, however, being python2, it is essentially dead in the water. Do note that should your connection be interrupted, Comic Chat itself may not notice, requiring manual correction.

This script is run with the following invocation:

$ ms-comic-chat-proxy.py -p <port> <server> <+ssl_port>

Note that <port> here is the normal IRC port that you’re trying to wrap, typically 6667, and that <+ssl_port> is the SSL port you’re tunnelling to, typically 6697. The + is not a typo; ensure that it’s included.

With that script running in the background, simply have Comic Chat connect to 127.0.0.1.

Again, being python2, it is deprecated software. However, at this point I am unable to make it work properly with python3. I don’t know python myself, but running it through 2to3(1) and doing a few small manual corrections makes it run. The problem is that it dies any time a non-ANSI character is encountered, rendering it essentially useless. Optimally I’d like to see it ported to Perl, since Perl almost never has big breaking changes. Maybe someday.

Putting It All Together

I wrote a little wrapper script for myself to handle both the proxy and timidity usage. Adjusted for the conventions used here, it would come out like this:

#!/bin/sh

TIMIDITY_PID=$(mktemp)
CCHATPROXY_PID=$(mktemp)
PORT=6667
SSL_PORT=6697
SERVER=irc.server.here

timidity -iA -B2,8 -Os1l -s 44100 &
echo $! > "$TIMIDITY_PID"

ms-comic-chat-proxy.py -p "$PORT" "$SERVER" "+$SSL_PORT" &
echo $! > "$CCHATPROXY_PID"

WINEPREFIX=~/.wine32 wine "$HOME/.wine32/drive_c/Program Files/Microsoft Chat/CChat.exe"

kill "$(cat "$TIMIDITY_PID")" "$(cat "$CCHATPROXY_PID")"
rm "$TIMIDITY_PID" "$CCHATPROXY_PID"

Re-scaling The Comics View

If the comic panels seem a bit too small, you can force them to recalculate their relative size by going to “View->Options->Comic View”, selecting the number of panels per row you want, and then clicking “OK”. This works even if you’ve run the program previously, e.g. at a different resolution.

Adding More Panels

Via some registry hacks, it is possible to convince Comic Chat to display 5, 6, or even 7 panels on the screen at once. To use these in wine, ensure that Comic Chat isn’t running, extract the registry files somewhere in your prefix, and then use regedit’s import functionality. To run regedit in your prefix:

$ WINEPREFIX=~/.wine32 regedit

Sending Files Over DCC

MS Comic Chat supports file transfers over DCC chat, accessible by right-clicking someone’s avatar and selecting “Send File…”, with the resultant file going into the Downloads subdirectory. However, local firewalls can get in the way, both at the router and the OS level. Unfortunately, I do not have reliable information on the port range used, though from informal testing it seems to be fairly vast, ranging from, at least, 32801 to 43106. Further information would be welcome. In the meantime, the only real options are to temporarily disable the firewall or just use a more dedicated service.

Alerts

MS Comic Chat has no real way of getting your attention, unfortunately, at least out of the box. However, using the automation system, we can do something about this. I configured mine to play a sound on every spoken line and to both play a sound and run /whois (thus creating a panel) any time someone joins a room I’m in. By way of example, I’ll illustrate the lattermost action here:

  1. Click View->Automation, or hit <Ctrl>+L.
  2. Select “Rule Sets” and create a container for these rules, if desired.
  3. Select “Rules” and then click on the set you wish to modify.
  4. Click “Add Rule…” and fill in the relevant details:
  1. Click “OK” on everything until all windows are gone.

The delay is normally set to 0, but in this case I set it to 1 second to ensure comic chat has enough time to correctly obtain the avatar data of a fellow comic chat user; failing to do so results in a disparity due to an apparent race condition of sorts.

In order to use sounds, note that they must be a supported type and in the same location as it looks for IRC sounds. The process for setting up the sound events I mentioned previously is very simple, and left as an exercise for the reader, should it be desired.

Known Issues

There are a few quirks I feel I should cover:

I came here to awoo at you

Back to main page