Published: 2022/05/14
Last updated: 2024/11/08
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.
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
Should the winecfg window be too small to properly operate, try going to the Graphics tab and adjusting the “screen resolution” slider all the way to the right, then hit “OK” and try again.
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, and MID, but at the expense of 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, or else use the wonderful shell script written by Cidoku.
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.
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”.
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 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.
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 fluidsynth or 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 the daemon is running before you launch Comic Chat.
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.
I wrote a little wrapper script for myself to handle both the proxy and MIDI daemon 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
# for fluidsynth...
# fluidsynth -lsi '/path/to/soundfont.sf2' &
# echo $! > "$MIDI_PID"
# or else for timidity...
# timidity -iA -B2,8 -Os1l -s 44100 -c 'path/to/timidity.cfg' &
# echo $! > "$MIDI_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 "$MIDI_PID")" "$(cat "$CCHATPROXY_PID")"
rm "$MIDI_PID" "$CCHATPROXY_PID"
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.
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
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.
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:
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.
There are a few quirks I feel I should cover: